码迷,mamicode.com
首页 >  
搜索关键字:calculate prime s    ( 3428个结果
hdu 5139 (离线处理)
题意: f(n)=(∏i=1nin?i+1)%1000000007 You are expected to write a program to calculate f(n) when a certain n is given. 思路: 写出前几项,就很容易得出递推式。但是因为n的数据范围是1~10000000,而内存给的小 ,所以并不能直接打表(MLE) 采用离线处理——...
分类:其他好文   时间:2015-05-12 18:50:38    阅读次数:117
ACM学习历程—HDU1003 Max Sum(dp && 最大子序列和)
DescriptionGiven a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the ma...
分类:其他好文   时间:2015-05-12 18:44:10    阅读次数:129
Max Sum
Problem DescriptionGiven a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7)...
分类:其他好文   时间:2015-05-12 15:18:08    阅读次数:89
HDU 2138 How many prime numbers
How many prime numbersTime Limit: 1000msMemory Limit: 32768KBThis problem will be judged onHDU. Original ID:213864-bit integer IO format:%I64d Java cl...
分类:其他好文   时间:2015-05-12 13:17:52    阅读次数:102
HDU_1016
#include #include #include #include using namespace std; const int Max = 40; bool prime[Max]; bool vis[Max]; int A[Max]; int n; void IsPrime() { prime[0] = prime[1] = 0; prime[2] = 1; for(i...
分类:其他好文   时间:2015-05-11 21:51:44    阅读次数:121
ZOJ 3772 Calculate the Function(线段树+矩阵)
ZOJ 3772 Calculate the Function(线段树+矩阵)...
分类:其他好文   时间:2015-05-11 18:00:01    阅读次数:132
[HDOJ#1012]u Calculate e
Problem DescriptionA simple mathematical formula for e iswhere n is allowed to go to infinity. This can actually yield very accurate approximations o....
分类:其他好文   时间:2015-05-11 17:42:01    阅读次数:100
LeetCode:Count Primes
题目描述: Description: Count the number of prime numbers less than a non-negative number, n click to show more hints. 思路:利用厄拉多塞筛法。具体操作:先将 2~n 的各个数放入表中,然后在2的上面画一个圆圈,然后划去2的其他倍数;第一个既未画圈又没有被划去的数是3,将它画圈,...
分类:其他好文   时间:2015-05-11 16:08:03    阅读次数:126
hdu5225---Tom and permutation(规律,枚举+乱搞)
Problem Description Tom has learned how to calculate the number of inversions in a permutation of n distinct objects by coding, his teacher gives him a problem: Give you a permutation of n distinct i...
分类:其他好文   时间:2015-05-10 09:50:12    阅读次数:211
解题报告 之 HOJ2276 SOJ2498 Count prime
HOJ2276, SOJ2498 ,Count prime,区间素数筛,数论 Given an integer interval [L, R](L <= R <= 2147483647, R - L <= 1000000), please calculate the number of prime(s) in the interval....
分类:其他好文   时间:2015-05-10 09:47:50    阅读次数:179
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!