Technocup 2022 - Elimination Round 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
1585 Technocup 2022 - Elimination Round 3 FINISHED False 7200 97944263 Dec. 12, 2021, 3:15 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 3924 ) D Yet Another Sorting Problem PROGRAMMING math

B'Petya has an array of integers a_1, a_2, ldots, a_n . He only likes sorted arrays. Unfortunately, the given array could be arbitrary, so Petya wants to sort it. Petya likes to challenge himself, so he wants to sort array using only 3 -cycles. More formally, in one operation he can pick 3 pairwise distinct indices i , j , and k ( 1 <= q i, j, k <= q n ) and apply i to j to k to i cycle to the array a . It simultaneously places a_i on position j , a_j on position k , and a_k on position i , without changing any other element. For example, if a is [10, 50, 20, 30, 40, 60] and he chooses i = 2 , j = 1 , k = 5 , then the array becomes [ underline{50}, underline{40}, 20, 30, underline{10}, 60] . Petya can apply arbitrary number of 3 -cycles (possibly, zero). You are to determine if Petya can sort his array a , i. e. make it non-decreasing. Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= q t <= q 5 cdot 10^5 ). Description of the test cases follows. The first line of each test case contains a single integer n ( 1 <= q n <= q 5 cdot 10^5 ) -- the length of the array a . The second line of each test case contains n integers a_1, a_2, ldots, a_n ( 1 <= q a_i <= q n ). It is guaranteed that the sum of n over all test cases does not exceed 5 cdot 10^5 . For each test case, print "YES" (without quotes) if Petya can sort the array a using 3 -cycles, and "NO" (without quotes) otherwise. You can print each letter in any case (upper or lower). In the 6 -th test case Petya can use the 3 -cycle 1 to 3 to 2 to 1 to sort the array. In the 7 -th test case Petya can apply 1 to 3 to 2 to 1 and make a = [1, 4, 2, 3] . Then he can apply 2 to 4 to 3 to 2 and finally sort the array. '...

Tutorials

