Codeforces Round 636 (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
1343 Codeforces Round 636 (Div. 3) FINISHED False 7200 144343499 April 21, 2020, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1272 ) F Restore the Permutation by Sorted Segments PROGRAMMING brute force constructive algorithms data structures greedy implementation 2800

B'We guessed a permutation p consisting of n integers. The permutation of length n is the array of length n where each element from 1 to n appears exactly once. This permutation is a secret for you. For each position r from 2 to n we chose some other index l ( l < r ) and gave you the segment p_l, p_{l + 1}, ... , p_r in sorted order (i.e. we rearranged the elements of this segment in a way that the elements of this segment are sorted). Thus, you are given exactly n-1 segments of the initial permutation but elements inside each segment are sorted. The segments are given to you in random order. For example, if the secret permutation is p=[3, 1, 4, 6, 2, 5] then the possible given set of segments can be: Your task is to find any suitable permutation (i.e. any permutation corresponding to the given input data). It is guaranteed that the input data corresponds to some permutation (i.e. such permutation exists). You have to answer t independent test cases. The first line of the input contains one integer t ( 1 <= t <= 100 ) -- the number of test cases. Then t test cases follow. The first line of the test case contains one integer n ( 2 <= n <= 200 ) -- the length of the permutation. The next n-1 lines describe given segments. The i -th line contains the description of the i -th segment. The line starts with the integer k_i ( 2 <= k_i <= n ) -- the length of the i -th segment. Then k_i integers follow. All integers in a line are distinct, sorted in ascending order, between 1 and n , inclusive. It is guaranteed that the required p exists for each test case. It is also guaranteed that the sum of n over all test cases does not exceed 200 ( sum n <= 200 ). For each test case, print the answer: n integers p_1, p_2, ... , p_n ( 1 <= p_i <= n , all p_i s'...

Tutorials

