codeforce
文章平均质量分 80
藤蔓疯长
我不知道将去何方,但我已在路上
展开
-
B. Serval and Inversion Magic
反转一段只含01的字符串,若反转后为回文则输出yes,否则no。原创 2023-02-28 18:12:01 · 486 阅读 · 1 评论 -
C. Wrong Addition
outputInputOutputExampleinputCopy61 5108 1121 111 20outputCopy34654-19000710-1Note。原创 2023-01-03 14:17:11 · 376 阅读 · 0 评论 -
A. Common Prefixes【水题】
The length of thelongest common prefixof two stringss=s1s2…sns=s1s2…snandt=t1t2…tmt=t1t2…tmis defined as the maximum integerkk(0≤k≤min(n,m)0≤k≤min(n,m)) such thats1s2…sks1s2…skequalst1t2…tkt1t2…tk.原创 2022-11-11 20:11:18 · 192 阅读 · 0 评论 -
B. Prinzessin der Verurteilung
I, Fischl, Prinzessin der Verurteilung, descend upon this land by the call of fate an — Oh, you are also a traveler from another world?Very well, I grant you permission to travel with me.It is no surprise Fischl speaks with a strange choice of words. Ho原创 2022-11-07 17:36:20 · 384 阅读 · 0 评论 -
B. Longest Palindrome
Returning back to problem solving, Gildong is now studying about palindromes. He learned that a palindrome is a string that is the same as its reverse. For example, strings "pop", "noon", "x", and "kkkkkk" are palindromes, while strings原创 2022-10-29 16:08:32 · 115 阅读 · 0 评论 -
A. Alyona and Numbers【水题】
After finishing eating her bun, Alyona came up with two integersnandm. She decided to write down two columns of integers— the first column containing integers from1tonand the second containing integers from1tom. Now the girl wants to count how m原创 2022-10-28 17:58:23 · 571 阅读 · 0 评论 -
B. Boboniu Plays Chess
BBoboniu likes playing chess with his employees. As we know, no employee can beat the boss in the chess game, so Boboniu has never lost in any round.You are a new applicant for his company. Boboniu will test you with the following chess question:Conside原创 2022-10-28 11:05:06 · 598 阅读 · 0 评论 -
C. Team
Now it's time of Olympiads. Vanya and Egor decided to make his own team to take part in a programming Olympiad. They've been best friends ever since primary school and hopefully, that can somehow help them in teamwork.原创 2022-10-27 22:31:54 · 242 阅读 · 0 评论 -
C. Omkar and Baseball
Patrick likes to play baseball, but sometimes he will spend so many hours hitting home runs that his mind starts to get foggy! Patrick is sure that his scores acrossnnsessions follow the identity permutation (ie. in the first game he scores11point, in原创 2022-10-27 20:22:41 · 326 阅读 · 0 评论 -
D. Game With Array
Petya and Vasya are competing with each other in a new interesting game as they always do.At the beginning of the game Petya has to come up with an array of N positive integers. Sum of all elements in his array should be equal to S. Then Petya has to sel原创 2022-10-27 18:14:22 · 323 阅读 · 0 评论 -
B. Plus and Multiply
There is an infinite set generated as follows:11is in this set.Ifxxis in this set,x⋅ax⋅aandx+bx+bboth are in this set.For example, whena=3a=3andb=6b=6, the five smallest elements of the set are:11,33(11is in this set, so1⋅a=31⋅a=3is in原创 2022-10-27 16:54:20 · 375 阅读 · 0 评论 -
G. Special Permutation
G. Special PeA permutation of lengthnnis an arrayp=[p1,p2,…,pn]p=[p1,p2,…,pn], which contains every integer from11tonn(inclusive) and, moreover, each number appears exactly once. For example,p=[3,1,4,2,5]p=[3,1,4,2,5]is a permutation of length55.原创 2022-10-25 13:23:45 · 308 阅读 · 0 评论 -
B. 3-palindrome
In the beginning of the new year Keivan decided to reverse his name. He doesn't like palindromes, so he changed Naviek to Navick.He is too selfish, so for a givennhe wants to obtain a string ofncharacters, each of which is either 'a', 'b' or 'c', wit原创 2022-10-24 23:49:51 · 90 阅读 · 0 评论 -
B. Trouble Sort
Ashish hasnnelements arranged in a line.These elements are represented by two integersaiai— the value of the element andbibi— the type of the element (there are only two possible types:00and11). He wants to sort the elements in non-decreasing va原创 2022-10-21 17:28:32 · 303 阅读 · 0 评论 -
C. Dishonest Sellers
Igor found out discounts in a shop and decided to buy n items. Discounts at the store will last for a week and Igor knows about each item that its price now is ai, and after a week of discounts its price will be bi.Not all of sellers are honest, so now s原创 2022-10-18 21:51:14 · 210 阅读 · 0 评论 -
C. Fruits
The spring is coming and it means that a lot of fruits appear on the counters. One sunny day little boy Valera decided to go shopping. He made a list ofmfruits he wanted to buy. If Valera want to buy more than one fruit of some kind, he includes it into原创 2022-10-16 21:22:37 · 112 阅读 · 0 评论 -
C. A-B Palindrome
You are given a string s consisting of the characters '0', '1', and '?'. You need to replace all the characters with '?' in the string s by '0' or '1' so that the string becomes a palindrome and has exactly a characters '0' and exactly b characters '1'. No原创 2022-10-14 13:38:06 · 207 阅读 · 0 评论 -
A. Compare T-Shirt Sizes
Two T-shirt sizes are given:aaandbb. The T-shirt size is either a stringMor a string consisting of several (possibly zero) charactersXand one of the charactersSorL.For example, stringsM,XXL,S,XXXXXXXScould be the size of some T-shirts. And原创 2022-10-12 07:55:53 · 356 阅读 · 0 评论 -
C. Registration system
A new e-mail service "Berlandesk" is going to be opened in Berland in the near future. The site administration wants to launch their project as soon as possible, that's why they ask you to help. You're suggested to implement the prototype of site registrat原创 2022-10-09 21:06:28 · 198 阅读 · 0 评论 -
B. Yet Another Meme Problem
B. Yet Another Meme ProblemYou are given two integersAAandBB, calculate the number of pairs(a,b)(a,b)such that1≤a≤A1≤a≤A,1≤b≤B1≤b≤B, and the equationa⋅b+a+b=conc(a,b)a⋅b+a+b=conc(a,b)is true;conc(a,b)原创 2022-10-09 08:18:23 · 100 阅读 · 0 评论 -
A. Deadline
Adilbek was assigned to a special project. For Adilbek it means that he hasnndays to run a special program and provide its results. But there is a problem: the program needs to run fordddays to calculate the results.原创 2022-10-09 08:04:18 · 169 阅读 · 0 评论 -
B. The Modcrab
Vova is again playing some computer game, now an RPG. In the game Vova's character received a quest: to slay the fearsome monster called Modcrab.After two hours of playing the game Vova has tracked the monster and analyzed its tactics. The Modcrab has h2 h原创 2022-10-07 16:39:52 · 262 阅读 · 0 评论 -
C. Pattern【1200】
C. Pattern1 secondinputoutput??,??a, a?a, aba.nInputn(1 ≤nnOutputExamplesinputCopy2?ab??boutputCopyxabinputCopy2aboutputCopy?inputCopy1?a?boutputCopycacbNote??原创 2022-10-07 14:54:37 · 246 阅读 · 0 评论 -
A. Broken Keyboard
Recently Polycarp noticed that some of the buttons of his keyboard are malfunctioning. For simplicity, we assume that Polycarp's keyboard contains 26 buttons (one for each letter of the Latin alphabet). Each button is either working fine or malfunctioning.原创 2022-10-04 21:53:35 · 432 阅读 · 0 评论 -
B. Sorted Adjacent Differences
You have array of n numbers a1,a2,…,an.Rearrange these numbers to satisfy |a1−a2|≤|a2−a3|≤…≤|an−1−an|, where |x| denotes absolute value of x. It's always possible to find such rearrangement.Note that all numbers in a are not necessarily different. In o原创 2022-09-18 21:06:15 · 239 阅读 · 0 评论 -
C. Building Permutation
Permutation p is an ordered set of integers p1, p2, ..., pn, consisting of n distinct positive integers, each of them doesn't exceed n. We'll denote the i-th element of permutation p as pi. We'll call number n the size or the length of permuta...原创 2022-08-26 13:07:30 · 152 阅读 · 0 评论 -
Educational Codeforces Round 133 (Rated for Div. 2) A. 2-3 Moves
You are standing at the point 0 on a coordinate line. Your goal is to reach the point n. In one minute, you can move by 2 or by 3 to the left or to the right (i. e., if your current coordinate is x, it can become x−3, x−2, x+2 or x+3). Note that the new co原创 2022-08-05 10:31:33 · 370 阅读 · 0 评论 -
B. Permutation Chain
A permutation of lengthnnis a sequence of integers from11tonnsuch that each integer appears in it exactly once.Let the fixedness of a permutationppbe the number of fixed points in it— the number of positionsjjsuch thatpj=jpj=j, wherepjpjis ...原创 2022-08-05 10:24:55 · 487 阅读 · 0 评论 -
B. Array Cloning Technique
B.ArrayCloningTechnique。You are given an arrayaaofnnintegers. Initially there is only one copy of the given array.You can do operations of two types:Choose any array and clone it. After that there is one more copy of the chosen array.Swap two elem...原创 2022-08-01 09:41:58 · 143 阅读 · 0 评论 -
A. Jzzhu and Children[模拟]
A.JzzhuandChildren There arenchildren in Jzzhu's school. Jzzhu is going to give some candies to them. Let's number all the children from1ton. Thei-th child wants to get at leastaicandies.Jzzhu asks children to line up. Initially, thei-th child s...原创 2022-07-28 16:25:20 · 79 阅读 · 0 评论 -
C1. Increasing Subsequence (easy version)
TheonlydifferencebetweenproblemsC1andC2isthatallvaluesininputofproblemC1aredistinct(thisconditionmaybefalseforproblemC2).Youaregivenasequenceaaconsistingofnnintegers.Alltheseintegersaredistinct,eachvaluefrom11tonnappearsinthesequenceexactlyonce.Youarema。原创 2022-07-26 22:59:41 · 189 阅读 · 0 评论 -
B. New Theatre Square
YoumighthaverememberedTheatresquarefromthe.Nowit'sfinallygettingrepaved.Thesquarestillhasarectangularshapeofn×mn×mmeters.However,thepictureisabouttogetmorecomplicatednow.Letai,jai,jbethejj-thsquareintheii-throwofthepavement.Youaregiventhepictureofthesqu。..原创 2022-07-25 19:06:04 · 118 阅读 · 0 评论 -
D. Buying Shovels
Polycarpwantstobuyexactlynnshovels.Theshopsellspackageswithshovels.Thestorehaskktypesofpackagesthepackageoftheii-thtypeconsistsofexactlyiishovels(1≤i≤k1≤i≤k).Thestorehasaninfinitenumberofpackagesofeachtype.Polycarpwantstochooseonetypeofpackagesandthenbuy。.原创 2022-07-25 16:37:21 · 243 阅读 · 0 评论 -
C. Product of Three Numbers
C.PYouaregivenoneintegernumbernn.Findthreedistinctintegersa,b,ca,b,csuchthat2≤a,b,c2≤a,b,canda⋅b⋅c=na⋅b⋅c=norsaythatitisimpossibletodoit.Ifthereareseveralanswers,youcanprintany.Youhavetoanswerttindependenttestcases.InputThefirstlineoftheinputcontainsonei。原创 2022-07-24 22:42:22 · 258 阅读 · 0 评论 -
C. Not Adjacent Matrix
C. Not Adjacent MatrixWe will consider the numbersaaandbbas adjacent if they differ by exactly one, that is,|a−b|=1|a−b|=1.We will consider cells of a square matrixn×nn×nas adjacent if they have a common side, that is, for cell(r,c)原创 2022-07-24 22:33:49 · 175 阅读 · 0 评论 -
A. Berland Poker
A.BerlandPokerThe game of Berland poker is played with a deck ofnncards,mmof which are jokers.kkplayers play this game (nnis divisible bykk).At the beginning of the game, each player takesnknkcards from the deck (so each card is taken by exactl...原创 2022-07-22 18:25:02 · 141 阅读 · 0 评论 -
C. Ternary XOR
C. Ternary XOR A number isternaryif it contains only digits00,11and22. For example, the following numbers are ternary:10221022,1111,2121,20022002.You are given a long ternary numberxx. The first (leftmost) digit ofxxis guaranteed to be22, the...原创 2022-07-22 17:38:03 · 91 阅读 · 0 评论 -
B. Yet Another Bookshelf
B.YetAnotherBookshelf。There is a bookshelf which can fitnnbooks. Theii-th position of bookshelf isai=1ai=1if there is a book on this position andai=0ai=0otherwise. It is guaranteed that there isat least one bookon the bookshelf.In one move, you ...原创 2022-07-21 18:52:55 · 140 阅读 · 0 评论 -
B. 01 Game【模拟】
B.01GameAlica and Bob are playing a game.Initially they have a binary stringssconsisting of only characters0and1.Alice and Bob make alternating moves: Alice makes the first move, Bob makes the second move, Alice makes the third one, and so on. Dur...原创 2022-07-21 17:16:32 · 231 阅读 · 0 评论 -
B. Make AP【模拟】
题意给你三个数a,b,c判断某个数乘以一个正整数m,能否使该三个数为等差数列。原创 2022-07-21 16:00:07 · 269 阅读 · 0 评论