Codeforces
箱@子
这个作者很懒,什么都没留下…
展开
-
Codeforces Round #652 (Div. 2) D. TediousLee
D. TediousLeetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLee tried so hard to make a good div.2 D problem to balance his recent contest, but it still doesn't feel good at all. Lee原创 2020-07-11 18:32:31 · 134 阅读 · 0 评论 -
CodeForces - 1325C Ehab and Path-etic MEXs
You are given a tree consisting ofnnnodes. You want to write some labels on the tree's edges such that the following conditions hold:Every label is an integer between00andn−2n−2inclusive. All...原创 2020-03-17 15:33:40 · 223 阅读 · 2 评论 -
CodeForces - 1312E Array Shrinking 区间dp
You are given an arraya1,a2,…,ana1,a2,…,an. You can perform the following operation any number of times:Choose a pair of two neighboring equal elementsai=ai+1ai=ai+1(if there is at least one such...原创 2020-03-15 12:09:47 · 179 阅读 · 0 评论 -
CodeForces - 1323C C - Unusual Competitions
A bracketed sequence is called correct (regular) if by inserting "+" and "1" you can get a well-formed mathematical expression from it. For example, sequences "(())()", "()" and "(()(()))" are correct...原创 2020-03-09 21:10:54 · 126 阅读 · 0 评论 -
CodeForces - 1321D D - Navigation System (最短路问题)
The map of Bertown can be represented as a set ofnnintersections, numbered from11tonnand connected bymmone-way roads. It is possible to move along the roads from any intersection to any other ...原创 2020-03-04 11:55:56 · 268 阅读 · 0 评论 -
CodeForces - 1305B B - Kuroni and Simple Strings
Now that Kuroni has reached 10 years old, he is a big boy and doesn't like arrays of integers as presents anymore. This year he wants a Bracket sequence as a Birthday present. More specifically, he wa...原创 2020-03-04 11:54:05 · 199 阅读 · 0 评论 -
CodeForces - 1315B Homecoming
After a long party Petya decided to return home, but he turned out to be at the opposite end of the town from his home. There arenncrossroads in the line in the town, and there is either the bus or ...原创 2020-02-24 21:00:55 · 604 阅读 · 0 评论 -
CodeForces - 1307C C - Cow and Message
Bessie the cow has just intercepted a text that Farmer John sent to Burger Queen! However, Bessie is sure that there is a secret message hidden inside.The text is a stringssof lowercase Latin lett...原创 2020-02-18 21:03:24 · 288 阅读 · 0 评论 -
CodeForces - 1307B B - Cow and Friend
Bessie has way too many friends because she is everyone's favorite cow! Her new friend Rabbit is trying to hop over so they can play!More specifically, he wants to get from(0,0)(0,0)to(x,0)(x,0)...原创 2020-02-18 21:02:06 · 300 阅读 · 0 评论 -
CodeForces - 1307A A - Cow and Haybales
The USA Construction Operation (USACO) recently ordered Farmer John to arrangea rowofnnhaybale piles on the farm. Theii-th pile containsaiaihaybales.However, Farmer John has just left for vac...原创 2020-02-18 20:59:33 · 475 阅读 · 0 评论 -
CodeForces - 1304E H - 1-Trees and Queries (LCA)
Gildong was hiking a mountain, walking by millions of trees. Inspired by them, he suddenly came up with an interesting idea for trees in data structures:What if we add another edge in a tree?Then h...原创 2020-02-17 10:41:26 · 281 阅读 · 0 评论 -
CodeForces - 1304D G - Shortest and Longest LIS (构造 + sort)
D. Shortest and Longest LIStime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputGildong recently learned how to find thelongest incr...原创 2020-02-16 22:16:24 · 179 阅读 · 0 评论 -
CodeForces - 1304B E - Longest Palindrome
Returning back to problem solving, Gildong is now studying about palindromes. He learned that apalindromeis a string that is the same as its reverse. For example, strings "pop", "noon", "x", and "kk...原创 2020-02-16 21:32:49 · 326 阅读 · 0 评论 -
CodeForces - 1304C F - Air Conditioner
Gildong owns a bulgogi restaurant. The restaurant has a lot of customers, so many of them like to make a reservation before visiting it.Gildong tries so hard to satisfy the customers that he even me...原创 2020-02-16 18:26:07 · 166 阅读 · 0 评论 -
CodeForces - 1301B B - Motarack's Birthday
Dark is going to attend Motarack's birthday. Dark decided that the gift he is going to give to Motarack is an arrayaaofnnnon-negative integers.Dark created that array10001000years ago, so some...原创 2020-02-16 17:47:10 · 311 阅读 · 0 评论 -
CodeForces - 1303A A - Erasing Zeroes
You are given a stringss. Each character is either0or1.You want all1's in the string to form a contiguous subsegment. For example, if the string is0,1,00111or01111100, then all1's form a c...原创 2020-02-13 21:47:53 · 242 阅读 · 0 评论 -
CodeForces - 1303B B - National Project
Your company was appointed to lay new asphalt on the highway of lengthnn. You know that every day you can either repair one unit of the highway (lay new asphalt over one unit of the highway) or skip ...原创 2020-02-13 21:46:10 · 342 阅读 · 0 评论 -
CodeForces 1303C Perfect Keyboard
Polycarp wants to assemble his own keyboard. Layouts with multiple rows are too complicated for him — his keyboard will consist of only one row, where all2626lowercase Latin letters will be arranged...原创 2020-02-13 21:44:26 · 284 阅读 · 0 评论 -
CodeForces - 1295C C - Obtain The String
You are given two stringsssandttconsisting of lowercase Latin letters. Also you have a stringzzwhich is initially empty. You want stringzzto be equal to stringtt. You can perform the followin...原创 2020-01-31 13:55:16 · 300 阅读 · 0 评论 -
CodeForces - 1295B B - Infinite Prefixes
You are given stringssof lengthnnconsisting of0-s and1-s. You build an infinite stringttas a concatenation of an infinite number of stringsss, ort=ssss…t=ssss…For example, ifs=s=10010, th...原创 2020-01-30 18:30:24 · 397 阅读 · 0 评论 -
CodeForces - 1293C C - NEKO's Maze Game
NEKO#ΦωΦ has just got a new maze game on her PC!The game's main puzzle is a maze, in the forms of a2×n2×nrectangle grid. NEKO's task is to lead a Nekomimi girl from cell(1,1)(1,1)to the gate at...原创 2020-01-20 13:33:23 · 228 阅读 · 0 评论 -
New Year and Ascent Sequence cf1284B two point
B. New Year and Ascent SequenceA sequencea=[a1,a2,…,al]a=[a1,a2,…,al]of lengthllhas anascentif there exists a pair of indices(i,j)(i,j)such that1≤i<j≤l1≤i<j≤landai<ajai<aj. ...原创 2020-01-06 16:17:57 · 317 阅读 · 0 评论 -
code forces 1191b - Tokitsukaze and Mahjong
B. Tokitsukaze and Mahjongtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputTokitsukaze is playing a game derivated from Japanese m...原创 2019-07-13 09:11:51 · 230 阅读 · 0 评论