10001st prime
Problem 7
By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.
What is the 10 001st prime number?
使用埃拉托斯特尼筛法,不懂得自行Wiki
我的py...
分类:
其他好文 时间:
2014-05-26 05:35:25
阅读次数:
248
Problem Description
Today is Yukari's n-th birthday. Ran and Chen hold a celebration party for her. Now comes the most important part, birthday cake! But it's a big challenge for them to place n ca...
分类:
其他好文 时间:
2014-05-26 04:38:35
阅读次数:
239
题目链接:uva 1350 - Pinary
题目大意:给出n,输出第n给Pinary Number,Pinary Number为二进制数,并且没有连续两个1相连。
解题思路:dp[i]表示到第i位有dp[i]种,于是给定n,一层循环判断dp[i]≤n的话,就输出1,并且n减掉dp[i],注意输出0的时候,不能输出前导0.
#include
#include
typedef l...
分类:
其他好文 时间:
2014-05-26 04:38:12
阅读次数:
212
Problem Description
Everybody knows any number can be combined by the prime number.
Now, your task is telling me what position of the largest prime factor.
The position of prime 2 is 1, prime 3 is ...
分类:
其他好文 时间:
2014-05-26 04:29:14
阅读次数:
371
问题 C: Repeat Number
时间限制: 1 Sec 内存限制: 128 MB
提交: 23 解决: 7
[提交][状态][论坛]
题目描述
Definition: a+b = c, if all the digits of c are same ( c is more than ten),then we call a and b are Repeat Number. My...
分类:
其他好文 时间:
2014-05-26 04:03:34
阅读次数:
228
问题 K: Traveling
时间限制: 1 Sec 内存限制: 128 MB
提交: 13 解决: 4
[提交][状态][论坛]
题目描述
SH likes traveling around the world. When he arrives at a city, he will ask the staff about the number of cities that...
分类:
其他好文 时间:
2014-05-25 01:44:43
阅读次数:
391
题目链接:点击打开链接
题意:有两种操作,合并集合,查询第K大集合的元素个数。(总操作次数为2*10^5)
Treap模板(静态数组)
#include
#include
#include
#include
#include
const int maxNode = 500000 + 100;
const int inf = 0x3f3f3f3f;
struct Tr...
分类:
其他好文 时间:
2014-05-24 23:18:09
阅读次数:
522
问题 L: Prime Factors
时间限制: 1 Sec 内存限制: 128 MB
提交: 36 解决: 28
[提交][状态][论坛]
题目描述
I'll give you a number , please tell me how many different prime factors in this number.
输入
There is multiple te...
分类:
其他好文 时间:
2014-05-24 20:52:54
阅读次数:
311
点击打开链接
题意:
集合S支持一下四种操作:
INSERT(S,x) : 如果S中没有x,则插入x
DELETE(S,x): 如果S中有x,则删除x
K-TH(S): 输出S中第K小的数
COUNT(S,x): 统计S中小于x的数有多少个
一共有Q(1 ≤ Q ≤ 200000)次操作。
Treap模板。。
#i...
分类:
其他好文 时间:
2014-05-24 18:03:11
阅读次数:
213
A bit is a binary digit, taking a logical value of either 1 or 0 (also referred to as "true" or "false" respectively). And every decimal number has a binary representation which is actually a series o...
分类:
其他好文 时间:
2014-05-24 17:19:41
阅读次数:
335