题目:Write a program to find the nth super ugly number.Super ugly numbers are positive numbers whose all prime factors are in the given prime list prime...
分类:
其他好文 时间:
2015-12-04 22:38:18
阅读次数:
118
题目:Write a program to find the n-th ugly number.Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 1, 2, 3, 4, 5...
分类:
其他好文 时间:
2015-12-04 22:34:42
阅读次数:
163
#include#include#include#includeusing namespace std;int prime[200000],primetot=0;const int maxn=1000000;bool bo[1000010];int primenum[1000010];int T,n...
分类:
其他好文 时间:
2015-12-02 20:48:24
阅读次数:
227
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-11-30 02:16:33
阅读次数:
211
1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 8 int prime[1000000]; 9 int vis[1000000];10 int normal_sieve(int n)1.....
分类:
其他好文 时间:
2015-11-30 00:54:13
阅读次数:
167
#include"cstdio"#include"queue"#include"cstring"using namespace std;const int MAXN=10000;typedef pair P;int vis[MAXN];int s,e;bool prime(int x){ fo...
分类:
其他好文 时间:
2015-11-29 17:50:56
阅读次数:
138
Superprime RibButchering Farmer John's cows always yields the best prime rib. You can tell prime ribs by looking at the digits lovingly stamped across...
分类:
其他好文 时间:
2015-11-28 15:07:18
阅读次数:
151
Prime PalindromesThe number 151 is a prime palindrome because it is both a prime number and a palindrome (it is the same number when read forward as b...
分类:
其他好文 时间:
2015-11-28 13:31:24
阅读次数:
188
Write a program to find then-th ugly number.Ugly numbers are positive numbers whose prime factors only include2, 3, 5. For example,1, 2, 3, 4, 5, 6, 8...
分类:
其他好文 时间:
2015-11-28 10:35:10
阅读次数:
140
Prime power triplesThe smallest number expressible as the sum of a prime square, prime cube, and prime fourth power is 28. In fact, there are exactly ...
分类:
其他好文 时间:
2015-11-27 21:37:09
阅读次数:
201