随笔分类 -  POJ

摘要:1 /* 2 POJ2115 C Looooops 3 http://poj.org/problem?id=2115 4 扩展欧几里得 5 题意:求x, s.t. (a+c*x)=b (mod 1 c*x=b-a (mod 1 9 #include 10 #include 11 #include 12 #include 13 #include 14 #include... 阅读全文
posted @ 2017-04-13 08:37 BBBob 阅读(171) 评论(0) 推荐(0) 编辑
摘要:1 /* 2 POJ2116 Death to Binary? 3 http://poj.org/problem?id=2116 4 齐肯多夫定理 5 6 */ 7 #include 8 #include 9 #include 10 #include 11 #include 12 #include 13 #include 14... 阅读全文
posted @ 2017-04-12 11:14 BBBob 阅读(183) 评论(0) 推荐(0) 编辑
摘要:1 /* 2 POJ3318 Matrix Multiplication 3 http://poj.org/problem?id=3318 4 随机化算法 矩阵 5 随机一个1×n的矩阵h 6 在ab=c左右两边左乘h 7 验证是否相等 8 然而不知道为什么g++交就会RE, 9 c++交AC 10 * 11 */ 12 #inclu... 阅读全文
posted @ 2017-04-06 13:49 BBBob 阅读(201) 评论(0) 推荐(0) 编辑
摘要:1 /* 2 POJ2389 Bull Math 3 http://poj.org/problem?id=2389 4 高精度乘法 5 * 6 */ 7 #include 8 #include 9 #include 10 using namespace std; 11 const int Nmax=1000; 12 struct BigI... 阅读全文
posted @ 2017-03-27 14:54 BBBob 阅读(130) 评论(0) 推荐(0) 编辑
摘要:1 /* 2 POJ1061 青蛙的约会 3 http://poj.org/problem?id=1061 4 扩展欧几里得 5 6 原题为求t使得,存在l满足 7 (x+mt)-(y+nt)=cl 8 即求 9 cl+(n-m)t=x-y 10 * 11 * 12 * 13 */ 14 15 #include 16 #includ... 阅读全文
posted @ 2017-03-23 20:27 BBBob 阅读(154) 评论(0) 推荐(0) 编辑
摘要:1 /* 2 POJ2960 S-Nim 3 http://poj.org/problem?id=2960 4 博弈论 SG函数 5 * 6 */ 7 8 #include 9 #include 10 #include 11 using namespace std; 12 const int Nmax=10005; 13 //s[]:可以取走的石子个数 1... 阅读全文
posted @ 2017-03-17 11:58 BBBob 阅读(143) 评论(0) 推荐(0) 编辑
摘要:1 /* 2 POJ2480 Longge's problem 3 http://poj.org/problem?id=2480 4 数论 欧拉函数 线性筛 5 6 求sigma_i=1^n{gcd(i,n)} 7 sigma_d|n{d*phi(n/d)} 8 * 9 * 10 * 11 * 12 */ 13 #include 1... 阅读全文
posted @ 2017-03-15 00:36 BBBob 阅读(208) 评论(0) 推荐(0) 编辑
摘要:/* POJ 2478 Farey Sequence http://poj.org/problem?id=2478 欧拉函数 线性筛 原问题转化成1-n之间的欧拉函数和,因此利用线性筛在O(n)时间内求出其欧拉函数值 在求前缀和即可。 * * * */ #include #include using namespace std; const int Nmax=1000005; lon... 阅读全文
posted @ 2017-03-09 17:16 BBBob 阅读(135) 评论(0) 推荐(0) 编辑
摘要:题目地址 主席树+离散化 因为主席树空间开小了RE了两次,呜呜呜 一定要注意空间大小 阅读全文
posted @ 2016-10-07 12:30 BBBob 阅读(159) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示