Codeforces
文章平均质量分 83
闻道-问道
这个作者很懒,什么都没留下…
展开
-
A. Fair Game
Petya and Vasya decided to play a game. They have n cards (n is an even number). A single integer is written on each card.Before the game Petya will choose an integer and after that Vasya will c原创 2017-09-26 15:54:05 · 1003 阅读 · 0 评论 -
C. A Mist of Florescence(构造)
C. A Mist of Florescencetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAs the boat drifts down the river, a wood full of blossoms shows up on the ...原创 2018-06-12 10:31:43 · 770 阅读 · 0 评论 -
周中练习1 C
A friend of yours has written a program that compares every pair of a list of items. With n items,it works as follows. First, it prints a 1, and it compares item 1 to items 2, 3, 4, . . . , n. It then...原创 2018-05-24 20:05:58 · 277 阅读 · 0 评论 -
C. Liebig's Barrels (贪心)
C. Liebig's Barrelstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou have m = n·k wooden staves. The i-th stave has length ai. You have to assem...原创 2018-05-24 20:16:16 · 433 阅读 · 0 评论 -
D. Bookshelves(贪心+dp)
D. Bookshelvestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputMr Keks is a typical white-collar in Byteland.He has a bookshelf in his office with s...原创 2018-05-30 20:58:16 · 401 阅读 · 0 评论 -
C. Three displays(简单dp)
C. Three displaystime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputIt is the middle of 2018 and Maria Stepanovna, who lives outside Krasnokamensk (a ...原创 2018-05-30 21:05:39 · 495 阅读 · 0 评论 -
D. Fair(多源bfs)
D. Fairtime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputSome company is going to hold a fair in Byteland. There are nn towns in Byteland and mm two...原创 2018-05-30 21:17:54 · 921 阅读 · 3 评论 -
Codeforces Round #499 (Div. 2)
1模拟2暴力3倒着模拟4交互题。D. RocketThis is an interactive problem.Natasha is going to fly to Mars. Finally, Natasha sat in the rocket. She flies, flies... but gets bored. She wishes to arriv...原创 2018-07-27 11:31:24 · 274 阅读 · 0 评论 -
D. The Wu(状压)
Childan is making up a legendary story and trying to sell his forgery — a necklace with a strong sense of "Wu" to the Kasouras. But Mr. Kasoura is challenging the truth of Childan's story. So he is go...原创 2018-08-10 11:47:24 · 299 阅读 · 0 评论 -
D. Array Restoration(树状数组+分类)
Initially there was an array aa consisting of nn integers. Positions in it are numbered from 11 to nn.Exactly qq queries were performed on the array. During the ii-th query some segment (li,ri)(li,r...原创 2018-08-18 09:29:56 · 279 阅读 · 0 评论 -
B. Weakened Common Divisor(筛质因子)
During the research on properties of the greatest common divisor (GCD) of a set of numbers, Ildar, a famous mathematician, introduced a brand new concept of the weakened common divisor (WCD) of a list...原创 2018-08-20 11:06:28 · 346 阅读 · 0 评论 -
D. Recovering BST(dp+记忆化搜索)
Dima the hamster enjoys nibbling different things: cages, sticks, bad problemsetters and even trees!Recently he found a binary search tree and instinctively nibbled all of its edges, hence messing u...原创 2018-08-20 11:01:50 · 381 阅读 · 0 评论 -
E. Pencils and Boxes(树状数组+dp)
E. Pencils and Boxestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputMishka received a gift of multicolored pencils for his birthday! Unfortunately...原创 2018-05-28 21:55:18 · 367 阅读 · 0 评论 -
D. XOR-pyramid(区间dp)
D. XOR-pyramidtime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputFor an array bb of length mm we define the function ff asf(b)={b[1]if m=1f(b[1]⊕b[2]...原创 2018-05-21 21:08:24 · 282 阅读 · 0 评论 -
B. Polycarp and Letters
Polycarp loves lowercase letters and dislikes uppercase ones. Once he got a string s consisting only of lowercase and uppercase Latin letters.Let A be a set of positions in the string. Let's cal原创 2017-09-26 16:00:18 · 900 阅读 · 0 评论 -
Codeforces Round #435 A. Mahmoud and Ehab and the MEX
Dr. Evil kidnapped Mahmoud and Ehab in the evil land because of their performance in the Evil Olympiad in Informatics (EOI). He decided to give them some problems to let them go.Dr. Evil is intere原创 2017-09-20 00:37:13 · 342 阅读 · 0 评论 -
Codeforces Round #435 (Div. 2)B. Mahmoud and Ehab and the bipartiteness(补)
Mahmoud and Ehab continue their adventures! As everybody in the evil land knows, Dr. Evil likes bipartite graphs, especially trees.A tree is a connected acyclic graph. A bipartite graph is a graph原创 2017-09-21 20:13:30 · 247 阅读 · 0 评论 -
Educational Codeforces Round 35 (Rated for Div. 2) A B C D
A. Nearest Minimumstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an array of n integer numbersa0,原创 2017-12-29 12:40:28 · 447 阅读 · 0 评论 -
Codeforces Round #456 (Div. 2) A B
A. Tricky Alchemytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputDuring the winter holidays, the demand for Christmas原创 2018-01-07 21:11:50 · 273 阅读 · 0 评论 -
cf 87
A - Trains Vasya the programmer lives in the middle of the Programming subway branch. He has two girlfriends: Dasha and Masha, who live at the different ends of the branch, each one is unaware o原创 2018-05-10 00:18:33 · 291 阅读 · 0 评论 -
CodeForces - 89A
It is nighttime and Joe the Elusive got into the country's main bank's safe. The safe has n cells positioned in a row, each of them contains some amount of diamonds. Let's make the problem more comfor...原创 2018-05-19 18:22:42 · 278 阅读 · 0 评论 -
周末练习1( 2017 JUST Programming Contest 4.0)
A题目大概:给出n个数,求所有的连续区间(包含区间长度为1的区间)的数字相与之和。如7 11 9(7) + (7 & 11) + (7 & 11 & 9) + (11) + (11 & 9) + (9) = 40思路:这种区间的题正常来说都需要推规律,还是与数学有关。这道题的区间长度为1e5,暴力是不行的。如果做过类似的题目。就会把这些数转换成二进制的形式,题...原创 2018-05-13 19:51:36 · 445 阅读 · 0 评论 -
周末练习2(2018 JUST Programming Contest 1.0)
G题目大概:给出长度为n的字符串,q此操作,然后id,字符q,把id位置的字符替换为q,看是否是回文串。最后问q此操作有几次操作之后是回文串。思路:根据数据,暴力显然是不行的,长度和操作数都是1e5.可以先把给出的字符串按照对称位置,计算有多少个对称位置不同记为sum。然后,每次修改的时候,比较和对称位置的变化情况,然后维护sum值,当sum为0的时候就是回文串。代码:#include <i...原创 2018-05-13 20:17:28 · 295 阅读 · 0 评论 -
Codeforces Round #482 (Div. 2)
A. Pizza, Pizza, Pizza!!!time limit per test1 secondmemory limit per test128 megabytesinputstandard inputoutputstandard outputKatie, Kuro and Shiro are best friends. They have known each other since k...原创 2018-05-21 12:48:05 · 363 阅读 · 0 评论 -
C. Finite or not?(gcd 数论)
C. Finite or not?time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given several queries. Each query consists of three integers pp, qq and bb...原创 2018-05-21 20:58:44 · 279 阅读 · 0 评论 -
C. Elections(枚举+贪心)
As you know, majority of students and teachers of Summer Informatics School live in Berland for the most part of the year. Since corruption there is quite widespread, the following story is not uncomm...原创 2018-08-20 20:08:29 · 968 阅读 · 0 评论