摘要: 1 /* 2 CF15C. Industrial Nim 3 http://codeforces.com/problemset/problem/15/C 4 数论 博弈论 尼姆博弈 5 6 典型的尼姆博弈,答案就是所有数的异或值 7 然而在1e16的数据范围下直接异或肯定会T 8 考虑以一个能被4整除的数开始的连续4n个数的异或和为0 9 所以只需找到其余的值,... 阅读全文
posted @ 2017-03-27 16:26 BBBob 阅读(269) 评论(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 阅读(127) 评论(0) 推荐(0) 编辑
摘要: 1 /* 2 HDU1002 A + B Problem II 3 http://acm.hdu.edu.cn/showproblem.php?pid=1002 4 高精度加法 5 * 6 */ 7 #include 8 #include 9 #include 10 using namespace std; 11 const int Nma... 阅读全文
posted @ 2017-03-27 14:44 BBBob 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 1 /* 2 HDU5514 Frogs 3 http://acm.hdu.edu.cn/showproblem.php?pid=5514 4 容斥原理 5 * 6 * 7 */ 8 #include 9 #include 10 #include 11 //#define test 12 using namespace std; 13 const long l... 阅读全文
posted @ 2017-03-27 00:10 BBBob 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 1 /* 2 HDU5130 Signal Interference 3 http://acm.hdu.edu.cn/showproblem.php?pid=5130 4 计算几何 圆与多边形面积交 5 * 6 */ 7 8 9 #include 10 #include 11 #include 12 using namespace s... 阅读全文
posted @ 2017-03-27 00:08 BBBob 阅读(330) 评论(0) 推荐(0) 编辑
摘要: 1 /* 2 CF786A - Berzerk 3 http://codeforces.com/contest/786/problem/A 4 博弈论 5 直接搜出NP状态图。记得要记忆化剪枝。 6 * 7 */ 8 #include 9 #include 10 //#define tle 11 #ifdef tle 12 //#defi... 阅读全文
posted @ 2017-03-24 17:53 BBBob 阅读(388) 评论(0) 推荐(0) 编辑
摘要: 1 /* 2 CF787A - The Monster 3 http://codeforces.com/contest/787/problem/A 4 数学 扩展欧几里得 5 注意x或y为0的时候要特判 6 并且结果要大于b和d 7 */ 8 #include 9 int ex_gcd(int a,int b,int &x,int &y)//solve x,y i... 阅读全文
posted @ 2017-03-24 14:44 BBBob 阅读(354) 评论(0) 推荐(0) 编辑
摘要: 1 /* 2 http://codeforces.com/problemset/problem/449/C 3 cf 449 C. Jzzhu and Apples 4 数论+素数+贪心 5 */ 6 #include 7 #include 8 using namespace std; 9 const int Nmax=100005; 10 int is_prime[Nma... 阅读全文
posted @ 2017-03-24 13:22 BBBob 阅读(292) 评论(0) 推荐(0) 编辑
摘要: 1 /* 2 cf396B. On Sum of Fractions 3 http://codeforces.com/problemset/problem/396/B 4 数论+裂项求和+素数筛+gcd 5 */ 6 #include 7 #include 8 #include 9 using namespace std; 10 const int N... 阅读全文
posted @ 2017-03-24 13:21 BBBob 阅读(828) 评论(0) 推荐(0) 编辑
摘要: 1 /* 2 cf369E. ZS and The Birthday Paradox 3 http://codeforces.com/contest/711/problem/E 4 抽屉原理+快速幂+逆元+勒让德定理+费马小定理+欧拉定理+数论 5 题解:https://amoshyc.github.io/ojsolution-build/cf/cf369/pe.html 6 7... 阅读全文
posted @ 2017-03-24 13:19 BBBob 阅读(194) 评论(0) 推荐(0) 编辑