Codeforces
so_so_y
start to record bugs <- so hard so brave
展开
-
Codeforces Round #395(Div. 2)D. Timofey and rectangles
四色问题的内容是“任何一张地图只用四种颜色就能使具有共同边界的国家着上不同的颜色。”也就是说在不引起混淆的情况下一张地图只需四种颜色来标记就行。 From-百度百科昨天遇到一个有关的问题先贴在这里,以后做到新的问题再做总结 Codeforces Round #395 (Div. 2) D. Timofey and rectangles原创 2017-02-03 22:42:44 · 422 阅读 · 0 评论 -
Codeforces Round #459 (Div. 2) D.MADMAX(记忆化搜索)
DescriptionAs we all know, Max is the best video game player among her friends. Her friends were so jealous of hers, that they created an actual game just to prove that she’s not the best at games. ...原创 2018-02-15 15:00:32 · 210 阅读 · 0 评论 -
Codeforces Round #460(Div. 2) D. Substring(记忆化搜索+判环)
DescriptionYou are given a graph with n nodes and m directed edges. One lowercase letter is assigned to each node. We define a path’s value as the number of the most frequently occurring letter. For...原创 2018-02-15 15:25:57 · 257 阅读 · 0 评论 -
CodeForces - 845D Driving Test(模拟,栈)
DescriptionPolycarp has just attempted to pass the driving test. He ran over the straight road with the signs of four types.speed limit: this sign comes with a positive integer number — maximal sp...原创 2018-02-16 13:44:21 · 371 阅读 · 0 评论 -
codeforces 618 D. Hamiltonian Spanning Tree(dfs)
DescriptionA group of n cities is connected by a network of roads. There is an undirected road between every pair of cities, so there are roads in total. It takes exactly y seconds to traverse any s...原创 2018-02-26 00:53:14 · 302 阅读 · 0 评论 -
CodeForces 714C Sonya and Queries(字典树/思维)
DescriptionToday Sonya learned about long integers and invited all her friends to share the fun. Sonya has an initially empty multiset with integers. Friends give her t queries, each of one of the f...原创 2018-03-19 20:26:24 · 213 阅读 · 0 评论 -
CodeForces 712C Memory and De-Evolution(贪心+数学)
DescriptionMemory is now interested in the de-evolution of objects, specifically triangles. He starts with an equilateral triangle of side length x, and he wishes to perform operations to obtain an ...原创 2018-03-19 20:38:24 · 172 阅读 · 0 评论 -
CodeForces 716C Plus and Square Root(规律)
DescriptionZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ’ + ’ (plus) and ” (square root). Initially, the number 2 is displayed on the screen. ...原创 2018-03-19 20:51:53 · 247 阅读 · 0 评论 -
CodeForces 716D Complete The Graph(spfa)+spfa标记最短路径 + 负环判断
DescriptionZS the Coder has drawn an undirected graph of n vertices numbered from 0 to n - 1 and m edges between them. Each edge of the graph is weighted, each weight is a positive integer.The nex...原创 2018-03-21 18:43:03 · 227 阅读 · 0 评论 -
Codeforces 954D Fight Against Traffic(最短路)
DescriptionLittle town Nsk consists of n junctions connected by m bidirectional roads. Each road connects two distinct junctions and no two roads connect the same pair of junctions. It is possible t...原创 2018-03-26 19:31:30 · 395 阅读 · 0 评论 -
CodeForces 602B Approximating a Constant Range(思维)
DescriptionWhen Xellos was doing a practice course in university, he once had to measure the intensity of an effect that slowly approached equilibrium. A good way to determine the equilibrium intens...原创 2018-03-26 19:45:05 · 201 阅读 · 0 评论 -
CodeForces 959 E Mahmoud and Ehab and the xor-MST(异或 思维)
DescriptionEhab is interested in the bitwise-xor operation and the special graphs. Mahmoud gave him a problem that combines both. He has a complete graph consisting of n vertices numbered from 0 to ...原创 2018-04-11 21:55:54 · 219 阅读 · 0 评论 -
Codeforces 964 C. Alternating Sum (求和+逆元)
DescriptionYou are given two integers a and b. Moreover, you are given a sequence s0,s1,…,sn. All values in s are integers 1 or −1. It’s known that sequence is k-periodic and k divides n+1. In other...原创 2018-04-18 12:57:52 · 353 阅读 · 0 评论 -
Codeforces 958 C2. Encryption (medium)(dp)
DescriptionHeidi has now broken the first level of encryption of the Death Star plans, and is staring at the screen presenting her with the description of the next code she has to enter. It looks su...原创 2018-04-22 21:33:16 · 526 阅读 · 0 评论 -
Codeforces 967 C. Stairs and Elevators(二分)
DescriptionIn the year of 30 X participants of some world programming championship live in a single large hotel. The hotel has n floors. Each floor has m sections with a single corridor connecti...原创 2018-04-30 17:21:05 · 432 阅读 · 0 评论 -
Codeforces Collatz Conjecture(思维)
DescriptionIn 1978 AD the great Sir Isaac Newton, whilst proving that P is a strict superset of N P, defined the Beta Alpha Pi Zeta function f as follows over any sequence of positive integers a1, …...原创 2018-05-02 18:42:50 · 735 阅读 · 0 评论 -
codeforces 621 D. Rat Kwesh and Cheese(log处理)
DescriptionWet Shark asked Rat Kwesh to generate three positive real numbers x, y and z, from 0.1 to 200.0, inclusive. Wet Krash wants to impress Wet Shark, so all generated numbers will have exactl...原创 2018-02-27 17:44:03 · 275 阅读 · 0 评论 -
codeforces 621 E. Wet Shark and Blocks(dp+矩阵快速幂)
DescriptionThere are b blocks of digits. Each one consisting of the same n digits, which are given to you in the input. Wet Shark must choose exactly one digit from each block and concatenate all of...原创 2018-02-27 17:19:30 · 323 阅读 · 0 评论 -
Bubble Cup X - Finals [Online Mirror] G. Bathroom terminal(STL)
DescriptionSmith wakes up at the side of a dirty, disused bathroom, his ankle chained to pipes. Next to him is tape-player with a hand-written message “Play Me”. He finds a tape in his own back pocket.原创 2017-09-04 21:10:52 · 370 阅读 · 0 评论 -
Codeforces Round #436 (Div. 2) C. Bus
DescriptionA bus moves along the coordinate line Ox from the point x = 0 to the point x = a. After starting from the point x = 0, it reaches the point x = a, immediately turns back and then moves to th原创 2017-10-02 21:17:32 · 488 阅读 · 0 评论 -
Codeforces Round #436 (Div. 2) E. Fire
DescriptionPolycarp is in really serious trouble — his house is on fire! It’s time to save the most valuable items. Polycarp estimated that it would take ti seconds to save i-th item. In addition, for原创 2017-10-02 21:57:59 · 538 阅读 · 0 评论 -
Codeforces Round #437 Div. 2 C. Ordering Pizza
DescriptionIt’s another Start[c]up finals, and that means there is pizza to order for the onsite contestants. There are only 2 types of pizza (obviously not, but let’s just pretend for the sake of the原创 2017-10-02 22:15:26 · 641 阅读 · 0 评论 -
Codeforces Round #436 (Div. 2) D. Make a Permutation!
DescriptionIvan has an array consisting of n elements. Each of the elements is an integer from 1 to n.Recently Ivan learned about permutations and their lexicographical order. Now he wants to change (r原创 2017-10-02 21:30:53 · 184 阅读 · 0 评论 -
Codeforces Round #437 Div. 2 E. Buy Low Sell High
DescriptionYou can perfectly predict the price of a certain stock for the next N days. You would like to profit on this knowledge, but only want to transact one share of stock per day. That is, each da原创 2017-10-02 22:19:10 · 339 阅读 · 0 评论 -
Codeforces Round #438 C. Qualification Rounds
DescriptionSnark and Philip are preparing the problemset for the upcoming pre-qualification round for semi-quarter-finals. They have a bank of n problems, and they want to select any non-empty subset o原创 2017-10-05 20:21:02 · 328 阅读 · 0 评论 -
Codeforces Round #447 (Div. 2) B. Ralph And His Magic Field(思维)
DescriptionRalph has a magic field which is divided into n × m blocks. That is to say, there are n rows and m columns on the field. Ralph can put an integer in each block. However, the magic field does原创 2017-11-20 18:29:39 · 340 阅读 · 0 评论 -
Codeforces Good Bye 2016 C. New Year and Rating(模拟)
DescriptionEvery Codeforces user has rating, described with one integer, possibly negative or zero. Users are divided into two divisions. The first division is for users with rating 1900 or higher. Tho原创 2017-11-21 22:25:52 · 329 阅读 · 0 评论 -
Codeforces Round #449 div2 C(递归求解)
DescriptionWhat are you doing at the end of the world? Are you busy? Will you save us? Nephren is playing a game with little leprechauns.She gives them an infinite array of strings, f0… ∞.f0 is “What原创 2017-12-03 21:46:36 · 280 阅读 · 0 评论 -
Codeforces Good Bye 2016 D. New Year and Fireworks(bfs/dfs)
DescriptionOne tradition of welcoming the New Year is launching fireworks into the sky. Usually a launched firework flies vertically upward for some period of time, then explodes, splitting into severa原创 2017-11-24 14:49:48 · 233 阅读 · 0 评论 -
Codeforces Round #449 (Div. 2) D(思维)
DescriptionThis is an interactive problem. Refer to the Interaction section below for better understanding.Ithea and Chtholly want to play a game in order to determine who can use the kitchen tonight.I原创 2017-12-04 18:14:20 · 229 阅读 · 0 评论 -
Codeforces Hello 2018 B.Christmas Spruce
DescriptionConsider a rooted tree. A rooted tree has one special vertex called the root. All edges are directed from the root. Vertex u is called a child of vertex v and vertex v is called a parent原创 2018-01-11 22:04:31 · 347 阅读 · 0 评论 -
Codeforces Hello 2018 C. Party Lemonade(思维)
DescriptionA New Year party is not a New Year party without lemonade! As usual, you are expecting a lot of guests, and buying lemonade has already become a pleasant necessity.Your favorite store s原创 2018-01-11 22:21:39 · 312 阅读 · 0 评论 -
codeforces 915C Permute Digits
DescriptionYou are given two positive integer numbers a and b. Permute (change order) of the digits of a to construct maximal number not exceeding b. No number in input and/or output can start with原创 2018-01-26 14:29:34 · 348 阅读 · 0 评论 -
Codeforces Detour(Dijkstra +爆搜)
DescriptionAfter last year’s edition of the BAPC, you are still stuck in Delft. In order to participate again this year, you are going to Amsterdam by bus. During the journey you look out of the win...原创 2018-05-02 21:26:16 · 473 阅读 · 0 评论