题意:给出一个N(2 #include #include #include #include #include #include #include #include using namespace std;/* ********************************************...
分类:
其他好文 时间:
2015-10-20 19:27:33
阅读次数:
201
DescriptionThe ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the four...
分类:
其他好文 时间:
2015-10-19 20:49:43
阅读次数:
245
#include<stdio.h>
#include<math.h>
intmain()
{
intnum=0;
intret=0;
printf("pleaseinputthenumber:\n");
scanf("%d",&num);
ret=prime(num);
if(ret==1)
{
printf("%disprime",num);
}
else
{
printf("%disnotprime",num);
}
return0;
}
..
分类:
编程语言 时间:
2015-10-17 07:11:37
阅读次数:
253
Prime QueryTime Limit:1 Second Memory Limit:196608 KBYou are given a simple task. Given a sequenceA[i]withNnumbers. You have to perform Q operations o...
分类:
其他好文 时间:
2015-10-16 20:26:22
阅读次数:
315
这道题我改啊,改啊,交啊,就对了。#include #include #include #include#include using namespace std;const int N = 10000005;const int M = 100005;int a[N];int p[M];int tre...
分类:
其他好文 时间:
2015-10-13 22:51:16
阅读次数:
274
Can you find it
Time Limit: 8000/5000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 822 Accepted Submission(s): 365
Problem Description
Given a prime number C...
分类:
其他好文 时间:
2015-10-11 11:38:37
阅读次数:
166
Description:Count the number of prime numbers less than a non-negative number,n.解题思路:神一样的提示一步步给出了最佳解法。The Sieve of Eratosthenes uses an extra O(n) mem...
分类:
其他好文 时间:
2015-10-11 09:02:16
阅读次数:
214
Write a program to check whether a given number is an ugly number.Ugly numbers are positive numbers whose prime factors only include2, 3, 5. For examp...
分类:
其他好文 时间:
2015-10-08 21:33:52
阅读次数:
165
Write a program to check whether a given number is an ugly number.Ugly numbers are positive numbers whose prime factors only include2, 3, 5. For examp...
分类:
其他好文 时间:
2015-10-07 11:59:16
阅读次数:
371
Count the number of prime numbers less than a non-negative number,n.计算小于n的质数的个数,当然就要用到大名鼎鼎的筛法了,代码如下,写的有点乱不好意思。 1 class Solution { 2 public: 3 int ...
分类:
其他好文 时间:
2015-10-06 23:48:41
阅读次数:
383