数论
Polynomial Hierarchy
路漫漫其修远兮,吾将上下而求索。
展开
-
CRT
G - 中国剩余定理 Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64u Submit Status Description Some people believe that there are three cycles in a person's life t原创 2014-07-25 14:20:37 · 790 阅读 · 0 评论 -
偶->素数打表
A - 高效素数打表 Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Description 哥德巴赫猜想大家都知道一点吧.我们现在不是想证明这个结论,而是想在程序语言内部能够表示的数集中,任意取出一个偶数,来寻找两个素数,使得其和等于该原创 2014-07-25 09:52:01 · 547 阅读 · 0 评论 -
整数快速幂
B - 整数快速幂 Time Limit:1000MS Memory Limit:30000KB 64bit IO Format:%I64d & %I64u Submit Status Description People are different. Some secretly read magazines full of interesting原创 2014-07-25 09:35:26 · 599 阅读 · 0 评论 -
大数阶乘
A - N! Time Limit:5000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Description Given an integer N(0 ≤ N ≤ 10000), your task is to calculate N!原创 2014-07-29 15:20:01 · 553 阅读 · 0 评论 -
唯一分解
#include #include #include #include using namespace std; #define M 2000000000 #define INF 2000000000 int ons = 0,ans = 0; int prime[100000]; int v[4000]; void init(){ for(int i = 2;i<=(int)sqrt(1.0原创 2015-09-06 11:11:47 · 616 阅读 · 0 评论 -
神奇stl- - Little Pony and Expected Maximum
F - Little Pony and Expected Maximum Time Limit:1000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64u Submit Status Practice CodeForces 453A Description Twilight Sparkle原创 2015-10-18 19:31:53 · 491 阅读 · 0 评论 -
uva 1637 - Double Patience
uva 1637 Double Patience (全概率) 根据全概率公式: 每次取得的概率是一样的,所以进行操作的时候,可以将所有的概率加起来,然后除以他们发生的种类数,递归中所有的情况都是全概率的情况,所以每个概率都需要计算出来,然后慢慢往上推出来,最后获取一开始的情况,乘以条件发生的概率1/k,k为一开始可以取得方法数。 WRONG ANSWER: #include #include原创 2015-09-24 15:31:59 · 456 阅读 · 0 评论 -
uva 12034 Race(递推+组合数)
Race 杨辉三角求组合数用来取余数,利用递推公式或者其他带有除号的式子存在问题,具体问题未解决! #include #include #include using namespace std; int zuhe[1010][1010]; void init(){ zuhe[1][0] = zuhe[1][1] = 1; for(int i = 2;i<=1000;i++){原创 2015-09-24 20:02:20 · 540 阅读 · 0 评论