Problem DescriptionGiven an integer N(0 ≤ N ≤ 10000), your task is to calculate N!InputOne N in one line, process to the end of file.OutputFor each N,...
分类:
其他好文 时间:
2015-02-07 11:43:17
阅读次数:
128
Problem DescriptionHey, welcome to HDOJ(Hangzhou Dianzi University Online Judge).In this problem, your task is to calculate SUM(n) = 1 + 2 + 3 + ... +...
分类:
编程语言 时间:
2015-02-06 20:27:57
阅读次数:
167
点击打开链接
TOYS
Time Limit: 2000MS
Memory Limit: 65536K
Total Submissions: 11078
Accepted: 5312
Description
Calculate the number of toys that land in eac...
分类:
其他好文 时间:
2015-02-06 18:57:52
阅读次数:
175
Problem Description
As we know, Big Number is always troublesome. But it's really important in our ACM. And today, your task is to write a program to calculate A mod B.
To make the problem easie...
分类:
其他好文 时间:
2015-02-06 09:34:56
阅读次数:
132
题意:S[n]与所有S[i](i互质,则为Prime S。求(S[n]/X)%M;
思路:由集合性质推得S[i+1]=S[i]+S[i-1],则S[i]是斐波那契数。从第五项开始,每项斐波那契为质数的条件为当且仅当它的项数为质数,因此采用素数打表的方法得到第k个Prime S的斐波那契数的项数。然后用矩阵乘法求出第k个S的值对应的下一个斐波那契数,然后枚举该斐波那契数,直到能被X整除。
#in...
分类:
其他好文 时间:
2015-02-03 13:20:17
阅读次数:
150
For given numbers a and b in function aplusb, return the sum of them.NoteYou don't need to parse the input and output. Just calculate and return.Examp...
分类:
其他好文 时间:
2015-02-03 06:59:57
阅读次数:
122
Problem DescriptionI have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B.InputThe first line of ...
分类:
其他好文 时间:
2015-01-30 19:11:44
阅读次数:
227
题目大意:给你一个奇数N,求1~N中奇数的平方和。
思路:直接暴力超时了,所以用公式来做 S = N*(N+1)*(N+2)/6,因为结果不超int型,
但是中间过程会超一些,所以用__int64来做就可以了。注意cin、cout会超时,用scanf
和printf就可以了。...
分类:
其他好文 时间:
2015-01-29 22:36:22
阅读次数:
247
题目大意:计算1~N的立方和
思路:1~N的立方和公式为S(N) = 1^3 + 2^3 + 3^3 + … + N^3 = N^2*(N+1)^2/4。
然后题目要求后四位,取余即可。...
分类:
其他好文 时间:
2015-01-28 21:25:48
阅读次数:
206
Problem Description
Given an integer N(0 ≤ N ≤ 10000), your task is to calculate N!
Input
One N in one line, process to the end of file.
Output
For each N, output N! in one line.
...
分类:
其他好文 时间:
2015-01-26 22:54:23
阅读次数:
236