上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 26 下一页
摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=4423 【题解】 转对偶图,格子当成点,就相当于并查集裸题了。。 # include <stdio.h> # include <string.h> # include <iostream> # 阅读全文
posted @ 2017-05-30 18:03 Galaxies 阅读(186) 评论(0) 推荐(0) 编辑
摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=3643 【题解】 n = p1^a1*p2^a2*...*pm^am phi(n) = p1(p1-1)^(a1-1)*p2(p2-1)^(a2-1)*...*pm^(am-1) 最多有10个不 阅读全文
posted @ 2017-05-30 17:16 Galaxies 阅读(277) 评论(0) 推荐(0) 编辑
摘要: 传送门:http://acm.hdu.edu.cn/showproblem.php?pid=1024 http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1053 【题解】 原来的解法:http://www.cnblogs.co 阅读全文
posted @ 2017-05-30 15:09 Galaxies 阅读(260) 评论(0) 推荐(0) 编辑
摘要: 传送门:http://acm.hdu.edu.cn/showproblem.php?pid=1024 http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1053 【题解】 本题也是51nod 1053 最大m子段和 和上题很像 阅读全文
posted @ 2017-05-30 11:49 Galaxies 阅读(274) 评论(0) 推荐(0) 编辑
摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=3638 【题解】 看到k<=20就感觉很py了啊 我们用一棵线段树维护选段的过程,能选到>0的段就一直选,直到选到<0的段,每次选完把段内的数全部取相反数,意为下次取是“不取”的意思。 用线段树 阅读全文
posted @ 2017-05-30 10:18 Galaxies 阅读(386) 评论(0) 推荐(0) 编辑
摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=3620 【题解】 这个n<=15000给人一个O(n^2)能过的感觉(事实就是这样) 我们先学一发kmp吧(这博客还没有kmp教程药丸) 这个kmp非常excited的地方是什么呢? 有一个ne 阅读全文
posted @ 2017-05-29 22:25 Galaxies 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=3667 【题解】 PollardRho,讲解见http://www.cnblogs.com/galaxies/p/bzoj4802.html # include <stdio.h> # incl 阅读全文
posted @ 2017-05-29 19:32 Galaxies 阅读(409) 评论(0) 推荐(0) 编辑
摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=3680 【题解】 模拟退火 getdis瞎推推,猜猜就猜出来了吧。。 前面没看n的范围设N=20, T=20作死 改成T=5,N=8就10s刚好过了 # include <math.h> # i 阅读全文
posted @ 2017-05-29 18:57 Galaxies 阅读(178) 评论(0) 推荐(0) 编辑
摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=2055 【题解】 跟上一题(支线剧情)很像,与上题不同是这题看作求“最大流”(我们限制过流量了),上一题是求“可行流”无源汇的做法。 我们考虑先建出带有上下界的网络流: S1->S2 [m,m] 阅读全文
posted @ 2017-05-29 17:32 Galaxies 阅读(282) 评论(0) 推荐(0) 编辑
摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=3876 【题解】 一眼看过去好像就是一个网络流啊 那怎么建图呢 首先图上的边看作下界为1,上界inf的边,费用为给定的费用。 每个点都可以回到起点(1)开始下一次的观看,所以每个点到1连下界为0 阅读全文
posted @ 2017-05-29 17:06 Galaxies 阅读(225) 评论(0) 推荐(0) 编辑
上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 26 下一页