Codeforces Global Round 20

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
1672 Codeforces Global Round 20 FINISHED False 10800 86543662 April 23, 2022, 2:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 3173 ) F1 Array Shuffling PROGRAMMING constructive algorithms graphs greedy 2000

B'oolimry has an array a of length n which he really likes. Today, you have changed his array to b , a permutation of a , to make him sad. Because oolimry is only a duck, he can only perform the following operation to restore his array: The sadness of the array b is the minimum number of operations needed to transform b into a . Given the array a , find any array b which is a permutation of a that has the maximum sadness over all permutations of the array a . Each test contains multiple test cases. The first line contains a single integer t ( 1 <= q t <= q 10^4 ) -- the number of test cases. The description of the test cases follows. The first line of each test case contains a single integer n ( 1 <= q n <= q 2 cdot 10^5 ) -- the length of the array. The second line of each test case contains n integers a_1, a_2, ldots, a_n ( 1 <= q a_i <= q n ) -- elements of the array a . It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case, print n integers b_1, b_2, ldots, b_n -- describing the array b . If there are multiple answers, you may print any. In the first test case, the array [1,2] has sadness 1 . We can transform [1,2] into [2,1] using one operation with (i,j)=(1,2) . In the second test case, the array [3,3,2,1] has sadness 2 . We can transform [3,3,2,1] into [1,2,3,3] with two operations with (i,j)=(1,4) and (i,j)=(2,3) respectively. '...

Tutorials

