Codeforces Round 752 (Div. 2)

Solutions are presented as using the least memory and the fastest execution time. It also takes the top 10 most recent solutions from each language. If you want to limit to a specific index, click the "Solved" button and go to that problem.

ContestId
Name
Phase
Frozen
Duration (Seconds)
Relative Time
Start Time
1604 Codeforces Round 752 (Div. 2) FINISHED False 7200 101661863 Oct. 30, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 21775 ) A Era PROGRAMMING greedy 800

B"Shohag has an integer sequence a_1, a_2, ldots, a_n . He can perform the following operation any number of times (possibly, zero): For example, if a=[3,3,4] and he selects k = 2 , then after the operation he can obtain one of the sequences [ underline{2},3,3,4] , [3, underline{2},3,4] , [3,3, underline{2},4] , or [3,3,4, underline{2}] . Shohag wants this sequence to satisfy the following condition: for each 1 <= i <= |a| , a_i <= i . Here, |a| denotes the size of a . Help him to find the minimum number of operations that he has to perform to achieve this goal. We can show that under the constraints of the problem it's always possible to achieve this goal in a finite number of operations. The first line contains a single integer t ( 1 <= t <= 200 ) -- the number of test cases. The first line of each test case contains a single integer n ( 1 <= n <= 100 ) -- the initial length of the sequence. The second line of each test case contains n integers a_1, a_2, ldots, a_n ( 1 <= a_i <= 10^9 ) -- the elements of the sequence. For each test case, print a single integer -- the minimum number of operations needed to perform to achieve the goal mentioned in the statement. In the first test case, we have to perform at least one operation, as a_2=3>2 . We can perform the operation [1, 3, 4] rightarrow [1, underline{2}, 3, 4] (the newly inserted element is underlined), now the condition is satisfied. In the second test case, Shohag can perform the following operations: [1, 2, 5, 7, 4] rightarrow [1, 2, underline{3}, 5, 7, 4] rightarrow [1, 2, 3, underline{4}, 5, 7, 4] rightarrow [1, 2, 3, 4, 5, underline{3}, 7, 4] . In the third test case, the sequence already satisfies the condition. "...

Tutorials

