摘要: 题目链接:http://acm.nefu.edu.cn/JudgeOnline/problemShow.php?problem_id=117 Time Limit:1000ms Memory Limit:65536K Description 小明是一个聪明的孩子,对数论有着很浓烈的兴趣。他发现求1到 阅读全文
posted @ 2017-09-17 15:41 Dilthey 阅读(350) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://hihocoder.com/problemset/problem/1331 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 我们都知道二进制数的每一位可以是0或1。有一天小H 阅读全文
posted @ 2017-09-17 11:00 Dilthey 阅读(600) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.nefu.edu.cn/JudgeOnline/problemShow.php?problem_id=84 Time Limit:1000ms Memory Limit:65536K Description 西游记中孙吾空大闹天宫,如来佛祖前来降伏他,说道:“我与你打 阅读全文
posted @ 2017-09-17 09:06 Dilthey 阅读(366) 评论(0) 推荐(0) 编辑
摘要: 先上干货: 定理1: 如果d = gcd(a,b),则必能找到正的或负的整数k和l,使ax + by = d. (参考exgcd:http://www.cnblogs.com/dilthey/p/6804137.html) 定理2: 一元线性同余方程ax ≡ n (mod b) 有解,当且仅当gcd 阅读全文
posted @ 2017-09-16 00:14 Dilthey 阅读(319) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://hihocoder.com/problemset/problem/1330 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 小Hi想知道,如果他每次都按照一种固定的顺序重排 阅读全文
posted @ 2017-09-12 21:14 Dilthey 阅读(405) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1525 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Problem Descripti 阅读全文
posted @ 2017-09-12 20:22 Dilthey 阅读(246) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://cn.vjudge.net/problem/UVALive-3938 参考刘汝佳书上说的: 题意: 给出一个长度为n的序列, 再给出m个询问, 每个询问是在序列 $[a,b]$ 之间的最大连续和. 要你计算出这个这个区间内最大连续和的区间 $[x,y](a \le x \l 阅读全文
posted @ 2017-09-07 22:32 Dilthey 阅读(337) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://poj.org/problem?id=2528 Time Limit: 1000MS Memory Limit: 65536K Description The citizens of Bytetown, AB, could not stand that the candida 阅读全文
posted @ 2017-09-06 15:27 Dilthey 阅读(391) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1754 Time Limit: 9000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Problem Descripti 阅读全文
posted @ 2017-09-05 23:20 Dilthey 阅读(232) 评论(0) 推荐(0) 编辑
摘要: 例1.1:HDU2099(2017/9/4) 本题书上给的答案是从0到99枚举,显然可以优化到每次递增b,这样至少可以把枚举次数减少到1/10。 1 #include<cstdio> 2 int a,b; 3 int main() 4 { 5 while(scanf("%d%d",&a,&b) && 阅读全文
posted @ 2017-09-04 22:14 Dilthey 阅读(285) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://cn.vjudge.net/problem/URAL-1277 The Galaxy Police (Galaxpol) found out that a notorious gang of thieves has plans for stealing an extreme 阅读全文
posted @ 2017-08-30 15:17 Dilthey 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3746 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Problem Descripti 阅读全文
posted @ 2017-08-30 12:16 Dilthey 阅读(301) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2087 Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Problem Descripti 阅读全文
posted @ 2017-08-30 09:21 Dilthey 阅读(306) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1711 Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Problem Descript 阅读全文
posted @ 2017-08-28 15:27 Dilthey 阅读(156) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1686 Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Problem Descripti 阅读全文
posted @ 2017-08-28 11:13 Dilthey 阅读(365) 评论(0) 推荐(0) 编辑
摘要: Knuth-Morris-Pratt算法: 转载来自http://www.ruanyifeng.com/blog/2013/05/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm.html的博文(可以说是非常简洁明了清晰易懂了): 分割线 begin 1. 首 阅读全文
posted @ 2017-08-28 09:28 Dilthey 阅读(191) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hit.edu.cn/hoj/problem/view?id=2739 Time limit : 1 sec Memory limit : 64 M A Chinese postman is assigned to a small town in China to d 阅读全文
posted @ 2017-08-25 01:07 Dilthey 阅读(541) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hit.edu.cn/hoj/problem/view?id=2715 Time limit : 5 sec Memory limit : 64 M Zhouguyue is a "驴友" and nowadays he likes traveling on an N 阅读全文
posted @ 2017-08-24 09:38 Dilthey 阅读(216) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://poj.org/problem?id=2195 Time Limit: 1000MS Memory Limit: 65536K Description On a grid map there are n little men and n houses. In each uni 阅读全文
posted @ 2017-08-23 13:21 Dilthey 阅读(310) 评论(0) 推荐(0) 编辑
摘要: 之前在网上搜了一个下午没搜到这道题的题解,然后同时又对着叉姐写的两行字题解看了一个下午; 虽然基本上已经知道了这题的思路,但愣是因为自己代码实现起来太繁复,外加不确定正确性,没敢码…… 但是一道题肝了一下午没肝出来,就要放弃的话,怕是太扎心了,忍不住就跑去ICPCCamp.Post问叉姐了(http 阅读全文
posted @ 2017-08-21 18:44 Dilthey 阅读(509) 评论(0) 推荐(0) 编辑
摘要: 嗯,这是关于最大点权独立集与最小点权覆盖集的姿势,很简单对吧,然后开始看题。 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1569 Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536 阅读全文
posted @ 2017-08-20 21:37 Dilthey 阅读(983) 评论(2) 推荐(0) 编辑
摘要: 首先是当年stoer和wagner两位大佬发表的关于这个算法的论文:A Simple Min-Cut Algorithm 直接上算法部分: 分割线 begin 在这整篇论文中,我们假设一个普通无向图G=(V,E),其中每条边e都有一个正实数权值w(e)。 如果我们知道:怎样找到两个节点s,t,以及怎 阅读全文
posted @ 2017-08-20 14:17 Dilthey 阅读(1640) 评论(0) 推荐(0) 编辑
摘要: 妖怪题目,做到现在:2017/8/19 - 1:41…… 不过想想还是值得的,至少邻接矩阵型的Dinic算法模板get√ 题目链接:http://poj.org/problem?id=1815 Time Limit: 2000MS Memory Limit: 20000K Description I 阅读全文
posted @ 2017-08-19 01:53 Dilthey 阅读(416) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://www.spoj.com/problems/IM/en/ Time limit:491 ms Memory limit:1572864 kB Code length Limit:50000 B Jedi knights, Qui-Gon Jinn and his young 阅读全文
posted @ 2017-08-18 14:55 Dilthey 阅读(233) 评论(0) 推荐(0) 编辑
摘要: 人老了就比较懒,故意挑了到看起来很和蔼的题目做,然后套个spfa和dinic的模板WA了5发,人老了,可能不适合这种刺激的竞技运动了…… 题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=2760 Descriptio 阅读全文
posted @ 2017-08-17 21:03 Dilthey 阅读(292) 评论(0) 推荐(0) 编辑