Codeforces Round 756 (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
1611 Codeforces Round 756 (Div. 3) FINISHED False 8100 99415463 Nov. 25, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 18599 ) C Polycarp Recovers the Permutation PROGRAMMING constructive algorithms 1000

B"Polycarp wrote on a whiteboard an array p of length n , which is a permutation of numbers from 1 to n . In other words, in p each number from 1 to n occurs exactly once. He also prepared a resulting array a , which is initially empty (that is, it has a length of 0 ). After that, he did exactly n steps. Each step looked like this: Note that on the last step, p has a length of 1 and its minimum element is both leftmost and rightmost. In this case, Polycarp can choose what role the minimum element plays. In other words, this element can be added to a both on the left and on the right (at the discretion of Polycarp). Let's look at an example. Let n=4 , p=[3, 1, 4, 2] . Initially a=[] . Then: Thus, a possible value of a after n steps could be a=[1,3,2,4] . You are given the final value of the resulting array a . Find any possible initial value for p that can result the given a , or determine that there is no solution. The first line of the input contains an integer t ( 1 <= t <= 10^4 ) -- the number of test cases in the test. Each test case consists of two lines. The first of them contains an integer n ( 1 <= n <= 2 cdot10^5 ) -- the length of the array a . The second line contains n integers a_1, a_2, ... , a_n ( 1 <= a_i <= n ) -- the elements of the array a . All elements of the a array are distinct numbers. It is guaranteed that the sum of the values n over all test cases in the test does not exceed 2 cdot10^5 . Print t lines, each of the lines must contain the answer to the corresponding set of input data: numbers p_1, p_2, ... , p_n -- any of the possible initial values of the array p , which will lead to the given array a . All elements of p are distinct integers from 1 to n . Thus, if there are several solutions, print "...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
136948949 ssvb C Nov. 25, 2021, 10:36 p.m. OK D TESTS 10 78 13516800 1000
136977699 Tanish-kumar C Nov. 26, 2021, 8:34 a.m. OK GNU C11 TESTS 10 77 819200 1000
136981513 LittleNewb C Nov. 26, 2021, 9:22 a.m. OK GNU C11 TESTS 10 811 819200 1000
136981092 LittleNewb C Nov. 26, 2021, 9:16 a.m. OK GNU C11 TESTS 10 811 819200 1000
136981316 LittleNewb C Nov. 26, 2021, 9:19 a.m. OK GNU C11 TESTS 10 811 819200 1000
136960026 Youarenotgood C Nov. 26, 2021, 4:21 a.m. OK GNU C11 TESTS 10 811 819200 1000
136977703 LittleNewb C Nov. 26, 2021, 8:35 a.m. OK GNU C11 TESTS 10 826 1638400 1000
136981815 LittleNewb C Nov. 26, 2021, 9:26 a.m. OK GNU C11 TESTS 10 842 819200 1000
136950848 parthu C Nov. 26, 2021, 12:12 a.m. OK GNU C11 TESTS 10 888 18432000 1000
137047125 zxc190930 C Nov. 26, 2021, 2:39 p.m. OK GNU C++14 TESTS 10 46 2662400 1000
137076556 ling_liu C Nov. 27, 2021, 12:57 a.m. OK GNU C++14 TESTS 10 46 5017600 1000
136974902 XyzL C Nov. 26, 2021, 8:01 a.m. OK GNU C++14 TESTS 10 46 11468800 1000
137079943 XyzL C Nov. 27, 2021, 2:41 a.m. OK GNU C++14 TESTS 10 46 11468800 1000
137042276 SEminer C Nov. 26, 2021, 1:57 p.m. OK GNU C++14 TESTS 10 62 819200 1000
136957057 zweix C Nov. 26, 2021, 3:16 a.m. OK GNU C++14 TESTS 10 62 5017600 1000
137052983 shreyasshetty788 C Nov. 26, 2021, 3:47 p.m. OK GNU C++14 TESTS 10 77 819200 1000
136987085 kopaljain03 C Nov. 26, 2021, 10:39 a.m. OK GNU C++14 TESTS 10 77 819200 1000
137088240 zhangshaojia C Nov. 27, 2021, 5:16 a.m. OK GNU C++14 TESTS 10 77 819200 1000
137070954 ahmeteren C Nov. 26, 2021, 8:51 p.m. OK GNU C++14 TESTS 10 77 819200 1000
136955199 kumonoEkko C Nov. 26, 2021, 2:34 a.m. OK GNU C++17 TESTS 10 46 2560000 1000
136957613 Bakti-Tuymehan-abai-2025 C Nov. 26, 2021, 3:28 a.m. OK GNU C++17 TESTS 10 46 2867200 1000
136936304 saifur_shamim C Nov. 25, 2021, 6:05 p.m. OK GNU C++17 TESTS 10 62 819200 1000
137082576 proverbs1_7 C Nov. 27, 2021, 3:38 a.m. OK GNU C++17 TESTS 10 62 819200 1000
136958864 aka899 C Nov. 26, 2021, 3:55 a.m. OK GNU C++17 TESTS 10 62 2048000 1000
137079278 JustJie C Nov. 27, 2021, 2:25 a.m. OK GNU C++17 TESTS 10 77 819200 1000
137057838 vishal00923 C Nov. 26, 2021, 4:54 p.m. OK GNU C++17 TESTS 10 77 819200 1000
137039478 _ankitkumar_ C Nov. 26, 2021, 1:28 p.m. OK GNU C++17 TESTS 10 77 819200 1000
137022128 XAiM C Nov. 26, 2021, 12:26 p.m. OK GNU C++17 TESTS 10 77 819200 1000
137046270 Blackbeard99 C Nov. 26, 2021, 2:31 p.m. OK GNU C++17 TESTS 10 77 819200 1000
136977519 ricar0 C Nov. 26, 2021, 8:33 a.m. OK GNU C++17 (64) TESTS 10 46 819200 1000
136989410 rgnerdplayer C Nov. 26, 2021, 11:11 a.m. OK GNU C++17 (64) TESTS 10 46 819200 1000
136956920 incogn1to C Nov. 26, 2021, 3:13 a.m. OK GNU C++17 (64) TESTS 10 46 1740800 1000
136959431 qdd C Nov. 26, 2021, 4:08 a.m. OK GNU C++17 (64) TESTS 10 61 819200 1000
136952003 17821147 C Nov. 26, 2021, 12:59 a.m. OK GNU C++17 (64) TESTS 10 61 819200 1000
136951876 khanh_np C Nov. 26, 2021, 12:55 a.m. OK GNU C++17 (64) TESTS 10 61 819200 1000
136938547 cladzen C Nov. 25, 2021, 6:35 p.m. OK GNU C++17 (64) TESTS 10 61 819200 1000
136968338 namdata4920 C Nov. 26, 2021, 6:35 a.m. OK GNU C++17 (64) TESTS 10 61 1638400 1000
137006849 shivankar_p C Nov. 26, 2021, 11:44 a.m. OK GNU C++17 (64) TESTS 10 61 1638400 1000
137035822 SA01 C Nov. 26, 2021, 1:08 p.m. OK GNU C++17 (64) TESTS 10 61 1638400 1000
136936892 master._.mind C Nov. 25, 2021, 6:12 p.m. OK GNU C++20 (64) TESTS 10 31 1638400 1000
136989277 Anisur_rahaman C Nov. 26, 2021, 11:09 a.m. OK GNU C++20 (64) TESTS 10 46 819200 1000
136984975 737 C Nov. 26, 2021, 10:09 a.m. OK GNU C++20 (64) TESTS 10 46 819200 1000
136983390 wowsuchempty C Nov. 26, 2021, 9:46 a.m. OK GNU C++20 (64) TESTS 10 46 819200 1000
137077171 Ibrahim-Elsayed C Nov. 27, 2021, 1:22 a.m. OK GNU C++20 (64) TESTS 10 46 819200 1000
137083772 anandk543 C Nov. 27, 2021, 4:06 a.m. OK GNU C++20 (64) TESTS 10 46 819200 1000
137074638 josephl. C Nov. 26, 2021, 11:16 p.m. OK GNU C++20 (64) TESTS 10 46 819200 1000
137069777 sabbir_063 C Nov. 26, 2021, 8:20 p.m. OK GNU C++20 (64) TESTS 10 46 819200 1000
137069052 I_Remember_Olya_ashmelev C Nov. 26, 2021, 8:02 p.m. OK GNU C++20 (64) TESTS 10 46 819200 1000
137040356 bonopo C Nov. 26, 2021, 1:44 p.m. OK GNU C++20 (64) TESTS 10 46 819200 1000
136972291 120405217 C Nov. 26, 2021, 7:25 a.m. OK Go TESTS 10 655 2969600 1000
136966817 mohdasim2808 C Nov. 26, 2021, 6:16 a.m. OK Java 11 TESTS 10 217 4300800 1000
136979669 Sarvjeet619 C Nov. 26, 2021, 8:58 a.m. OK Java 11 TESTS 10 218 0 1000
136980096 md2076379 C Nov. 26, 2021, 9:03 a.m. OK Java 11 TESTS 10 218 25088000 1000
136944323 amanpatel23 C Nov. 25, 2021, 8:17 p.m. OK Java 11 TESTS 10 233 0 1000
136953334 yaminote C Nov. 26, 2021, 1:43 a.m. OK Java 11 TESTS 10 233 0 1000
136965338 Yash9890 C Nov. 26, 2021, 5:55 a.m. OK Java 11 TESTS 10 234 2150400 1000
136979214 nirmal_8 C Nov. 26, 2021, 8:52 a.m. OK Java 11 TESTS 10 249 0 1000
136972877 sumitchavan C Nov. 26, 2021, 7:33 a.m. OK Java 11 TESTS 10 249 0 1000
136946479 solo07 C Nov. 25, 2021, 9:08 p.m. OK Java 11 TESTS 10 249 0 1000
137087843 dhruvil_8803 C Nov. 27, 2021, 5:11 a.m. OK Java 11 TESTS 10 264 0 1000
136982968 Milex C Nov. 26, 2021, 9:41 a.m. OK Java 8 TESTS 10 140 2867200 1000
136959333 ljc1113 C Nov. 26, 2021, 4:05 a.m. OK Java 8 TESTS 10 155 4608000 1000
137044872 sedenion C Nov. 26, 2021, 2:18 p.m. OK Java 8 TESTS 10 171 0 1000
137037849 ChiMasterBing C Nov. 26, 2021, 1:13 p.m. OK Java 8 TESTS 10 171 2867200 1000
136987054 ssingh0271 C Nov. 26, 2021, 10:39 a.m. OK Java 8 TESTS 10 186 3686400 1000
136941731 omar_mohammed C Nov. 25, 2021, 7:25 p.m. OK Java 8 TESTS 10 187 1945600 1000
136982549 Milex C Nov. 26, 2021, 9:35 a.m. OK Java 8 TESTS 10 187 2764800 1000
136989409 Hasib_Ullah C Nov. 26, 2021, 11:11 a.m. OK Java 8 TESTS 10 187 2867200 1000
136955569 apald C Nov. 26, 2021, 2:43 a.m. OK Java 8 TESTS 10 233 6553600 1000
137047177 ayafayed C Nov. 26, 2021, 2:39 p.m. OK Java 8 TESTS 10 342 14131200 1000
136938567 wbars C Nov. 25, 2021, 6:35 p.m. OK Kotlin 1.4 TESTS 10 514 10956800 1000
136937021 paulviaz C Nov. 25, 2021, 6:14 p.m. OK Kotlin 1.5 TESTS 10 436 16384000 1000
137027329 zhangpengpeng C Nov. 26, 2021, 12:42 p.m. OK MS C++ 2017 TESTS 10 202 819200 1000
136976483 Mathdude123 C Nov. 26, 2021, 8:21 a.m. OK MS C++ 2017 TESTS 10 265 819200 1000
136954986 sgly33 C Nov. 26, 2021, 2:29 a.m. OK MS C++ 2017 TESTS 10 280 1638400 1000
136980358 xMartina C Nov. 26, 2021, 9:06 a.m. OK MS C++ 2017 TESTS 10 1544 2355200 1000
136960043 KumaTachiRen C Nov. 26, 2021, 4:21 a.m. OK .NET Core C# TESTS 10 139 56832000 1000
137087864 nikitakaralyus C Nov. 27, 2021, 5:11 a.m. OK .NET Core C# TESTS 10 748 27955200 1000
136935543 prachir1501 C Nov. 25, 2021, 5:55 p.m. OK PyPy 3 TESTS 10 187 20992000 1000
136989053 RED--1 C Nov. 26, 2021, 11:06 a.m. OK PyPy 3 TESTS 10 202 20684800 1000
136956973 Huntersoulz C Nov. 26, 2021, 3:14 a.m. OK PyPy 3 TESTS 10 249 19046400 1000
136988571 RED--1 C Nov. 26, 2021, 10:59 a.m. OK PyPy 3 TESTS 10 265 22118400 1000
136959298 kals C Nov. 26, 2021, 4:05 a.m. OK PyPy 3 TESTS 10 311 21913600 1000
136974315 ilya67-67 C Nov. 26, 2021, 7:53 a.m. OK PyPy 3 TESTS 10 342 19251200 1000
136966927 anupam_sudh C Nov. 26, 2021, 6:17 a.m. OK PyPy 3 TESTS 10 373 17920000 1000
136980847 lochinbek08_08 C Nov. 26, 2021, 9:13 a.m. OK PyPy 3 TESTS 10 373 19353600 1000
136937268 feysel_mubarek C Nov. 25, 2021, 6:18 p.m. OK PyPy 3 TESTS 10 374 13721600 1000
136980683 ps_12 C Nov. 26, 2021, 9:11 a.m. OK PyPy 3 TESTS 10 374 23756800 1000
136942774 nitish420 C Nov. 25, 2021, 7:45 p.m. OK PyPy 3-64 TESTS 10 171 28979200 1000
136984978 lemiao12 C Nov. 26, 2021, 10:09 a.m. OK PyPy 3-64 TESTS 10 187 29081600 1000
136939672 lemiao12 C Nov. 25, 2021, 6:52 p.m. OK PyPy 3-64 TESTS 10 233 29286400 1000
136942443 nitish420 C Nov. 25, 2021, 7:38 p.m. OK PyPy 3-64 TESTS 10 233 29388800 1000
136936632 bjy C Nov. 25, 2021, 6:09 p.m. OK PyPy 3-64 TESTS 10 264 24268800 1000
136971342 minasiealemu C Nov. 26, 2021, 7:13 a.m. OK PyPy 3-64 TESTS 10 296 20172800 1000
136943806 kl.nei C Nov. 25, 2021, 8:07 p.m. OK PyPy 3-64 TESTS 10 327 29286400 1000
137062915 vale46 C Nov. 26, 2021, 6:06 p.m. OK PyPy 3-64 TESTS 10 343 31232000 1000
136985680 nicku123 C Nov. 26, 2021, 10:19 a.m. OK PyPy 3-64 TESTS 10 358 27545600 1000
137044382 Mystic_heap C Nov. 26, 2021, 2:13 p.m. OK PyPy 3-64 TESTS 10 358 37171200 1000
136935537 OLOGY C Nov. 25, 2021, 5:55 p.m. OK Python 2 TESTS 10 171 13721600 1000
137074900 Vssca C Nov. 26, 2021, 11:31 p.m. OK Python 3 TESTS 10 124 11980800 1000
136980853 Kas-S C Nov. 26, 2021, 9:13 a.m. OK Python 3 TESTS 10 155 14643200 1000
137032731 NS3081992 C Nov. 26, 2021, 12:59 p.m. OK Python 3 TESTS 10 155 15667200 1000
137017398 YMSeah C Nov. 26, 2021, 12:12 p.m. OK Python 3 TESTS 10 202 13824000 1000
137061314 matislu C Nov. 26, 2021, 5:42 p.m. OK Python 3 TESTS 10 249 14336000 1000
136936629 eugalt C Nov. 25, 2021, 6:09 p.m. OK Python 3 TESTS 10 265 10854400 1000
137043193 swapnil_12 C Nov. 26, 2021, 2:02 p.m. OK Python 3 TESTS 10 280 10854400 1000
136936478 eugalt C Nov. 25, 2021, 6:07 p.m. OK Python 3 TESTS 10 280 11673600 1000
136989151 GoodFella C Nov. 26, 2021, 11:07 a.m. OK Python 3 TESTS 10 295 13824000 1000
137038948 dawityonas010 C Nov. 26, 2021, 1:18 p.m. OK Python 3 TESTS 10 295 14540800 1000
136944351 sansen C Nov. 25, 2021, 8:18 p.m. OK Rust TESTS 10 31 7987200 1000
136938681 g13 C Nov. 25, 2021, 6:37 p.m. OK Rust TESTS 10 46 14540800 1000
136935649 g13 C Nov. 25, 2021, 5:56 p.m. OK Rust TESTS 10 46 14540800 1000

remove filters

Back to search problems