Codeforces Round #759 (Div. 2, based on Technocup 2022 Elimination Round 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
138999519 Dorisxdn D Dec. 13, 2021, 3:25 p.m. OK GNU C++14 TESTS 21 124 6041600
138984680 Jame_Kuma D Dec. 13, 2021, 12:48 p.m. OK GNU C++14 TESTS 21 124 6041600
138895494 c0ldzy D Dec. 12, 2021, 3:57 p.m. OK GNU C++14 TESTS 21 187 6041600
138990248 prasoon054 D Dec. 13, 2021, 1:47 p.m. OK GNU C++14 TESTS 21 280 32358400
139024645 Max_Calincu D Dec. 13, 2021, 8:42 p.m. OK GNU C++14 TESTS 21 389 33075200
138895861 ilya.kligunov D Dec. 12, 2021, 3:58 p.m. OK GNU C++14 TESTS 21 451 10035200
139037796 a_manglani D Dec. 14, 2021, 3:55 a.m. OK GNU C++14 TESTS 21 452 64000000
138919470 Serious_Max D Dec. 12, 2021, 5:06 p.m. OK GNU C++14 TESTS 21 499 22118400
138915569 weak_kid D Dec. 12, 2021, 4:53 p.m. OK GNU C++14 TESTS 21 561 27238400
139020412 _chuoi_ D Dec. 13, 2021, 7:31 p.m. OK GNU C++14 TESTS 21 639 16076800
138973195 xicetab538 D Dec. 13, 2021, 10:46 a.m. OK GNU C++17 TESTS 21 124 2560000
139017646 CaptnBanana D Dec. 13, 2021, 6:51 p.m. OK GNU C++17 TESTS 21 124 4505600
138996150 CaptnBanana D Dec. 13, 2021, 2:48 p.m. OK GNU C++17 TESTS 21 124 4505600
138993886 TomAndJerryFan D Dec. 13, 2021, 2:24 p.m. OK GNU C++17 TESTS 21 139 4505600
139028874 Sekai02 D Dec. 13, 2021, 10:20 p.m. OK GNU C++17 TESTS 21 139 6041600
138996277 CaptnBanana D Dec. 13, 2021, 2:49 p.m. OK GNU C++17 TESTS 21 140 4505600
139007936 vinishthanai D Dec. 13, 2021, 4:53 p.m. OK GNU C++17 TESTS 21 140 7987200
139036138 thanh-nghia D Dec. 14, 2021, 3:08 a.m. OK GNU C++17 TESTS 21 155 7987200
139033256 butterfly-to-be D Dec. 14, 2021, 1:18 a.m. OK GNU C++17 TESTS 21 156 7987200
139034877 prodipdatta7 D Dec. 14, 2021, 2:26 a.m. OK GNU C++17 TESTS 21 171 6041600
139021321 AndreyPoyarkov D Dec. 13, 2021, 7:44 p.m. OK GNU C++17 (64) TESTS 21 218 11059200
138985954 alif_cse_ju D Dec. 13, 2021, 1:01 p.m. OK GNU C++17 (64) TESTS 21 233 28160000
138911007 HamletPetrosyan D Dec. 12, 2021, 4:38 p.m. OK GNU C++17 (64) TESTS 21 233 28569600
138912059 ShinigamiCHOP D Dec. 12, 2021, 4:41 p.m. OK GNU C++17 (64) TESTS 21 234 6348800
138920298 MDastan D Dec. 12, 2021, 5:08 p.m. OK GNU C++17 (64) TESTS 21 265 28160000
138893222 DDima D Dec. 12, 2021, 3:52 p.m. OK GNU C++17 (64) TESTS 21 295 22016000
138983102 renfei147 D Dec. 13, 2021, 12:32 p.m. OK GNU C++17 (64) TESTS 21 312 3993600
138991729 User_Carrot D Dec. 13, 2021, 2:02 p.m. OK GNU C++17 (64) TESTS 21 327 3993600
138918244 p0nc D Dec. 12, 2021, 5:02 p.m. OK GNU C++17 (64) TESTS 21 343 40140800
138905631 EZiganshin D Dec. 12, 2021, 4:24 p.m. OK GNU C++17 (64) TESTS 21 358 33792000
138918019 daniilzimin4 D Dec. 12, 2021, 5:01 p.m. OK GNU C++20 (64) TESTS 21 93 12083200
138896353 silvvasil D Dec. 12, 2021, 3:59 p.m. OK GNU C++20 (64) TESTS 21 156 8294400
138974351 welleyth D Dec. 13, 2021, 11 a.m. OK GNU C++20 (64) TESTS 21 217 41062400
139035669 mibig D Dec. 14, 2021, 2:54 a.m. OK GNU C++20 (64) TESTS 21 233 34201600
138905950 Renedyn D Dec. 12, 2021, 4:25 p.m. OK GNU C++20 (64) TESTS 21 265 32153600
138995462 Kiraashado D Dec. 13, 2021, 2:40 p.m. OK GNU C++20 (64) TESTS 21 311 30208000
138977845 danila_bohanov D Dec. 13, 2021, 11:40 a.m. OK GNU C++20 (64) TESTS 21 312 44441600
139018115 Wailydest D Dec. 13, 2021, 6:58 p.m. OK GNU C++20 (64) TESTS 21 374 2969600
138916770 pakman D Dec. 12, 2021, 4:57 p.m. OK GNU C++20 (64) TESTS 21 390 16384000
139024906 Yura_Salash D Dec. 13, 2021, 8:48 p.m. OK GNU C++20 (64) TESTS 21 390 44236800
138992945 Shuai. D Dec. 13, 2021, 2:14 p.m. OK MS C++ 2017 TESTS 21 265 20070400
138903097 SerZak D Dec. 12, 2021, 4:17 p.m. OK MS C++ 2017 TESTS 21 826 44236800
138999647 n.a.orlov D Dec. 13, 2021, 3:27 p.m. OK MS C++ 2017 TESTS 21 842 24064000
138985697 Sachin_Sain D Dec. 13, 2021, 12:59 p.m. OK PyPy 3 TESTS 21 1123 47820800
138922097 DortyTheGreat D Dec. 12, 2021, 5:13 p.m. OK PyPy 3 TESTS 21 1185 52121600
138919743 inverse_ackerman D Dec. 12, 2021, 5:07 p.m. OK Python 3 TESTS 21 998 50176000

remove filters

Back to search problems