Global Round 20 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
154863860 rainboy F1 April 24, 2022, 2:45 p.m. OK GNU C11 TESTS 17 842 3174400 2000
154859805 win10 F1 April 24, 2022, 2:01 p.m. OK GNU C++14 TESTS 17 77 10342400 2000
154796473 AstralLing F1 April 23, 2022, 11:47 p.m. OK GNU C++14 TESTS 17 78 10342400 2000
154778727 mfctanzim_00 F1 April 23, 2022, 6:16 p.m. OK GNU C++14 TESTS 15 93 2457600 2000
154773922 Write_Hape_Code F1 April 23, 2022, 5:32 p.m. OK GNU C++14 TESTS 15 93 8192000 2000
154803820 Chinese_zjc_ F1 April 24, 2022, 3:11 a.m. OK GNU C++14 TESTS 17 93 8192000 2000
154890989 elgamalsalman F1 April 24, 2022, 9:17 p.m. OK GNU C++14 TESTS 17 108 5632000 2000
154832270 CunFu_ZhuGe F1 April 24, 2022, 9:29 a.m. OK GNU C++14 TESTS 17 108 7372800 2000
154824822 suyiheng F1 April 24, 2022, 8:09 a.m. OK GNU C++14 TESTS 17 108 8192000 2000
154880839 amunduzbaev F1 April 24, 2022, 6:11 p.m. OK GNU C++14 TESTS 17 109 10854400 2000
154869069 Jonothor_Darry F1 April 24, 2022, 3:40 p.m. OK GNU C++14 TESTS 17 109 31436800 2000
154803364 et3_tsy3.0 F1 April 24, 2022, 3 a.m. OK GNU C++17 TESTS 17 62 8294400 2000
154775927 I_love_Anya_Gorodilova F1 April 23, 2022, 5:47 p.m. OK GNU C++17 TESTS 15 78 5632000 2000
154903535 nvllable F1 April 25, 2022, 4:38 a.m. OK GNU C++17 TESTS 17 93 2457600 2000
154805435 Fairy_Tale F1 April 24, 2022, 3:45 a.m. OK GNU C++17 TESTS 17 93 7372800 2000
154775527 farmerboy F1 April 23, 2022, 5:44 p.m. OK GNU C++17 TESTS 15 93 8192000 2000
154791333 alex.y0675 F1 April 23, 2022, 9:34 p.m. OK GNU C++17 TESTS 17 93 11059200 2000
154806248 Mir_042 F1 April 24, 2022, 4:02 a.m. OK GNU C++17 TESTS 17 108 4812800 2000
154808540 Double_pipe_dream F1 April 24, 2022, 4:50 a.m. OK GNU C++17 TESTS 17 108 9011200 2000
154785766 se1ka2 F1 April 23, 2022, 7:55 p.m. OK GNU C++17 TESTS 15 108 9011200 2000
154877965 Lunasama F1 April 24, 2022, 5:28 p.m. OK GNU C++17 TESTS 17 108 9011200 2000
154838799 CE_WA_TLE F1 April 24, 2022, 10:47 a.m. OK GNU C++17 (64) TESTS 17 61 46387200 2000
154796993 AFOier F1 April 24, 2022, 12:02 a.m. OK GNU C++17 (64) TESTS 17 62 14131200 2000
154826995 MAOoo_Love_Molly F1 April 24, 2022, 8:33 a.m. OK GNU C++17 (64) TESTS 17 77 3276800 2000
154816607 DerekYeh F1 April 24, 2022, 6:38 a.m. OK GNU C++17 (64) TESTS 17 77 15257600 2000
154775550 Dog_food_is_me F1 April 23, 2022, 5:44 p.m. OK GNU C++17 (64) TESTS 15 77 16486400 2000
154812973 enslaved F1 April 24, 2022, 5:52 a.m. OK GNU C++17 (64) TESTS 17 78 12288000 2000
154774580 border F1 April 23, 2022, 5:36 p.m. OK GNU C++17 (64) TESTS 15 92 14848000 2000
154773633 Dig-Automaton F1 April 23, 2022, 5:30 p.m. OK GNU C++17 (64) TESTS 15 93 7987200 2000
154802944 Social_Zhao F1 April 24, 2022, 2:51 a.m. OK GNU C++17 (64) TESTS 17 93 9625600 2000
154812126 SmolBrain F1 April 24, 2022, 5:41 a.m. OK GNU C++17 (64) TESTS 17 93 9625600 2000
154830593 liqing F1 April 24, 2022, 9:10 a.m. OK GNU C++20 (64) TESTS 17 46 5632000 2000
154774604 Koosha_Mv F1 April 23, 2022, 5:37 p.m. OK GNU C++20 (64) TESTS 15 61 20275200 2000
154792604 tfg F1 April 23, 2022, 10:01 p.m. OK GNU C++20 (64) TESTS 17 62 2457600 2000
154812790 dofecorces F1 April 24, 2022, 5:50 a.m. OK GNU C++20 (64) TESTS 17 62 3276800 2000
154806047 Marslai24 F1 April 24, 2022, 3:58 a.m. OK GNU C++20 (64) TESTS 17 62 4812800 2000
154885103 Ivan_len F1 April 24, 2022, 7:25 p.m. OK GNU C++20 (64) TESTS 17 62 4812800 2000
154773918 Jonas01234500 F1 April 23, 2022, 5:32 p.m. OK GNU C++20 (64) TESTS 15 62 7987200 2000
154831574 minhnhatnoe F1 April 24, 2022, 9:21 a.m. OK GNU C++20 (64) TESTS 17 62 9728000 2000
154831061 Igor_2017 F1 April 24, 2022, 9:15 a.m. OK GNU C++20 (64) TESTS 17 62 10035200 2000
154811989 Neal_lee F1 April 24, 2022, 5:39 a.m. OK GNU C++20 (64) TESTS 17 62 10444800 2000
154839825 1364354238zxd F1 April 24, 2022, 10:59 a.m. OK Java 11 TESTS 17 373 18022400 2000
154780930 0124getU F1 April 23, 2022, 6:44 p.m. OK Java 11 TESTS 15 686 55398400 2000
154818151 profchi F1 April 24, 2022, 6:57 a.m. OK Java 11 TESTS 17 826 34099200 2000
154896413 ziduoyi F1 April 25, 2022, 1:21 a.m. OK Java 8 TESTS 17 373 18329600 2000
154774772 JunBinLiang F1 April 23, 2022, 5:38 p.m. OK Java 8 TESTS 15 577 34918400 2000
154776435 1_2_3_4_5_9 F1 April 23, 2022, 5:51 p.m. OK PyPy 2 TESTS 15 498 30003200 2000
154790851 hxu10 F1 April 23, 2022, 9:25 p.m. OK PyPy 3 TESTS 17 405 54579200 2000
154791369 hxu10 F1 April 23, 2022, 9:35 p.m. OK PyPy 3 TESTS 17 483 45158400 2000
154776693 tan_delhi F1 April 23, 2022, 5:54 p.m. OK PyPy 3 TESTS 15 763 50483200 2000
154814975 oadey89 F1 April 24, 2022, 6:18 a.m. OK PyPy 3-64 TESTS 17 296 52326400 2000
154825416 siganai F1 April 24, 2022, 8:16 a.m. OK PyPy 3-64 TESTS 17 561 71475200 2000
154779482 Skillful_Wanderer F1 April 23, 2022, 6:25 p.m. OK PyPy 3-64 TESTS 15 592 66560000 2000
154853140 _vjudge8 F1 April 24, 2022, 12:56 p.m. OK PyPy 3-64 TESTS 17 623 51097600 2000

remove filters

Back to search problems