Codeforces Round 656 (Div. 3)

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
1385 Codeforces Round 656 (Div. 3) FINISHED False 8100 136826699 July 17, 2020, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 27135 ) C Make It Good PROGRAMMING binary search greedy 1200

B'You are given an array a consisting of n integers. You have to find the length of the smallest (shortest) prefix of elements you need to erase from a to make it a good array. Recall that the prefix of the array a=[a_1, a_2, ... , a_n] is a subarray consisting several first elements: the prefix of the array a of length k is the array [a_1, a_2, ... , a_k] ( 0 <= k <= n ). The array b of length m is called good, if you can obtain a non-decreasing array c ( c_1 <= c_2 <= ... <= c_{m} ) from it, repeating the following operation m times (initially, c is empty): For example, if we do 4 operations: take b_1 , then b_{m} , then b_{m-1} and at last b_2 , then b becomes [b_3, b_4, ... , b_{m-3}] and c =[b_1, b_{m}, b_{m-1}, b_2] . Consider the following example: b = [1, 2, 3, 4, 4, 2, 1] . This array is good because we can obtain non-decreasing array c from it by the following sequence of operations: Note that the array consisting of one element is good. Print the length of the shortest prefix of a to delete (erase), to make a to be a good array. Note that the required length can be 0 . You have to answer t independent test cases. The first line of the input contains one integer t ( 1 <= t <= 2 cdot 10^4 ) -- the number of test cases. Then t test cases follow. The first line of the test case contains one integer n ( 1 <= n <= 2 cdot 10^5 ) -- the length of a . The second line of the test case contains n integers a_1, a_2, ... , a_n ( 1 <= a_i <= 2 cdot 10^5 ), where a_i is the i -th element of a . It is guaranteed that the sum of n does not exceed 2 cdot 10^5 ( sum n <= 2 cdot 10^5 ). For each test case, print the answer: the length of the shortest prefix of elements you need to erase from a to make i'...

Tutorials

