
——Codeforces——
文章平均质量分 84
空白君有着一把空白键blanKey
即使世界如此残酷,我们仍是努力挣扎着
/*算了,退役了,不挣扎了QWQ*/
展开
-
Codeforces Round #402 (Div. 2) D. String Game (二分)
传送门D. String Gametime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputLittle Nastya has a h原创 2017-02-26 19:59:42 · 376 阅读 · 0 评论 -
Codeforces723 C. Polycarp at the Radio (模拟)
题目连接:http://codeforces.com/contest/723/problem/C题目大意:有n个数,要求将值为1到m中出现最小次数的数变成尽可能得多。解题思路:题目意思有点感人……反正就是说1到m的数要至少出现n/m次,所以就把大于m的数压进一个队列里,然后把1到m中的出现次数大于n/m次的压进另一个队列中,然后就xjb搞吧……/* ******原创 2016-10-03 23:12:04 · 280 阅读 · 0 评论 -
Codeforces723 B. Text Document Analysis (模拟/水)
题目连接:http://codeforces.com/contest/723/problem/BB. Text Document Analysistime limit per test1 secondmemory limit per test256 megabytesinputstandard input原创 2016-10-03 23:03:27 · 384 阅读 · 0 评论 -
Codeforces723 A. The New Year: Meeting Friends (水题)
题目连接:http://codeforces.com/contest/723/problem/AA. The New Year: Meeting Friendstime limit per test1 secondmemory limit per test256 megabytesinputstandard i原创 2016-10-03 22:59:35 · 574 阅读 · 0 评论 -
Codeforces722 C. Destroying Array (并查集)
题目连接:http://codeforces.com/contest/722/problem/CC. Destroying Arraytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstand原创 2016-10-02 01:20:23 · 580 阅读 · 0 评论 -
Codeforces722 B. Verse Pattern (水题)
题目连接:http://codeforces.com/contest/722/problem/BB. Verse Patterntime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutput原创 2016-10-02 01:16:57 · 745 阅读 · 0 评论 -
Codeforces722 A. Broken Clock (orz)
题目连接:http://codeforces.com/contest/722/problem/A解题思路:12小时制的1-12,24小时制的0-23。#include #include #include #include #include #include #include #include #include #include #includ原创 2016-10-02 01:14:06 · 675 阅读 · 1 评论 -
Codeforces712 D. Maxim and Array (贪心)
题目连接:http://codeforces.com/contest/721/problem/DD. Maxim and Arraytime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputout原创 2016-10-01 11:55:09 · 433 阅读 · 0 评论 -
Codeforces712 C. Journey (DP / 记忆化搜索)
题目连接:http://codeforces.com/contest/721/problem/C题目大意:给出一个有向无环图,每条边都有时间,求在给定时间内从1走到n最多经过多少个点,输出路径。解题思路:DP。dp[i][j]表示走到第i个点时经过了j个点的花费。因为要输出路径,用pre记录,并且反向建图(递归输出路径,所以要反向)。注意必须用vis记录原创 2016-10-01 11:11:04 · 372 阅读 · 0 评论 -
Codeforces712 B. Passwords (贪心水题)
题目连接:http://codeforces.com/contest/721/problem/BB. Passwordstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputs原创 2016-10-01 11:02:58 · 1028 阅读 · 0 评论 -
Codeforces721 A. One-dimensional Japanese Crossword (水题)
题目连接:http://codeforces.com/contest/721/problem/AA. One-dimensional Japanese Crosswordtime limit per test1 secondmemory limit per test256 megabytesinputstandard input原创 2016-10-01 10:57:18 · 5724 阅读 · 0 评论 -
Codeforces 595 B. Pasha and Phone (容斥)
题目连接:http://codeforces.com/contest/595/problem/BB. Pasha and Phonetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutp原创 2016-09-29 11:22:55 · 415 阅读 · 0 评论 -
CF#678 D. Iterated Linear Function (快速幂+逆元)
题目点我点我点我解题思路:可以根据题目推导出公式:g(n)(x) = (A^n*x + (A^(n-1) + A^(n-2) + A^(n-3) + ...A) * B) % 1000000007前面直接快速幂解决,后面是等比数列求和,注意乘法逆元。/* ***********************************原创 2016-09-08 13:23:50 · 623 阅读 · 0 评论 -
Codeforces723 D. Lakes in Berland (BFS)
题目连接:http://codeforces.com/contest/723/problem/D题目大意:n*m的图里,‘.’为湖,‘*’为陆地,'.'在边界的是与大海相连(即不为湖),上下左右相连的为同一个湖或者同一片海,现在要求只留下k个湖,问要最少填多少个格子。解题思路:把所有的湖找出来,按照湖的大小排序,把小的湖填掉,只留下k个湖。我这里两次bfs做。第原创 2016-10-03 23:20:28 · 758 阅读 · 0 评论 -
Codeforces723 E. One-Way Reform (欧拉路径)
题目连接:http://codeforces.com/contest/723/problem/EE. One-Way Reformtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutp原创 2016-10-07 09:51:05 · 518 阅读 · 0 评论 -
Codeforces Round #402 (Div. 2) C. Dishonest Sellers
传送门题目大意:给出这周有折扣的商品价格以及下周同样商品非折扣商品价格,这周至少要买k个商品,问购买n个商品的最少价钱。解题思路:先把这周比下周都便宜的全都买下,若还不足k个则买差价小的,即贪心。/* ***********************************************┆ ┏┓ ┏┓ ┆┆┏┛┻━━━┛┻┓ ┆┆┃原创 2017-02-26 19:56:04 · 392 阅读 · 0 评论 -
Codeforces Round #402 (Div. 2) B. Weird Rounding
传送门B. Weird Roundingtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputPolycarp is crazy a原创 2017-02-26 19:51:21 · 365 阅读 · 0 评论 -
CF764 C. Timofey and a tree(dfs序+线段树)
传送门题目大意:给一棵树,树上每个节点都有颜色,现在要求将某一个点变成根,使得每个子树上的所有点颜色相同,(根的颜色可不管,根的子树与子树间颜色可不同,但同一个 子树颜色必须相同)问能否找到这样的点,若有则输出这个点。解题思路1:换根,就想到了BZOJ3306,百度了一份代码直接在这上面改。 将每一个点都遍历一遍把它变作根,然后遍历它原创 2017-02-03 09:34:21 · 462 阅读 · 0 评论 -
CF764 B. Timofey and cubes(水题)
传送门B. Timofey and cubestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYoung Timofe原创 2017-02-03 09:24:58 · 457 阅读 · 0 评论 -
CF764 A. Taymyr is calling you(水题)
传送门A. Taymyr is calling youtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputComrade Duji原创 2017-02-03 09:19:28 · 573 阅读 · 0 评论 -
CF761 C. Dasha and Password (DP)
传送门C. Dasha and Passwordtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAfter overcoming the sta原创 2017-02-01 12:06:12 · 780 阅读 · 0 评论 -
CF761 B. Dasha and friends(水题)
传送门B. Dasha and friendstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputRunning with ba原创 2017-02-01 11:55:56 · 596 阅读 · 0 评论 -
CF761 A. Dasha and Stairs (水题)
传送门A. Dasha and Stairstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputOn her way to原创 2017-02-01 11:50:14 · 751 阅读 · 0 评论 -
CF758 C. Unfair Poll (模拟)
传送门C. Unfair Polltime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputOn the Literature less原创 2017-01-20 19:26:40 · 653 阅读 · 0 评论 -
CF758 B. Blown Garland (模拟)
传送门B. Blown Garlandtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputNothing is eternal i原创 2017-01-20 02:34:14 · 782 阅读 · 0 评论 -
CF758 A. Holiday Of Equality (水题)
传送门A. Holiday Of Equalitytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputIn Berland原创 2017-01-20 02:21:21 · 771 阅读 · 0 评论 -
CF437 B. The Child and Set(贪心)
传送门B. The Child and Settime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAt the children'原创 2017-01-12 15:12:01 · 466 阅读 · 0 评论 -
Codeforces 716D D. Complete The Graph
题目连接:http://codeforces.com/contest/716/problem/DD. Complete The Graphtime limit per test4 secondsmemory limit per test256 megabytesinputstandard inputoutputst原创 2016-09-21 09:26:35 · 725 阅读 · 0 评论 -
CF#701 E. Connecting Universities (DFS)
题目点我点我点我E. Connecting Universitiestime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputTreeland is a原创 2016-09-07 11:23:42 · 555 阅读 · 0 评论 -
AIM Tech Round 3 (Div. 2) D. Recover the String (构造)
题目点我点我点我D. Recover the Stringtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputFor each s原创 2016-09-05 12:57:38 · 501 阅读 · 0 评论 -
CF#368 B. Bakery (暴力枚举)
B. Bakerytime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputMasha wants to open her own bakery and bake muffi原创 2016-08-21 11:36:07 · 465 阅读 · 0 评论 -
CF#369(Div2) C. Coloring Trees (DP)
C. Coloring Treestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputZS the Coder and Chris the Baboon has arr原创 2016-08-30 22:38:50 · 414 阅读 · 0 评论 -
CF#712 C. Memory and De-Evolution (数学)
题目点我点我点我C. Memory and De-Evolutiontime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputMemo原创 2016-09-11 09:29:44 · 806 阅读 · 0 评论 -
CF#699 D. Fix a Tree (并查集)
题目点我点我点我D. Fix a Treetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputA tree is an undi原创 2016-09-09 16:01:43 · 395 阅读 · 0 评论 -
CF#333(Div2) C. The Two Routes(最短路)
题目点我点我点我C. The Two Routestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputIn Absurdistan, there a原创 2016-08-16 21:20:24 · 583 阅读 · 0 评论 -
CF#333(Div2)B. Approximating a Constant Range(RMQ)
题目点我点我点我B. Approximating a Constant Rangetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputWhen Xe原创 2016-08-16 20:31:52 · 469 阅读 · 0 评论 -
Codeforces Round #344 (Div. 2) D. Messenger
D. Messengertime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputEach employee of the "Blake Techologies" compa原创 2016-05-09 18:04:56 · 825 阅读 · 0 评论 -
Codeforces Round #344 (Div. 2) C. Report
C. Reporttime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputEach month Blake gets the report containing main原创 2016-05-09 12:33:52 · 800 阅读 · 0 评论 -
Watchmen (Codeforces Round #345 (Div. 2) C)
C. Watchmentime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputWatchmen are in a danger and Doctor Manhattan t原创 2016-03-08 15:32:19 · 557 阅读 · 0 评论 -
Wunder Fund Round 2016 B. Guess the Permutation
B. Guess the Permutationtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputBob has a permutation of integers原创 2016-01-30 13:18:42 · 574 阅读 · 0 评论