76352

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
77563192 Gassa F April 21, 2020, 4:28 p.m. OK D TESTS 39 31 0 2800
77598405 wygz F April 22, 2020, 12:49 a.m. OK GNU C++11 TESTS 39 31 0 2800
77573117 yang12138 F April 21, 2020, 5:06 p.m. OK GNU C++11 TESTS 39 31 0 2800
77871122 Lonely666 F April 24, 2020, 3:39 a.m. OK GNU C++11 TESTS 40 31 102400 2800
77875290 pseudo F April 24, 2020, 4:45 a.m. OK GNU C++11 TESTS 40 31 204800 2800
77874765 pseudo F April 24, 2020, 4:37 a.m. OK GNU C++11 TESTS 40 31 204800 2800
77633424 Shaad7 F April 22, 2020, 10:28 a.m. OK GNU C++11 TESTS 39 31 204800 2800
77572560 skywalkert F April 21, 2020, 5:02 p.m. OK GNU C++11 TESTS 39 31 204800 2800
77687551 askdfjlas F April 22, 2020, 6:57 p.m. OK GNU C++11 TESTS 40 31 307200 2800
77622175 superbigjuruo F April 22, 2020, 8:21 a.m. OK GNU C++11 TESTS 39 31 307200 2800
77602015 ajpiano F April 22, 2020, 2:35 a.m. OK GNU C++11 TESTS 39 31 307200 2800
77575702 kmjp F April 21, 2020, 5:30 p.m. OK GNU C++14 TESTS 39 30 307200 2800
77563700 Potassium F April 21, 2020, 4:29 p.m. OK GNU C++14 TESTS 39 30 409600 2800
77939445 Dachim14 F April 24, 2020, 5:04 p.m. OK GNU C++14 TESTS 40 31 0 2800
77691242 qwertzz F April 22, 2020, 7:50 p.m. OK GNU C++14 TESTS 40 31 0 2800
77601567 heyuhhh F April 22, 2020, 2:23 a.m. OK GNU C++14 TESTS 39 31 204800 2800
77599388 SemonChan F April 22, 2020, 1:19 a.m. OK GNU C++14 TESTS 39 31 204800 2800
77599061 Turkey F April 22, 2020, 1:09 a.m. OK GNU C++14 TESTS 39 31 204800 2800
77867037 TadijaSebez F April 24, 2020, 2:22 a.m. OK GNU C++14 TESTS 40 31 307200 2800
77584382 Devil F April 21, 2020, 7:16 p.m. OK GNU C++14 TESTS 39 31 307200 2800
77583746 Devil F April 21, 2020, 7:07 p.m. OK GNU C++14 TESTS 39 31 307200 2800
77741662 Phoenix1369 F April 23, 2020, 10:49 a.m. OK GNU C++17 TESTS 40 31 0 2800
77739556 Phoenix1369 F April 23, 2020, 10:25 a.m. OK GNU C++17 TESTS 40 31 0 2800
77739458 Phoenix1369 F April 23, 2020, 10:24 a.m. OK GNU C++17 TESTS 40 31 0 2800
77736964 Phoenix1369 F April 23, 2020, 9:54 a.m. OK GNU C++17 TESTS 40 31 0 2800
77733157 Phoenix1369 F April 23, 2020, 9:26 a.m. OK GNU C++17 TESTS 40 31 0 2800
77694667 Phoenix1369 F April 22, 2020, 8:45 p.m. OK GNU C++17 TESTS 40 31 0 2800
77623955 zufius F April 22, 2020, 8:40 a.m. OK GNU C++17 TESTS 39 31 0 2800
77985905 unused F April 25, 2020, 6:58 a.m. OK GNU C++17 TESTS 40 31 204800 2800
77938260 liupo F April 24, 2020, 4:49 p.m. OK GNU C++17 TESTS 40 31 204800 2800
77875711 pseudo F April 24, 2020, 4:51 a.m. OK GNU C++17 TESTS 40 31 204800 2800
77634237 nweeks F April 22, 2020, 10:37 a.m. OK GNU C++17 (64) TESTS 39 30 307200 2800
77597301 sharrad99 F April 22, 2020, 12:11 a.m. OK GNU C++17 (64) TESTS 39 30 307200 2800
77585607 Hyado F April 21, 2020, 7:35 p.m. OK GNU C++17 (64) TESTS 39 31 102400 2800
77895694 dlz666 F April 24, 2020, 8:56 a.m. OK GNU C++17 (64) TESTS 40 31 204800 2800
77703753 UniverseofHK F April 23, 2020, 1:27 a.m. OK GNU C++17 (64) TESTS 40 31 204800 2800
77597928 WZYYN F April 22, 2020, 12:32 a.m. OK GNU C++17 (64) TESTS 39 31 204800 2800
77579107 Fortin F April 21, 2020, 6:07 p.m. OK GNU C++17 (64) TESTS 39 31 204800 2800
77575372 compute F April 21, 2020, 5:27 p.m. OK GNU C++17 (64) TESTS 39 31 204800 2800
77574427 szechuan_sauce F April 21, 2020, 5:18 p.m. OK GNU C++17 (64) TESTS 39 31 204800 2800
77599295 jyf111 F April 22, 2020, 1:16 a.m. OK GNU C++17 (64) TESTS 39 31 307200 2800
77564236 uwi F April 21, 2020, 4:30 p.m. OK Java 11 TESTS 39 202 0 2800
77589559 Dukkha F April 21, 2020, 8:40 p.m. OK Java 11 TESTS 39 249 0 2800
77928701 Anonymous F April 24, 2020, 3:20 p.m. OK Java 11 TESTS 40 311 0 2800
77701657 TheSawan F April 23, 2020, 12:06 a.m. OK Java 11 TESTS 40 436 0 2800
77658013 polyakoff F April 22, 2020, 2:09 p.m. OK Java 8 TESTS 39 171 102400 2800
77658142 polyakoff F April 22, 2020, 2:10 p.m. OK Java 8 TESTS 39 186 0 2800
77657424 polyakoff F April 22, 2020, 2:04 p.m. OK Java 8 TESTS 39 187 102400 2800
77569397 martins F April 21, 2020, 4:42 p.m. OK Java 8 TESTS 39 202 0 2800
77625557 StayAwayFromBitches F April 22, 2020, 8:58 a.m. OK Java 8 TESTS 39 217 0 2800
77622345 rr459595 F April 22, 2020, 8:23 a.m. OK Java 8 TESTS 39 233 0 2800
77739550 reborn.chris F April 23, 2020, 10:25 a.m. OK Java 8 TESTS 40 265 0 2800
77564246 DanielW48 F April 21, 2020, 4:30 p.m. OK Java 8 TESTS 39 265 0 2800
77732383 PizzaLovers007 F April 23, 2020, 9:17 a.m. OK Java 8 TESTS 40 327 0 2800
77990575 an09mous F April 25, 2020, 7:50 a.m. OK Java 8 TESTS 40 452 0 2800
77662279 Spheniscine F April 22, 2020, 2:48 p.m. OK Kotlin TESTS 40 343 1740800 2800
77574216 pichulia F April 21, 2020, 5:16 p.m. OK MS C++ 2017 TESTS 39 31 307200 2800
77585746 CrashMaster F April 21, 2020, 7:37 p.m. OK MS C++ 2017 TESTS 39 186 614400 2800
77689888 DmitryZ F April 22, 2020, 7:29 p.m. OK MS C++ 2017 TESTS 40 217 1536000 2800
77561495 pajenegod F April 21, 2020, 4:25 p.m. OK PyPy 2 TESTS 39 249 4505600 2800
77600694 ikatakos F April 22, 2020, 1:57 a.m. OK PyPy 3 TESTS 39 202 2662400 2800
77582623 throwawayatcoder F April 21, 2020, 6:51 p.m. OK PyPy 3 TESTS 39 234 4710400 2800
77682080 aberent F April 22, 2020, 5:57 p.m. OK PyPy 3 TESTS 40 249 6553600 2800
77606816 sayeedt F April 22, 2020, 4:33 a.m. OK PyPy 3 TESTS 39 592 16384000 2800
77918101 UD_xlinsist F April 24, 2020, 1:51 p.m. OK PyPy 3 TESTS 40 716 12800000 2800
77568265 titia F April 21, 2020, 4:36 p.m. OK PyPy 3 TESTS 39 732 11264000 2800
77601352 ikatakos F April 22, 2020, 2:17 a.m. OK Python 3 TESTS 39 124 1638400 2800
77601272 ikatakos F April 22, 2020, 2:14 a.m. OK Python 3 TESTS 39 124 1638400 2800
77583121 maximpetrov F April 21, 2020, 6:58 p.m. OK Python 3 TESTS 39 139 1740800 2800
77602658 mkawa2 F April 22, 2020, 2:55 a.m. OK Python 3 TESTS 39 280 1638400 2800
77627876 agarus F April 22, 2020, 9:25 a.m. OK Python 3 TESTS 39 295 2150400 2800

remove filters

Back to search problems