Codeforces Round #656 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
87187603 fpc_coder C July 18, 2020, 1:26 a.m. OK FPC TESTS 12 108 4198400 1200
87139790 PAG C July 17, 2020, 3:57 p.m. OK FPC TESTS 12 109 5017600 1200
87143726 rainboy C July 17, 2020, 4:06 p.m. OK GNU C11 TESTS 12 93 4505600 1200
87131357 smitpanchal C July 17, 2020, 3:39 p.m. OK GNU C11 TESTS 12 108 4505600 1200
87151030 Lazy_ishtiak C July 17, 2020, 4:24 p.m. OK GNU C11 TESTS 12 108 4505600 1200
87171595 aryabhattahp C July 17, 2020, 6:27 p.m. OK GNU C11 TESTS 12 109 4505600 1200
87175085 Khayrulmithu C July 17, 2020, 7:12 p.m. OK GNU C11 TESTS 12 109 4505600 1200
87188973 gxlois C July 18, 2020, 2:07 a.m. OK GNU C11 TESTS 12 109 4505600 1200
87149295 Mithu.ict C July 17, 2020, 4:20 p.m. OK GNU C11 TESTS 12 109 4505600 1200
87150578 Vishal7036 C July 17, 2020, 4:23 p.m. OK GNU C11 TESTS 12 109 4505600 1200
87153487 lllllyh C July 17, 2020, 4:31 p.m. OK GNU C11 TESTS 12 109 4505600 1200
87166358 Badr_17 C July 17, 2020, 5:30 p.m. OK GNU C11 TESTS 12 109 4505600 1200
87130298 ACji C July 17, 2020, 3:37 p.m. OK GNU C++11 TESTS 12 31 4505600 1200
87147509 JCJCJCJCJC C July 17, 2020, 4:15 p.m. OK GNU C++11 TESTS 12 31 4710400 1200
87187144 YHHxBULIATANIA C July 18, 2020, 1:02 a.m. OK GNU C++11 TESTS 12 31 4915200 1200
87125368 crh1272336175 C July 17, 2020, 3:29 p.m. OK GNU C++11 TESTS 12 31 5529600 1200
87139543 CCPSDCGK C July 17, 2020, 3:56 p.m. OK GNU C++11 TESTS 12 46 4505600 1200
87197883 AC_Wong C July 18, 2020, 5:40 a.m. OK GNU C++11 TESTS 12 46 4505600 1200
87138349 QlQl C July 17, 2020, 3:54 p.m. OK GNU C++11 TESTS 12 46 4505600 1200
87145743 Werner_Yin C July 17, 2020, 4:11 p.m. OK GNU C++11 TESTS 12 46 4710400 1200
87188034 new_xyq C July 18, 2020, 1:38 a.m. OK GNU C++11 TESTS 12 46 4710400 1200
87187777 heyanjie C July 18, 2020, 1:30 a.m. OK GNU C++11 TESTS 12 46 4710400 1200
87126687 RaviVK C July 17, 2020, 3:31 p.m. OK GNU C++14 TESTS 12 46 4505600 1200
87169209 murtipiyush1 C July 17, 2020, 6:01 p.m. OK GNU C++14 TESTS 12 46 4505600 1200
87125473 shellspicker C July 17, 2020, 3:29 p.m. OK GNU C++14 TESTS 12 46 6656000 1200
87126057 daydreamer233 C July 17, 2020, 3:30 p.m. OK GNU C++14 TESTS 12 46 7782400 1200
87130534 sriram2000na C July 17, 2020, 3:38 p.m. OK GNU C++14 TESTS 12 61 4505600 1200
87131778 3Sa3dI4 C July 17, 2020, 3:40 p.m. OK GNU C++14 TESTS 12 61 4505600 1200
87154945 skilledNoob C July 17, 2020, 4:35 p.m. OK GNU C++14 TESTS 12 61 4505600 1200
87165882 ritesh9827 C July 17, 2020, 5:25 p.m. OK GNU C++14 TESTS 12 61 4505600 1200
87166038 Puff_Puff_Pass C July 17, 2020, 5:27 p.m. OK GNU C++14 TESTS 12 61 4505600 1200
87199184 thaizhenleng C July 18, 2020, 5:59 a.m. OK GNU C++14 TESTS 12 62 4505600 1200
87131518 zhzhsan C July 17, 2020, 3:40 p.m. OK GNU C++17 TESTS 12 61 4505600 1200
87155678 lihuazou C July 17, 2020, 4:37 p.m. OK GNU C++17 TESTS 12 61 4505600 1200
87145705 MRITUNJYA C July 17, 2020, 4:10 p.m. OK GNU C++17 TESTS 12 61 4505600 1200
87142515 M8N C July 17, 2020, 4:03 p.m. OK GNU C++17 TESTS 12 61 4505600 1200
87141707 lordknull C July 17, 2020, 4:01 p.m. OK GNU C++17 TESTS 12 61 4505600 1200
87134805 __FAILURE__ C July 17, 2020, 3:46 p.m. OK GNU C++17 TESTS 12 61 4505600 1200
87137637 MTL_Sakura C July 17, 2020, 3:52 p.m. OK GNU C++17 TESTS 12 61 4710400 1200
87139012 lakergo C July 17, 2020, 3:55 p.m. OK GNU C++17 TESTS 12 61 6348800 1200
87199054 devanshu_raj C July 18, 2020, 5:57 a.m. OK GNU C++17 TESTS 12 62 4505600 1200
87199065 Vlaine C July 18, 2020, 5:57 a.m. OK GNU C++17 TESTS 12 62 4505600 1200
87159973 Mormo_1703119 C July 17, 2020, 4:48 p.m. OK GNU C++17 (64) TESTS 12 46 5120000 1200
87167563 Unopator C July 17, 2020, 5:42 p.m. OK GNU C++17 (64) TESTS 12 46 5120000 1200
87171063 R2-D2_hates_lemon C July 17, 2020, 6:20 p.m. OK GNU C++17 (64) TESTS 12 46 5120000 1200
87171679 i_love_dariia C July 17, 2020, 6:28 p.m. OK GNU C++17 (64) TESTS 12 46 5120000 1200
87175179 vasugondaliya C July 17, 2020, 7:13 p.m. OK GNU C++17 (64) TESTS 12 46 5120000 1200
87179847 Maruf. C July 17, 2020, 8:37 p.m. OK GNU C++17 (64) TESTS 12 46 5120000 1200
87144350 GRandle C July 17, 2020, 4:07 p.m. OK GNU C++17 (64) TESTS 12 46 5120000 1200
87141436 Alequisk C July 17, 2020, 4 p.m. OK GNU C++17 (64) TESTS 12 46 5120000 1200
87139496 blackomega C July 17, 2020, 3:56 p.m. OK GNU C++17 (64) TESTS 12 46 5120000 1200
87133607 QUIZZER_BOY C July 17, 2020, 3:44 p.m. OK GNU C++17 (64) TESTS 12 46 5120000 1200
87130356 keep__calm C July 17, 2020, 3:38 p.m. OK Go TESTS 12 108 11571200 1200
87197464 Trishan C July 18, 2020, 5:34 a.m. OK Go TESTS 12 124 11980800 1200
87191696 synapse C July 18, 2020, 3:18 a.m. OK Go TESTS 12 140 11673600 1200
87147179 Rahul C July 17, 2020, 4:14 p.m. OK Go TESTS 12 140 11673600 1200
87146900 Aidar.Babanov C July 17, 2020, 4:13 p.m. OK Go TESTS 12 186 10854400 1200
87135196 dblokhin C July 17, 2020, 3:47 p.m. OK Go TESTS 12 187 11673600 1200
87161108 TearFox C July 17, 2020, 4:51 p.m. OK Haskell TESTS 12 545 84070400 1200
87169470 In_The_Name_Of_Love C July 17, 2020, 6:04 p.m. OK Java 11 TESTS 12 187 23859200 1200
87125416 pgupta9830 C July 17, 2020, 3:29 p.m. OK Java 11 TESTS 12 187 23859200 1200
87131920 supershravan469 C July 17, 2020, 3:40 p.m. OK Java 11 TESTS 12 187 23961600 1200
87174414 litesam C July 17, 2020, 7:02 p.m. OK Java 11 TESTS 12 202 23859200 1200
87138568 bckslsh03 C July 17, 2020, 3:54 p.m. OK Java 11 TESTS 12 202 23859200 1200
87131502 saikaushik C July 17, 2020, 3:40 p.m. OK Java 11 TESTS 12 202 23859200 1200
87128086 EigenFunk C July 17, 2020, 3:34 p.m. OK Java 11 TESTS 12 202 23859200 1200
87159499 MahmoudJobeel C July 17, 2020, 4:47 p.m. OK Java 11 TESTS 12 217 23859200 1200
87147819 typewriter999 C July 17, 2020, 4:16 p.m. OK Java 11 TESTS 12 217 23859200 1200
87137751 kadintang1 C July 17, 2020, 3:52 p.m. OK Java 11 TESTS 12 217 23859200 1200
87142772 jainayushjain95 C July 17, 2020, 4:03 p.m. OK Java 8 TESTS 12 109 20377600 1200
87151201 lolling C July 17, 2020, 4:25 p.m. OK Java 8 TESTS 12 109 20480000 1200
87129772 nikhil_supertramp C July 17, 2020, 3:36 p.m. OK Java 8 TESTS 12 109 21401600 1200
87199047 Pranay2516 C July 18, 2020, 5:57 a.m. OK Java 8 TESTS 12 124 20377600 1200
87192718 tarun_sm C July 18, 2020, 3:41 a.m. OK Java 8 TESTS 12 124 20377600 1200
87185556 bluesky111 C July 17, 2020, 11:39 p.m. OK Java 8 TESTS 12 124 20377600 1200
87172831 ragnarok001 C July 17, 2020, 6:42 p.m. OK Java 8 TESTS 12 124 20377600 1200
87142768 niteshnanda C July 17, 2020, 4:03 p.m. OK Java 8 TESTS 12 124 20377600 1200
87138564 DropKeBaadNirma C July 17, 2020, 3:54 p.m. OK Java 8 TESTS 12 124 20377600 1200
87137433 k_6101 C July 17, 2020, 3:52 p.m. OK Java 8 TESTS 12 124 20377600 1200
87154759 Loremon C July 17, 2020, 4:34 p.m. OK JavaScript TESTS 12 202 30310400 1200
87129347 SergeyOz C July 17, 2020, 3:36 p.m. OK Kotlin TESTS 12 436 32972800 1200
87158319 etctaro C July 17, 2020, 4:44 p.m. OK Kotlin TESTS 12 436 35737600 1200
87157801 DeMoliT1on C July 17, 2020, 4:43 p.m. OK Kotlin TESTS 12 436 36249600 1200
87132185 viktorx C July 17, 2020, 3:41 p.m. OK Kotlin TESTS 12 436 36249600 1200
87181411 Bauyrzhanrr C July 17, 2020, 9:16 p.m. OK Kotlin TESTS 12 498 21299200 1200
87132283 Kolyanich C July 17, 2020, 3:41 p.m. OK Mono C# TESTS 12 156 10547200 1200
87142520 braher C July 17, 2020, 4:03 p.m. OK Mono C# TESTS 12 233 26931200 1200
87145271 flu2 C July 17, 2020, 4:09 p.m. OK Mono C# TESTS 12 234 31846400 1200
87190988 vjudge5 C July 18, 2020, 3 a.m. OK MS C++ TESTS 12 109 8192000 1200
87145001 _remake_ C July 17, 2020, 4:09 p.m. OK MS C++ TESTS 12 171 4915200 1200
87128271 godovald C July 17, 2020, 3:34 p.m. OK MS C++ TESTS 12 202 8192000 1200
87144057 1181316585 C July 17, 2020, 4:06 p.m. OK MS C++ 2017 TESTS 12 77 4812800 1200
87154730 201921121110chenminghao C July 17, 2020, 4:34 p.m. OK MS C++ 2017 TESTS 12 78 4505600 1200
87126350 NCG4039. C July 17, 2020, 3:30 p.m. OK MS C++ 2017 TESTS 12 78 4812800 1200
87131344 JasminI C July 17, 2020, 3:39 p.m. OK MS C++ 2017 TESTS 12 78 4812800 1200
87144037 Imperium_ C July 17, 2020, 4:06 p.m. OK MS C++ 2017 TESTS 12 78 4812800 1200
87127812 the_most_vegetable C July 17, 2020, 3:33 p.m. OK MS C++ 2017 TESTS 12 93 4505600 1200
87130150 nhuyphung C July 17, 2020, 3:37 p.m. OK MS C++ 2017 TESTS 12 140 4505600 1200
87135965 dddttdCF C July 17, 2020, 3:49 p.m. OK MS C++ 2017 TESTS 12 140 4505600 1200
87129164 porpoise C July 17, 2020, 3:35 p.m. OK MS C++ 2017 TESTS 12 140 4505600 1200
87150678 fant1k C July 17, 2020, 4:23 p.m. OK MS C++ 2017 TESTS 12 171 4505600 1200
87128565 watarimaycry2 C July 17, 2020, 3:34 p.m. OK Node.js TESTS 12 140 36659200 1200
87164820 explorer_sifat C July 17, 2020, 5:16 p.m. OK Node.js TESTS 12 358 36761600 1200
87144092 g__c C July 17, 2020, 4:06 p.m. OK PyPy 2 TESTS 12 218 38707200 1200
87129157 snape_here C July 17, 2020, 3:35 p.m. OK PyPy 2 TESTS 12 233 39936000 1200
87131267 chaudhary_19 C July 17, 2020, 3:39 p.m. OK PyPy 2 TESTS 12 248 39526400 1200
87144680 shehebe C July 17, 2020, 4:08 p.m. OK PyPy 2 TESTS 12 576 34406400 1200
87127829 beethoven97 C July 17, 2020, 3:33 p.m. OK PyPy 2 TESTS 12 576 41984000 1200
87163620 alexwice C July 17, 2020, 5:06 p.m. OK PyPy 2 TESTS 12 608 34611200 1200
87125948 daniel.carlos C July 17, 2020, 3:30 p.m. OK PyPy 2 TESTS 12 826 34406400 1200
87165709 hajab C July 17, 2020, 5:24 p.m. OK PyPy 2 TESTS 12 998 35635200 1200
87149247 ramgarg102 C July 17, 2020, 4:19 p.m. OK PyPy 3 TESTS 12 202 36249600 1200
87150558 2019ucp1350 C July 17, 2020, 4:23 p.m. OK PyPy 3 TESTS 12 202 36864000 1200
87136910 gintoki_s C July 17, 2020, 3:51 p.m. OK PyPy 3 TESTS 12 217 35942400 1200
87149181 unknown_2433 C July 17, 2020, 4:19 p.m. OK PyPy 3 TESTS 12 233 35737600 1200
87138594 servermonk C July 17, 2020, 3:54 p.m. OK PyPy 3 TESTS 12 233 35840000 1200
87134408 tiwari0000 C July 17, 2020, 3:45 p.m. OK PyPy 3 TESTS 12 233 35840000 1200
87127615 siddhantgarg11 C July 17, 2020, 3:33 p.m. OK PyPy 3 TESTS 12 249 35840000 1200
87152742 manish.17 C July 17, 2020, 4:29 p.m. OK PyPy 3 TESTS 12 249 35942400 1200
87143064 devil9614 C July 17, 2020, 4:04 p.m. OK PyPy 3 TESTS 12 249 36044800 1200
87176634 bit_2 C July 17, 2020, 7:35 p.m. OK PyPy 3 TESTS 12 265 34406400 1200
87144474 ComptineDunAutreEte C July 17, 2020, 4:07 p.m. OK Python 2 TESTS 12 389 17612800 1200
87166609 nikhilsisodia.159 C July 17, 2020, 5:32 p.m. OK Python 2 TESTS 12 451 17612800 1200
87145164 shaileshaanand C July 17, 2020, 4:09 p.m. OK Python 3 TESTS 12 249 20992000 1200
87156623 bing_007 C July 17, 2020, 4:39 p.m. OK Python 3 TESTS 12 249 21299200 1200
87167740 tanisha_2502 C July 17, 2020, 5:44 p.m. OK Python 3 TESTS 12 265 21299200 1200
87130317 farrellbyu C July 17, 2020, 3:37 p.m. OK Python 3 TESTS 12 265 21913600 1200
87138742 sudhirMTS C July 17, 2020, 3:54 p.m. OK Python 3 TESTS 12 280 21196800 1200
87147881 wannacry97 C July 17, 2020, 4:16 p.m. OK Python 3 TESTS 12 280 21299200 1200
87137988 ramzz C July 17, 2020, 3:53 p.m. OK Python 3 TESTS 12 280 21299200 1200
87161814 eugalt C July 17, 2020, 4:54 p.m. OK Python 3 TESTS 12 280 23040000 1200
87125560 eugalt C July 17, 2020, 3:29 p.m. OK Python 3 TESTS 12 295 22220800 1200
87146898 Canpake C July 17, 2020, 4:13 p.m. OK Python 3 TESTS 12 311 20582400 1200
87186414 Professor_ C July 18, 2020, 12:26 a.m. OK Ruby TESTS 12 638 64512000 1200
87164238 purple_haze1 C July 17, 2020, 5:11 p.m. OK Ruby TESTS 12 795 66150400 1200
87191728 sansen C July 18, 2020, 3:18 a.m. OK Rust TESTS 12 31 6963200 1200
87127054 quickn_babo C July 17, 2020, 3:32 p.m. OK Rust TESTS 12 46 7680000 1200
87158870 Slsvcn C July 17, 2020, 4:45 p.m. OK Rust TESTS 12 78 12288000 1200
87132355 rustafarian C July 17, 2020, 3:41 p.m. OK Rust TESTS 12 108 15360000 1200
87144654 IvanDyachenko C July 17, 2020, 4:08 p.m. OK Scala TESTS 12 795 57139200 1200

remove filters

Back to search problems