hdu 2114(立方和)
来源:互联网 发布:mac定制双用粉底液色号 编辑:程序博客网 时间:2024/05/03 08:25
hdu 2114
证明:
(排列组合法)
#include <iostream>#include <cstdio>#include <cstring>#include <algorithm>#include <cstdlib>#include <cmath>#define LL __int64#define MAX 0x3f3f3f3f#define MOD (10000)#define N (1000000 + 5)using namespace std;int a[N];int main(){ int n; while (~scanf("%d", &n)) { LL ans; n = n % MOD; if (n & 1) { ans = (n + 1) / 2 * n; } else { ans = n / 2 * (n + 1); } ans = ans * ans % MOD; if (ans < 10) { printf("000%I64d\n", ans); } else if (ans < 100) { printf("00%I64d\n", ans); } else if (ans < 1000) { printf("0%I64d\n", ans); } else { printf("%I64d\n", ans); } }}
0 0
- hdu 2114(立方和)
- hdu-平方和与立方和
- HDU 2007 平方和立方和
- HDU 2114 Calculate S(n) (立方和的计算)
- HDU 2007 - 平方和 和 立方和
- hdu 2007 平方和和立方和
- hdu 2007 平方和与立方和
- HDU 2007 平方和与立方和
- HDU 2007 平方和与立方和
- HDU-2007平方和与立方和
- HDU 2007 平方和与立方和
- HDU--2007 -- 平方和与立方和
- HDU-2007 平方和与立方和
- hdu 2007 平方和与立方和
- HDU 2007 平方和与立方和
- [hdu 2007] 平方和与立方和
- HDU 2007 平方和与立方和
- HDU 2007 平方和与立方和
- 简单计算
- 快速排序(找主元)
- lightoj1003 Drunk
- Android 实现QQ侧滑界面之实现
- Palindrome Linked List
- hdu 2114(立方和)
- Educational Codeforces Round 1 B. Queries on a String
- 手机键盘
- 【问题】Unable to read TLD "META-INF/c.tld"错误(JSP不能成功显示时的报错)
- LED显示屏
- Android-----Fragment抽取
- Android-UI布局---onLayout、layout方法
- 代理模式
- 相对路径和绝对路径的区别