05 2017 档案

摘要:地址:http://codeforces.com/contest/811/problem/D 题目: D. Vladik and Favorite Game time limit per test 2 seconds memory limit per test 256 megabytes input 阅读全文
posted @ 2017-05-31 15:09 weeping 阅读(245) 评论(0) 推荐(0)
摘要:地址:http://codeforces.com/contest/811/problem/C 题目: C. Vladik and Memorable Trip time limit per test 2 seconds memory limit per test 256 megabytes inpu 阅读全文
posted @ 2017-05-31 15:05 weeping 阅读(346) 评论(0) 推荐(0)
摘要:地址:http://codeforces.com/contest/811/problem/B 题目: B. Vladik and Complicated Book time limit per test 2 seconds memory limit per test 256 megabytes in 阅读全文
posted @ 2017-05-31 14:57 weeping 阅读(204) 评论(0) 推荐(0)
摘要:地址:http://acm.hdu.edu.cn/showproblem.php?pid=4417 题目: Super Mario Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Tota 阅读全文
posted @ 2017-05-31 14:45 weeping 阅读(186) 评论(0) 推荐(0)
摘要:地址:http://acm.hdu.edu.cn/showproblem.php?pid=4348 题目: To the moon Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Tota 阅读全文
posted @ 2017-05-31 14:41 weeping 阅读(193) 评论(0) 推荐(0)
摘要:地址:http://www.spoj.com/problems/COT/en/ 题目: COT - Count on a tree #tree #tree You are given a tree with N nodes.The tree nodes are numbered from 1 to  阅读全文
posted @ 2017-05-31 14:30 weeping 阅读(234) 评论(0) 推荐(0)
摘要:1 #include 2 3 using namespace std; 4 5 #define MP make_pair 6 #define PB push_back 7 typedef long long LL; 8 typedef pair PII; 9 const double eps=1e-8; 10 const double pi=acos(-1.0); 11 ... 阅读全文
posted @ 2017-05-25 23:56 weeping 阅读(168) 评论(0) 推荐(0)
摘要:地址:http://acm.hdu.edu.cn/showproblem.php?pid=4812 题目: D Tree Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 102400/102400 K (Java/Others)Total 阅读全文
posted @ 2017-05-25 19:01 weeping 阅读(186) 评论(0) 推荐(0)
摘要:1 #include 2 #include 3 #include 4 #include 5 #pragma comment(linker,"/STACK:102400000,102400000") 6 using namespace std; 7 8 #define MP make_pair 9 #define PB push_back 10 typedef long... 阅读全文
posted @ 2017-05-18 19:55 weeping 阅读(149) 评论(0) 推荐(0)
摘要:地址:http://acm.uestc.edu.cn/#/problem/show/1588 题目:复制过来发现有问题,自己去cdoj看吧 思路: 1.先进行多次spfa跑出所有人之间的相互到达所需要的步数。 2.知道所有人之间的距离关系后,就是个从初始点出发泡q个妹子所需要的最少花费问题。 这时你 阅读全文
posted @ 2017-05-17 22:34 weeping 阅读(245) 评论(0) 推荐(0)
摘要:地址:http://acm.uestc.edu.cn/#/problem/show/1587 题目: 失恋772002天 失恋772002天 Time Limit: 3000/1000MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others) 阅读全文
posted @ 2017-05-17 22:23 weeping 阅读(192) 评论(0) 推荐(0)
摘要:地址:http://acm.uestc.edu.cn/#/problem/show/1580 题目: 简单图论问题 简单图论问题 Time Limit: 3000/1000MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others) Submi 阅读全文
posted @ 2017-05-17 22:19 weeping 阅读(186) 评论(0) 推荐(0)
摘要:地址:http://acm.split.hdu.edu.cn/showproblem.php?pid=3966 题目: Aragorn's Story Time Limit: 10000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/ 阅读全文
posted @ 2017-05-17 22:12 weeping 阅读(200) 评论(0) 推荐(0)
摘要:地址:http://codeforces.com/problemset/problem/165/D 题目: D. Beard Graph time limit per test 4 seconds memory limit per test 256 megabytes input standard 阅读全文
posted @ 2017-05-17 22:05 weeping 阅读(202) 评论(0) 推荐(0)
摘要:树链剖分的实质:将一棵树划分成若干条链,用数据结构去维护每条链。 如:把边或点哈希到线段树(或其他数据结构)上进行维护和查询。 这样做的理由:从根到某一点的路径上,不超过logn条轻边和不超过logn条重路径。 下面开始介绍树链剖分的做法: size(u)为以u为根的子树节点个数(包括u),令v为u 阅读全文
posted @ 2017-05-17 20:38 weeping 阅读(274) 评论(0) 推荐(0)
摘要:伪素数: 如果存在和n互素的正整数a满足a^(n-1)≡1(mod n),则n是基于a的伪素数。 是伪素数但不是素数的个数是非常非常少的,所以如果一个数是伪素数,那么他几乎是素数。 Miller_Rabbin素数测试:随机选k个a进行a^(n-1)≡1(mod n)测试,如果都满足则判断n是素数。 阅读全文
posted @ 2017-05-16 12:45 weeping 阅读(301) 评论(0) 推荐(0)
摘要:lca倍增模板: 阅读全文
posted @ 2017-05-15 17:22 weeping 阅读(234) 评论(0) 推荐(0)
摘要:update-2018.07.23: 原文问题五思路描述有误,已更正。 参考自:《数据结构漫谈》-许昊然 dfs序是树在dfs先序遍历时的序列,将树形结构转化成序列问题处理。 dfs有一个很好的性质:一棵子树所在的位置处于一个连续区间中。 ps:deep[x]为x的深度,l[x]为dfs序中x的位置 阅读全文
posted @ 2017-05-12 20:21 weeping 阅读(4691) 评论(6) 推荐(4)
摘要:单点更新,区间查询 区间增减,单点查询 区间增减,区间查询 二维树状数组:单点修改,区间查询 二维树状数组:区间修改,单点查询 阅读全文
posted @ 2017-05-11 01:44 weeping 阅读(282) 评论(0) 推荐(0)
摘要:地址:http://codeforces.com/contest/807/problem/D 题目: D. Dynamic Problem Scoring time limit per test 2 seconds memory limit per test 256 megabytes input 阅读全文
posted @ 2017-05-08 13:53 weeping 阅读(268) 评论(0) 推荐(0)
摘要:地址:http://codeforces.com/contest/807/problem/C 题目: C. Success Rate time limit per test 2 seconds memory limit per test 256 megabytes input standard in 阅读全文
posted @ 2017-05-08 13:37 weeping 阅读(397) 评论(0) 推荐(0)