
cf
文章平均质量分 80
WedyZhou
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
codeforces 614B
B. Gena's Codetime limit per test0.5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputIt's the year 4527 and the tanks game that we all kn原创 2016-01-19 19:28:03 · 472 阅读 · 0 评论 -
Educational Codeforces Round 12 A. Buses Between Cities
A. Buses Between Citiestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputBuses run between the cities A and B原创 2016-04-25 20:06:59 · 525 阅读 · 0 评论 -
Codeforces Round #347 (Div. 2) B Rebus (贪心构造)
B. Rebustime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a rebus of form ? + ? - ? + ? = n, consisting o原创 2016-04-17 20:55:34 · 1144 阅读 · 3 评论 -
uva 11400 Lighting System Design
题目链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2395题目解法:由于灯具只能由电压低的转向电压高的,则可以得知这个转换是有序的。友nAC:#include #include #include #include #incl原创 2016-04-17 17:06:15 · 398 阅读 · 0 评论 -
Codeforces Round #347 (Div. 2) A. Complicated GCD
题目链接:http://codeforces.com/contest/664/problem/A题意:输入两个整数a,b,求a,a+1,a+2,........b的最大公约数。a,b不超过100位数解法: 当a==b时,公约数是他本身。当a!= b时,公约数为1。总结:对于英文题,看清题目在做,,,,有时候读懂了题就变简单了AC:#include #include #i原创 2016-04-17 11:34:59 · 460 阅读 · 0 评论 -
coderforce Educational Codeforces Round 10 C. Foe Pairs(贪心)
C. Foe Pairstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a permutation p of lengthn. Also you are原创 2016-03-26 14:57:47 · 508 阅读 · 0 评论 -
codeforce 621 B. Wet Shark and Bishops
B. Wet Shark and Bishopstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputToday, Wet Shark is given n bishops on a10原创 2016-03-23 17:25:20 · 402 阅读 · 0 评论 -
612 C. Wet Shark and Flowers
C. Wet Shark and Flowerstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are n sharks who grow flowers for Wet原创 2016-03-23 14:54:49 · 396 阅读 · 0 评论 -
B. Longtail Hedgehog
B. Longtail Hedgehogtime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThis Christmas Santa gave Masha a magic picture原创 2016-01-22 21:30:15 · 604 阅读 · 0 评论 -
G. Heavy Coins(二进制枚举)
G. Heavy CoinsBahosain has a lot of coins in his pocket. These coins are really heavy, so he always tries to get rid of some ofthe coins by using them when paying for the taxi.Whenever Bahosain原创 2016-04-29 16:09:52 · 668 阅读 · 0 评论 -
Codeforces Round #350 (Div. 2) C Cinema
C. Cinematime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputMoscow is hosting a major international conferenc原创 2016-05-06 15:20:30 · 742 阅读 · 0 评论 -
Codeforces Round #350 (Div. 2) D1,D2Magic Powder(二分)
D2. Magic Powder - 2time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe term of this problem is the same as原创 2016-05-06 20:23:43 · 629 阅读 · 0 评论 -
Codeforces Round #340 (Div. 2) C
C. Watering Flowerstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputA flowerbed has many flowers and two fountains.原创 2016-01-24 13:55:26 · 316 阅读 · 0 评论 -
CodeForces 622B
B. The Timetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given the current time in 24-hour formathh:mm. F原创 2016-03-16 18:42:49 · 295 阅读 · 0 评论 -
Educational Codeforces Round 12 D. Simple Subset
D. Simple Subsettime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputA tuple of positive integers {x1, x2, ...,原创 2016-04-25 20:29:34 · 466 阅读 · 0 评论 -
Codeforces Round #351 (VK Cup 2016 Round 3, Div. 2 Edition) D. Bear and Two Paths
D. Bear and Two Pathstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputBearland has n cities, numbered 1 thr原创 2016-05-09 15:39:56 · 512 阅读 · 0 评论 -
Codeforces Round #362 (Div. 2) C.Lorenzo Von Matterhorn
题目链接:http://codeforces.com/contest/697/problem/C题意:有1~n的n个点,对于第i个点它的2*i与2*i+1有一条无向的边。现在有两种操最,第一种是将从u到v的最短路径上所有边的 权值加上w。第二种是询问u到v最短路劲上的花费是多少。解法:我们可以将从1开始将所有的边画出来,不难发现这就是一棵二叉树。他们的最短路径即为他们到公共父亲的距离。然后原创 2016-07-16 20:25:44 · 309 阅读 · 0 评论 -
Codeforces Round #361 (Div. 2) D Friends and Subsequences
题目链接:http://codeforces.com/contest/689/problem/D题意:给定两个长度相同的数组,a和b。问你在相同的区间中amax=bmin的区间有多少个,数组的范围为200000.解法:我们可以枚举起始点,然后用二分查到amax和bmin相等的左右端点,然后进行区间累加就可以了。对于最大值最小值的查询我们可以采用线段树和RMQ来优化。线段树的查询复杂度是lo原创 2016-07-13 19:33:33 · 357 阅读 · 0 评论 -
Codeforces Round #361 (Div. 2) C. Mike and Chocolate Thieves 二分
题目链接:http://codeforces.com/problemset/problem/689/C题意:有4个小偷去偷Mike家的巧克力,小偷的包最多装n个。四个小偷一个比一个贪心,他们偷的是前一个的k倍(k不知道)。现在已经知道小偷可能出现的情况次数为m(1e15)。问你求出小偷包的最小容量。解法:设第一个小偷偷了a,则很容易这道小偷包的容量为所有情况中a*k*k*k的最大值。枚举k原创 2016-07-12 21:13:15 · 320 阅读 · 0 评论 -
关于优先队列(681C - Heap Operations)
关于优先队列,他的实质是一个堆。在头文件中。它默认的排序方式由小到大排,即大的先出对。对于这种数据容器,在c++中我们只需先定义一个 类,然后重载小于号即可。实现如下:struct num{ int x; bool operator return x>a.x;//最小值优先 }};int main(){原创 2016-06-23 13:26:16 · 509 阅读 · 0 评论 -
字典树(Codeforces Round #367 (Div. 2) Vasiliy's Multiset,Xor问题 )
1.题目链接:http://www.codeforces.com/problemset/problem/706/DD. Vasiliy's Multisettime limit per test4 secondsmemory limit per test256 megabytesinputstandard inputoutputs原创 2016-08-13 19:18:41 · 502 阅读 · 0 评论