Codeforces
文章平均质量分 77
「已注销」
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Codeforces 509E(思维)
E. Pretty Song time limit per test:1 second原创 2017-01-18 23:49:34 · 360 阅读 · 0 评论 -
Codeforces 746G(构造)
G. New Roads time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output There are n cities in Berland, each of them has a unique原创 2017-01-11 14:26:11 · 719 阅读 · 0 评论 -
Codeforces 754A(搜索)
设s[i][j]为序列i到j的和,当s[i][j]≠0时,即可从i跳到j+1.目标为从1跳到n+1,所以按照题意暴力即可。 #include using namespace std; #define rep(i,a,b) for(int i(a); i <= (b); ++i) #define dec(i,a,b) for(int原创 2017-01-11 14:22:59 · 318 阅读 · 0 评论 -
Codeforces 739B(树上路径倍增及差分)
比较考验我思维的一道好题。 首先,做一遍DFS预处理出t[i][j]和d[i][j]。t[i][j]表示从第i个节点到离他第2^j近的祖先,d[i][j]表示从i开始到t[i][j]的路径上的路径权值总和。 在第一次DFS的同时,对节点x进行定位(结果为dist(x, y) 第一次DFS完成后,做第二次DFS统计答案(统计差分后的结果)。时间复杂度为O(NlgN)原创 2016-12-15 20:26:07 · 1024 阅读 · 0 评论
分享