Editorial of Codeforces Round #752

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
133674252 Hector.HJJ A Oct. 30, 2021, 4:12 p.m. OK GNU C11 TESTS 23 15 3686400 800
133690394 G.Gopi_Krishna A Oct. 30, 2021, 5:47 p.m. OK GNU C11 TESTS 23 15 3686400 800
133723232 viv.mat08 A Oct. 31, 2021, 5:38 a.m. OK GNU C11 TESTS 23 15 3686400 800
133681900 190040188srinivas A Oct. 30, 2021, 4:30 p.m. OK GNU C11 TESTS 23 15 3686400 800
133674013 divyachouhan A Oct. 30, 2021, 4:12 p.m. OK GNU C11 TESTS 23 30 3686400 800
133716404 F-2018 A Oct. 31, 2021, 3:39 a.m. OK GNU C11 TESTS 23 30 3686400 800
133713729 Youarenotgood A Oct. 31, 2021, 2:38 a.m. OK GNU C11 TESTS 23 31 3686400 800
133722390 i_kn0w_nothing A Oct. 31, 2021, 5:27 a.m. OK GNU C++14 TESTS 23 15 1024000 800
133721736 hardy_9795 A Oct. 31, 2021, 5:18 a.m. OK GNU C++14 TESTS 23 15 1024000 800
133720901 FarhanAlam A Oct. 31, 2021, 5:06 a.m. OK GNU C++14 TESTS 23 15 1024000 800
133720273 ohkay A Oct. 31, 2021, 4:56 a.m. OK GNU C++14 TESTS 23 15 1024000 800
133719921 DPH A Oct. 31, 2021, 4:50 a.m. OK GNU C++14 TESTS 23 15 1024000 800
133724802 sinister_787 A Oct. 31, 2021, 5:59 a.m. OK GNU C++14 TESTS 23 15 1024000 800
133724531 NiraliChoudhary A Oct. 31, 2021, 5:56 a.m. OK GNU C++14 TESTS 23 15 1024000 800
133722967 JCLinux A Oct. 31, 2021, 5:35 a.m. OK GNU C++14 TESTS 23 15 1024000 800
133722712 mmpataki A Oct. 31, 2021, 5:31 a.m. OK GNU C++14 TESTS 23 15 1024000 800
133722448 TheCypher A Oct. 31, 2021, 5:28 a.m. OK GNU C++14 TESTS 23 15 1024000 800
133720465 Bob15324 A Oct. 31, 2021, 4:59 a.m. OK GNU C++17 TESTS 23 15 1024000 800
133720332 kvp1703 A Oct. 31, 2021, 4:57 a.m. OK GNU C++17 TESTS 23 15 1024000 800
133720318 challapallichaithanya A Oct. 31, 2021, 4:57 a.m. OK GNU C++17 TESTS 23 15 1024000 800
133720254 sanju8238 A Oct. 31, 2021, 4:56 a.m. OK GNU C++17 TESTS 23 15 1024000 800
133723316 Khatrivatsal A Oct. 31, 2021, 5:39 a.m. OK GNU C++17 TESTS 23 15 1024000 800
133722930 eduarte A Oct. 31, 2021, 5:35 a.m. OK GNU C++17 TESTS 23 15 1024000 800
133722240 ruletheworld A Oct. 31, 2021, 5:25 a.m. OK GNU C++17 TESTS 23 15 1024000 800
133722233 TerminalWarlord A Oct. 31, 2021, 5:25 a.m. OK GNU C++17 TESTS 23 15 1024000 800
133721150 a7med7amed69 A Oct. 31, 2021, 5:10 a.m. OK GNU C++17 TESTS 23 15 1024000 800
133720795 vjudge1 A Oct. 31, 2021, 5:04 a.m. OK GNU C++17 TESTS 23 15 1024000 800
133716209 Lhohelhohehmm A Oct. 31, 2021, 3:35 a.m. OK GNU C++17 (64) TESTS 23 15 1228800 800
133723706 Amank2854 A Oct. 31, 2021, 5:45 a.m. OK GNU C++17 (64) TESTS 23 15 1228800 800
133723398 Chanpoe A Oct. 31, 2021, 5:41 a.m. OK GNU C++17 (64) TESTS 23 15 1228800 800
133721167 dragonman164 A Oct. 31, 2021, 5:10 a.m. OK GNU C++17 (64) TESTS 23 15 1228800 800
133719992 mayurpokharkar6 A Oct. 31, 2021, 4:51 a.m. OK GNU C++17 (64) TESTS 23 15 1228800 800
133718058 avnish0900 A Oct. 31, 2021, 4:14 a.m. OK GNU C++17 (64) TESTS 23 15 1228800 800
133716208 YoungChigga A Oct. 31, 2021, 3:35 a.m. OK GNU C++17 (64) TESTS 23 15 1228800 800
133713972 InFaNg A Oct. 31, 2021, 2:44 a.m. OK GNU C++17 (64) TESTS 23 15 1228800 800
133713179 mariam0155357 A Oct. 31, 2021, 2:25 a.m. OK GNU C++17 (64) TESTS 23 15 1228800 800
133712560 kmjp A Oct. 31, 2021, 2:09 a.m. OK GNU C++17 (64) TESTS 23 15 1228800 800
133719563 FReAk A Oct. 31, 2021, 4:44 a.m. OK GNU C++20 (64) TESTS 23 15 1228800 800
133719377 Shohan_Suvro A Oct. 31, 2021, 4:40 a.m. OK GNU C++20 (64) TESTS 23 15 1228800 800
133719307 kelvin_0179 A Oct. 31, 2021, 4:39 a.m. OK GNU C++20 (64) TESTS 23 15 1228800 800
133716041 L1ngYu233 A Oct. 31, 2021, 3:31 a.m. OK GNU C++20 (64) TESTS 23 15 1228800 800
133720152 Theo830 A Oct. 31, 2021, 4:54 a.m. OK GNU C++20 (64) TESTS 23 15 1228800 800
133721985 Raina_Jain A Oct. 31, 2021, 5:22 a.m. OK GNU C++20 (64) TESTS 23 15 1228800 800
133722741 Rawat26 A Oct. 31, 2021, 5:32 a.m. OK GNU C++20 (64) TESTS 23 15 1228800 800
133722950 bkifhr6 A Oct. 31, 2021, 5:35 a.m. OK GNU C++20 (64) TESTS 23 15 1228800 800
133723224 raviparmar2002 A Oct. 31, 2021, 5:38 a.m. OK GNU C++20 (64) TESTS 23 15 1228800 800
133723281 raviparmar2002 A Oct. 31, 2021, 5:39 a.m. OK GNU C++20 (64) TESTS 23 15 1228800 800
133687967 codelegend A Oct. 30, 2021, 5:29 p.m. OK Haskell TESTS 23 31 11161600 800
133722126 SaberXpro A Oct. 31, 2021, 5:24 a.m. OK Java 11 TESTS 23 171 24576000 800
133719774 uxie A Oct. 31, 2021, 4:48 a.m. OK Java 11 TESTS 23 186 24576000 800
133714571 Vksh_ A Oct. 31, 2021, 2:59 a.m. OK Java 11 TESTS 23 186 24576000 800
133719214 HelloWorld03 A Oct. 31, 2021, 4:38 a.m. OK Java 11 TESTS 23 186 24678400 800
133719413 kartheek542 A Oct. 31, 2021, 4:41 a.m. OK Java 11 TESTS 23 187 24473600 800
133711990 mitulgarg A Oct. 31, 2021, 1:52 a.m. OK Java 11 TESTS 23 187 24576000 800
133675241 puriabhijit000 A Oct. 30, 2021, 4:15 p.m. OK Java 11 TESTS 23 187 24576000 800
133695710 Moazahmed A Oct. 30, 2021, 6:45 p.m. OK Java 11 TESTS 23 187 24678400 800
133697798 bittubittu A Oct. 30, 2021, 7:10 p.m. OK Java 11 TESTS 23 202 24576000 800
133692666 viper451 A Oct. 30, 2021, 6:09 p.m. OK Java 11 TESTS 23 202 24576000 800
133688969 YashSaxena A Oct. 30, 2021, 5:36 p.m. OK Java 8 TESTS 23 108 18841600 800
133689529 jod_07 A Oct. 30, 2021, 5:40 p.m. OK Java 8 TESTS 23 109 18841600 800
133700254 tishrah_ A Oct. 30, 2021, 7:46 p.m. OK Java 8 TESTS 23 109 18841600 800
133690469 less_ordinary A Oct. 30, 2021, 5:48 p.m. OK Java 8 TESTS 23 109 18841600 800
133714779 aggarwalanshul01 A Oct. 31, 2021, 3:03 a.m. OK Java 8 TESTS 23 109 18944000 800
133692841 RonWonWon A Oct. 30, 2021, 6:11 p.m. OK Java 8 TESTS 23 124 18841600 800
133721498 dogranmol A Oct. 31, 2021, 5:14 a.m. OK Java 8 TESTS 23 124 18841600 800
133710661 amit_roy A Oct. 31, 2021, 1:05 a.m. OK Java 8 TESTS 23 124 18841600 800
133674702 zhur123 A Oct. 30, 2021, 4:13 p.m. OK Java 8 TESTS 23 124 18841600 800
133714576 rajivrtk12 A Oct. 31, 2021, 2:59 a.m. OK Java 8 TESTS 23 140 19558400 800
133698264 koper A Oct. 30, 2021, 7:16 p.m. OK Kotlin 1.4 TESTS 23 139 20172800 800
133695348 Tangerine A Oct. 30, 2021, 6:40 p.m. OK MS C++ 2017 TESTS 23 31 1126400 800
133701318 Ilyaiq300 A Oct. 30, 2021, 8:02 p.m. OK MS C++ 2017 TESTS 23 31 1126400 800
133713519 bkifhr9 A Oct. 31, 2021, 2:33 a.m. OK MS C++ 2017 TESTS 23 31 5120000 800
133720010 _lcj A Oct. 31, 2021, 4:52 a.m. OK MS C++ 2017 TESTS 23 46 1126400 800
133682896 psn2706 A Oct. 30, 2021, 4:32 p.m. OK MS C++ 2017 TESTS 23 46 1126400 800
133679096 Prog_Farag A Oct. 30, 2021, 4:24 p.m. OK .NET Core C# TESTS 23 93 10035200 800
133680270 shehebe A Oct. 30, 2021, 4:27 p.m. OK PyPy 2 TESTS 23 109 22425600 800
133687566 1_2_3_4_5_9 A Oct. 30, 2021, 5:27 p.m. OK PyPy 2 TESTS 23 109 22630400 800
133676270 wincss A Oct. 30, 2021, 4:17 p.m. OK PyPy 2 TESTS 23 124 21606400 800
133693034 hxu10 A Oct. 30, 2021, 6:13 p.m. OK PyPy 3 TESTS 23 93 19660800 800
133712697 3juhwan A Oct. 31, 2021, 2:13 a.m. OK PyPy 3 TESTS 23 93 19763200 800
133688143 Probability1 A Oct. 30, 2021, 5:30 p.m. OK PyPy 3 TESTS 23 93 19865600 800
133693041 nitish420 A Oct. 30, 2021, 6:13 p.m. OK PyPy 3 TESTS 23 108 19660800 800
133723459 coder_sounak A Oct. 31, 2021, 5:41 a.m. OK PyPy 3 TESTS 23 108 19763200 800
133710972 Silvana_Prevails A Oct. 31, 2021, 1:17 a.m. OK PyPy 3 TESTS 23 108 19763200 800
133706065 shantpat A Oct. 30, 2021, 9:48 p.m. OK PyPy 3 TESTS 23 108 19763200 800
133710551 kushal_banda A Oct. 31, 2021, 1:01 a.m. OK PyPy 3 TESTS 23 108 19865600 800
133688250 klindyuk A Oct. 30, 2021, 5:31 p.m. OK PyPy 3 TESTS 23 108 19865600 800
133676344 alkesh24 A Oct. 30, 2021, 4:17 p.m. OK PyPy 3 TESTS 23 108 19865600 800
133699000 Slamur A Oct. 30, 2021, 7:27 p.m. OK PyPy 3-64 TESTS 23 92 31744000 800
133691068 prackode A Oct. 30, 2021, 5:54 p.m. OK PyPy 3-64 TESTS 23 93 31539200 800
133677045 Code_St3pan A Oct. 30, 2021, 4:19 p.m. OK PyPy 3-64 TESTS 23 93 31539200 800
133704826 freakbuoyancy A Oct. 30, 2021, 9:11 p.m. OK PyPy 3-64 TESTS 23 93 31744000 800
133703797 tyzzi A Oct. 30, 2021, 8:49 p.m. OK PyPy 3-64 TESTS 23 93 31744000 800
133689357 KA.L A Oct. 30, 2021, 5:39 p.m. OK PyPy 3-64 TESTS 23 93 31846400 800
133715314 cyberkid05 A Oct. 31, 2021, 3:15 a.m. OK PyPy 3-64 TESTS 23 93 32256000 800
133715272 codinghermit05 A Oct. 31, 2021, 3:14 a.m. OK PyPy 3-64 TESTS 23 93 32256000 800
133724825 essential_sport A Oct. 31, 2021, 6 a.m. OK PyPy 3-64 TESTS 23 108 31744000 800
133719007 Khakim01 A Oct. 31, 2021, 4:33 a.m. OK PyPy 3-64 TESTS 23 108 31846400 800
133714537 llis12340 A Oct. 31, 2021, 2:58 a.m. OK Python 3 TESTS 23 46 4300800 800
133693770 2019286 A Oct. 30, 2021, 6:22 p.m. OK Python 3 TESTS 23 46 4300800 800
133722551 sunshineclover A Oct. 31, 2021, 5:29 a.m. OK Python 3 TESTS 23 46 4505600 800
133721076 Rahulsust A Oct. 31, 2021, 5:08 a.m. OK Python 3 TESTS 23 46 4505600 800
133712762 Rohitraj60134 A Oct. 31, 2021, 2:14 a.m. OK Python 3 TESTS 23 46 4505600 800
133683319 Mannu31 A Oct. 30, 2021, 4:33 p.m. OK Python 3 TESTS 23 46 4505600 800
133681245 190330228 A Oct. 30, 2021, 4:29 p.m. OK Python 3 TESTS 23 46 4505600 800
133679886 arghajitbhowmik08 A Oct. 30, 2021, 4:26 p.m. OK Python 3 TESTS 23 46 4505600 800
133678056 190340097_1 A Oct. 30, 2021, 4:22 p.m. OK Python 3 TESTS 23 46 4505600 800
133677922 vedavineetha A Oct. 30, 2021, 4:21 p.m. OK Python 3 TESTS 23 46 4505600 800
133688678 SorKierkegaard A Oct. 30, 2021, 5:34 p.m. OK Rust TESTS 23 15 1740800 800

remove filters

Back to search problems