摘要: 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) 编辑
摘要: 1 /* 2 HDU6010 Daylight Saving Time 3 http://acm.hdu.edu.cn/showproblem.php?pid=6010 4 模拟 5 题意:算当前时间是否是夏令时 6 7 */ 8 #include 9 #include 10 using namespace std; 11 //#defin... 阅读全文
posted @ 2017-03-24 11:57 BBBob 阅读(514) 评论(0) 推荐(0) 编辑
摘要: 1 /* 2 HDU5926 Mr. Frog’s Game 3 http://acm.hdu.edu.cn/showproblem.php?pid=5926 4 杂题水题 5 * 6 */ 7 #include 8 #include 9 using namespace std; 10 const int Nmax=35; 11 int t,n,m; 12 int... 阅读全文
posted @ 2017-03-24 11:54 BBBob 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 1 /* 2 HDU5924 Mr. Frog’s Problem 3 http://acm.hdu.edu.cn/showproblem.php?pid=5924 4 数论 5 * 6 */ 7 #include 8 int main() 9 { 10 long long a,b; 11 int t; 12 scanf("%d",&t); ... 阅读全文
posted @ 2017-03-24 11:52 BBBob 阅读(228) 评论(0) 推荐(0) 编辑
摘要: 1 /* 2 HDU5979 Convex 3 http://acm.hdu.edu.cn/showproblem.php?pid=5979 4 计算几何 三角形面积公式 5 * 6 * 7 */ 8 #include 9 #include 10 #include 11 using namespace std; 12 const double Pi=acos(... 阅读全文
posted @ 2017-03-24 11:47 BBBob 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 1 /* 2 HDU5976 Detachment 3 http://acm.hdu.edu.cn/showproblem.php?pid=5976 4 数论 等差数列 5 * 6 * 7 */ 8 #include 9 #include 10 #include 11 using namespace std; 12 const int mod=10000000... 阅读全文
posted @ 2017-03-24 11:45 BBBob 阅读(285) 评论(0) 推荐(0) 编辑
摘要: 1 /* 2 HDU3236 Gift Hunting 3 http://acm.hdu.edu.cn/showproblem.php?pid=3236 4 dp 滚动数组 5 * 6 * 7 */ 8 #include 9 #include 10 using namespace std; 11 const int Nmax=305; 12 const int ... 阅读全文
posted @ 2017-03-24 11:39 BBBob 阅读(161) 评论(0) 推荐(0) 编辑