Largest prime factor
Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 7195 Accepted Submission(s): 2554
Problem Description
Eve...
分类:
其他好文 时间:
2014-12-05 21:21:41
阅读次数:
226
Problem DescriptionYour task is to Calculate a + b.InputThe input will consist of a series of pairs of integers a and b, separated by a space, one pai...
分类:
其他好文 时间:
2014-12-05 21:13:59
阅读次数:
150
Problem DescriptionYour task is to Calculate a + b.Too easy?! Of course! I specially designed the problem for acm beginners.You must have found that s...
分类:
其他好文 时间:
2014-12-05 21:10:20
阅读次数:
237
Problem DescriptionYour task is to Calculate a + b.InputInput contains an integer N in the first line, and then N lines follow. Each line consists of ...
分类:
其他好文 时间:
2014-12-05 21:00:44
阅读次数:
327
Problem DescriptionYour task is to calculate the sum of some integers.InputInput contains an integer N in the first line, and then N lines follow. Eac...
分类:
其他好文 时间:
2014-12-05 20:59:08
阅读次数:
212
Problem DescriptionYour task is to calculate the sum of some integers.InputInput contains an integer N in the first line, and then N lines follow. Eac...
分类:
其他好文 时间:
2014-12-05 20:58:18
阅读次数:
147
/*
题意:输入有多组数据,每组数据一个n,如果n是素数,输出0否则输出离n最近的两个素数的积,第100000个素数是1299709,所有的素数都在这个范围内
思路:素数筛法加二分查找下界
*/
#include
int a[1299720],pri[100005];
int Serch(int v)//二分查找下界
{
int mid,x=0,y=100001;
...
分类:
其他好文 时间:
2014-12-04 18:06:31
阅读次数:
177
// 100 prime number// 筛选法 即:“埃拉托色尼筛选法”// 找出一个非素数就把它挖掉,最后剩下就是素数/* * 找出1~n的素数表 * 1、挖去1 * 2、用下一个未挖去的数p去除p后面各数,把p的倍数挖掉 * 3、检查p是否小于n的整数部分(如果n=1000,则坚持p#inc...
分类:
其他好文 时间:
2014-12-03 13:51:18
阅读次数:
150
Problem DescriptionGiven a sequence 1,2,3,......N, your job is to calculate all the possible sub-sequences that the sum of the sub-sequence is M.Input...
分类:
其他好文 时间:
2014-12-02 19:10:55
阅读次数:
164
publicclasssushu{ publicstaticvoidmain(String[]args){ inti,m=1000; intcount=0; for(i=1;i<=m;i++){ if(prime(i)){ count++; System.out.print(i+""); if(count%10==0){ System.out.println(); } } } System.out.println();System.out.println("1-100..
分类:
其他好文 时间:
2014-12-02 15:27:49
阅读次数:
156