- 博客(95)
- 收藏
- 关注
原创 C. Wrong Addition
outputInputOutputExampleinputCopy61 5108 1121 111 20outputCopy34654-19000710-1Note。
2023-01-03 14:17:11
361
原创 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
186
原创 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
378
原创 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
105
原创 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
564
原创 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
583
原创 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
234
原创 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
314
原创 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
311
原创 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
365
原创 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
305
原创 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
89
原创 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
301
原创 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
199
原创 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
101
原创 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
197
原创 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
342
原创 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
194
原创 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
99
原创 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
166
原创 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
251
原创 C. Pattern【1200】
C. Pattern1 secondinputoutput??,??a, a?a, aba.nInputn(1 ≤nnOutputExamplesinputCopy2?ab??boutputCopyxabinputCopy2aboutputCopy?inputCopy1?a?boutputCopycacbNote??
2022-10-07 14:54:37
244
原创 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
430
原创 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
224
原创 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
138
原创 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
365
原创 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
474
原创 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
133
原创 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
77
原创 C1. Increasing Subsequence (easy version)
TheonlydifferencebetweenproblemsC1andC2isthatallvaluesininputofproblemC1aredistinct(thisconditionmaybefalseforproblemC2).Youaregivenasequenceaaconsistingofnnintegers.Alltheseintegersaredistinct,eachvaluefrom11tonnappearsinthesequenceexactlyonce.Youarema。
2022-07-26 22:59:41
175
原创 B. New Theatre Square
YoumighthaverememberedTheatresquarefromthe.Nowit'sfinallygettingrepaved.Thesquarestillhasarectangularshapeofn×mn×mmeters.However,thepictureisabouttogetmorecomplicatednow.Letai,jai,jbethejj-thsquareintheii-throwofthepavement.Youaregiventhepictureofthesqu。..
2022-07-25 19:06:04
113
原创 D. Buying Shovels
Polycarpwantstobuyexactlynnshovels.Theshopsellspackageswithshovels.Thestorehaskktypesofpackagesthepackageoftheii-thtypeconsistsofexactlyiishovels(1≤i≤k1≤i≤k).Thestorehasaninfinitenumberofpackagesofeachtype.Polycarpwantstochooseonetypeofpackagesandthenbuy。.
2022-07-25 16:37:21
227
原创 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
240
原创 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
172
原创 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
139
原创 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
90
原创 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
124
原创 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
228
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人