随笔分类 -  HDU

摘要:1 /* 2 HDU4569 Special equations 3 http://acm.hdu.edu.cn/showproblem.php?pid=4569 4 数论 5 题意:f(x)为一n次方程求是否存在x, s.t. f(x)=0 (mod p^2) 6 其中p为质数 7 首先,我们只需考虑0-p中的x即可,因为其他的x总可以先取模 8 到这个区间,因... 阅读全文
posted @ 2017-04-02 00:22 BBBob 阅读(240) 评论(0) 推荐(0)
摘要:1 /* 2 HDU4572 Bottles Arrangement 3 http://acm.hdu.edu.cn/showproblem.php?pid=4572 4 数论 找规律 5 题意:有m行n列和1-n的数各n个,将其填在m×n的格子里 6 要求同一列中的数各不相同,同一行中相邻两数的差的绝对值不超过1。 7 求每一行中值的和的最小值。 8 9 这道... 阅读全文
posted @ 2017-04-02 00:11 BBBob 阅读(280) 评论(0) 推荐(0)
摘要:1 /* 2 HDU4565 So Easy! 3 http://acm.hdu.edu.cn/showproblem.php?pid=4565 4 数论 快速幂 矩阵快速幂 5 题意:求[(a+sqrt(b))^n ]%m [ ]代表向上取证 6 联想到斐波那契数列,所以第一感觉是矩阵快速幂 7 后来发现根本不用这么麻烦,我们认为a+b*sqrt(c)中... 阅读全文
posted @ 2017-04-01 23:59 BBBob 阅读(250) 评论(0) 推荐(0)
摘要:1 /* 2 HDU2161 Primes 3 http://acm.hdu.edu.cn/showproblem.php?pid=2161 4 数论 水题 5 注意输入截止条件是n 8 #include 9 #include 10 #include 11 #include 12 #include 13 //#define test 14 using namesp... 阅读全文
posted @ 2017-03-29 20:46 BBBob 阅读(209) 评论(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 阅读(137) 评论(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 阅读(342) 评论(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 阅读(524) 评论(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 阅读(191) 评论(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 阅读(235) 评论(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 阅读(167) 评论(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 阅读(295) 评论(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 阅读(169) 评论(0) 推荐(0)
摘要:1 /* 2 HDU1850 Being a Good Boy in Spring Festival 3 http://acm.hdu.edu.cn/showproblem.php?pid=1850 4 博弈论 尼姆博弈 5 6 7 尼姆博弈:异或和为0则先手必败,否则先手必胜 8 * 9 * 10 */ 11 #include 12 #include 1... 阅读全文
posted @ 2017-03-16 19:43 BBBob 阅读(144) 评论(0) 推荐(0)
摘要:1 /* 2 HDU2516 取石子游戏 3 http://acm.hdu.edu.cn/showproblem.php?pid=2516 4 博弈论 斐波那契博弈 5 * 6 * 7 * 8 */ 9 #include 10 #include 11 #include 12 #include 13 #include 14 //#define test 1... 阅读全文
posted @ 2017-03-16 19:21 BBBob 阅读(175) 评论(0) 推荐(0)
摘要:1 /* 2 HDU2188 选拔志愿者 3 http://acm.hdu.edu.cn/showproblem.php?pid=2188 4 博弈论 巴什博奕 5 巴什博奕要注意n 12 int main() 13 { 14 int t; 15 scanf("%d",&t); 16 while(t--) 17 { 18 int ... 阅读全文
posted @ 2017-03-16 11:24 BBBob 阅读(120) 评论(0) 推荐(0)
摘要:1 /* 2 HDU2149 Public Sale 3 http://acm.hdu.edu.cn/showproblem.php?pid=2149 4 博弈论 巴什博奕 5 * 6 * 7 * 8 */ 9 10 11 #include 12 int main() 13 { 14 int m,n; 15 while(scanf("%d%d... 阅读全文
posted @ 2017-03-16 11:18 BBBob 阅读(199) 评论(0) 推荐(0)
摘要:1 /* 2 HDU2147 kiki's game 3 博弈论 巴什博奕 4 http://acm.hdu.edu.cn/showproblem.php?pid=2147 5 题意:在一个n×m的棋盘上,初始棋子放在右上角, 6 先走到左下角的胜 7 打出胜负表: 8 n:必胜态 9 p:必败态 10 11 n n n n n 12 p ... 阅读全文
posted @ 2017-03-16 10:59 BBBob 阅读(156) 评论(0) 推荐(0)
摘要:1 /* 2 HDU1846 Brave Game http://acm.hdu.edu.cn/showproblem.php?pid=1846 3 博弈论 巴什博奕 4 * 5 * 6 * 7 * 8 */ 9 #include 10 int main() 11 { 12 int t; 13 scanf("%d",&t); 14 int ... 阅读全文
posted @ 2017-03-16 08:13 BBBob 阅读(102) 评论(0) 推荐(0)
摘要:1 /* 2 HDU 5880 Family View 3 http://acm.hdu.edu.cn/showproblem.php?pid=5880 4 AC自动机 5 注意不要直接全把节点初始化,将其当做内存池来用, 6 用的时候再初始化,否则会MLE 7 */ 8 #include 9 #include 10 #include 11 #includ... 阅读全文
posted @ 2017-03-12 10:54 BBBob 阅读(256) 评论(0) 推荐(0)
摘要:/* hdu3037 http://acm.hdu.edu.cn/showproblem.php?pid=3037 lucas 模板题 */ #include #include const long long Nmax=100005; long long p; long long ex_gcd(long long a,long long b,long long &x,long long ... 阅读全文
posted @ 2017-03-08 20:34 BBBob 阅读(141) 评论(0) 推荐(0)