Codeforces Round 759 (Div. 2, based on 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
1591 Codeforces Round 759 (Div. 2, based on Technocup 2022 Elimination Round 3) FINISHED False 7200 97857863 Dec. 12, 2021, 3:15 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1410 ) D Yet Another Sorting Problem PROGRAMMING data structures math sortings

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
138925622 eastnman D Dec. 12, 2021, 5:55 p.m. OK Delphi TESTS 21 202 16179200
138914287 ruban D Dec. 12, 2021, 4:49 p.m. OK Delphi TESTS 21 405 223129600
138915036 Mrgglock D Dec. 12, 2021, 4:51 p.m. OK GNU C11 TESTS 21 218 10035200
138946644 PhaiCoGiaiQuocGia D Dec. 13, 2021, 3:24 a.m. OK GNU C++14 TESTS 21 124 2457600
138952956 t98slider D Dec. 13, 2021, 5:47 a.m. OK GNU C++14 TESTS 21 124 4300800
138907258 peiwenjun D Dec. 12, 2021, 4:26 p.m. OK GNU C++14 TESTS 21 124 4505600
138945699 ZeroBlast D Dec. 13, 2021, 2:55 a.m. OK GNU C++14 TESTS 21 124 4505600
138915267 shengtongtong D Dec. 12, 2021, 4:52 p.m. OK GNU C++14 TESTS 21 124 6041600
138951116 XueYJ D Dec. 13, 2021, 5:12 a.m. OK GNU C++14 TESTS 21 124 6041600
138926897 _mr__robot_ D Dec. 12, 2021, 6:07 p.m. OK GNU C++14 TESTS 21 124 6144000
138912699 Andycraft D Dec. 12, 2021, 4:43 p.m. OK GNU C++14 TESTS 21 124 6451200
138952385 yihan106115 D Dec. 13, 2021, 5:36 a.m. OK GNU C++14 TESTS 21 124 7987200
138951264 Bananana. D Dec. 13, 2021, 5:14 a.m. OK GNU C++14 TESTS 21 139 6041600
138940081 tiago.napoli D Dec. 12, 2021, 10:36 p.m. OK GNU C++17 TESTS 21 124 3993600
138934870 aksayush D Dec. 12, 2021, 8:12 p.m. OK GNU C++17 TESTS 21 124 3993600
138924297 Moon_Quakes D Dec. 12, 2021, 5:47 p.m. OK GNU C++17 TESTS 21 124 3993600
138948219 baohiep D Dec. 13, 2021, 4:06 a.m. OK GNU C++17 TESTS 21 124 3993600
138941952 just_for_fun_ZIMA D Dec. 13, 2021, 12:08 a.m. OK GNU C++17 TESTS 21 124 4096000
138944042 ZI__MA D Dec. 13, 2021, 1:48 a.m. OK GNU C++17 TESTS 21 124 4096000
138922652 ikaurov D Dec. 12, 2021, 5:14 p.m. OK GNU C++17 TESTS 21 124 6041600
138905256 Yzm007 D Dec. 12, 2021, 4:23 p.m. OK GNU C++17 TESTS 21 124 6041600
138919012 arn200 D Dec. 12, 2021, 5:04 p.m. OK GNU C++17 TESTS 21 124 6041600
138924975 _Tima___ D Dec. 12, 2021, 5:50 p.m. OK GNU C++17 TESTS 21 124 6144000
138911050 kulmak41 D Dec. 12, 2021, 4:38 p.m. OK GNU C++17 (64) TESTS 21 77 4096000
138936775 UV3 D Dec. 12, 2021, 8:56 p.m. OK GNU C++17 (64) TESTS 21 77 7987200
138932456 fxhd D Dec. 12, 2021, 7:26 p.m. OK GNU C++17 (64) TESTS 21 78 4096000
138916946 YanLei D Dec. 12, 2021, 4:58 p.m. OK GNU C++17 (64) TESTS 21 78 6041600
138926833 Bit_Master_2205 D Dec. 12, 2021, 6:07 p.m. OK GNU C++17 (64) TESTS 21 78 7987200
138926583 taketwicek D Dec. 12, 2021, 6:04 p.m. OK GNU C++17 (64) TESTS 21 78 8192000
138929535 taketwicek D Dec. 12, 2021, 6:40 p.m. OK GNU C++17 (64) TESTS 21 78 8192000
138946015 YLWang D Dec. 13, 2021, 3:05 a.m. OK GNU C++17 (64) TESTS 21 78 24166400
138949478 xiaoziyao D Dec. 13, 2021, 4:36 a.m. OK GNU C++17 (64) TESTS 21 93 6041600
138949529 AnNotShy D Dec. 13, 2021, 4:38 a.m. OK GNU C++17 (64) TESTS 21 93 6041600
138920683 fizetik D Dec. 12, 2021, 5:09 p.m. OK GNU C++20 (64) TESTS 21 62 3993600
138917679 tiagoshibata D Dec. 12, 2021, 5 p.m. OK GNU C++20 (64) TESTS 21 77 2048000
138913647 WA_King D Dec. 12, 2021, 4:46 p.m. OK GNU C++20 (64) TESTS 21 77 3993600
138950602 Maango16 D Dec. 13, 2021, 5:01 a.m. OK GNU C++20 (64) TESTS 21 77 7987200
138953272 baddog D Dec. 13, 2021, 5:53 a.m. OK GNU C++20 (64) TESTS 21 78 3993600
138918402 Kregor D Dec. 12, 2021, 5:02 p.m. OK GNU C++20 (64) TESTS 21 78 3993600
138919416 Lavine D Dec. 12, 2021, 5:06 p.m. OK GNU C++20 (64) TESTS 21 78 6041600
138937604 _Body D Dec. 12, 2021, 9:16 p.m. OK GNU C++20 (64) TESTS 21 78 7987200
138914171 LightYear D Dec. 12, 2021, 4:48 p.m. OK GNU C++20 (64) TESTS 21 78 7987200
138924475 MoDiE D Dec. 12, 2021, 5:47 p.m. OK GNU C++20 (64) TESTS 21 78 8089600
138935402 podtelkin D Dec. 12, 2021, 8:23 p.m. OK Java 11 TESTS 21 311 8908800
138932623 YaduAhuja D Dec. 12, 2021, 7:29 p.m. OK Java 11 TESTS 21 420 31846400
138905568 bobib D Dec. 12, 2021, 4:24 p.m. OK Java 11 TESTS 21 436 32358400
138914972 Ste D Dec. 12, 2021, 4:51 p.m. OK Java 11 TESTS 21 436 51712000
138941410 DylanSmith D Dec. 12, 2021, 11:38 p.m. OK Java 11 TESTS 21 514 39936000
138937978 yudi23 D Dec. 12, 2021, 9:26 p.m. OK Java 11 TESTS 21 545 43520000
138933255 G.A.T.C D Dec. 12, 2021, 7:40 p.m. OK Java 11 TESTS 21 717 28364800
138918127 pimonster D Dec. 12, 2021, 5:01 p.m. OK Java 11 TESTS 21 779 42291200
138908778 _merlin_ D Dec. 12, 2021, 4:30 p.m. OK Java 11 TESTS 21 873 94003200
138924458 vm.smurf D Dec. 12, 2021, 5:47 p.m. OK Java 11 TESTS 21 904 82534400
138920874 phenomenal_98 D Dec. 12, 2021, 5:10 p.m. OK Java 8 TESTS 21 186 34099200
138910913 hu_tao D Dec. 12, 2021, 4:37 p.m. OK Java 8 TESTS 21 202 13824000
138918665 kamranm D Dec. 12, 2021, 5:03 p.m. OK Java 8 TESTS 21 280 48025600
138925599 invincible777 D Dec. 12, 2021, 5:55 p.m. OK Java 8 TESTS 21 374 25702400
138931719 kkkkush D Dec. 12, 2021, 7:13 p.m. OK Java 8 TESTS 21 389 39833600
138909290 O_E D Dec. 12, 2021, 4:32 p.m. OK Java 8 TESTS 21 483 34201600
138921008 honeysingh18 D Dec. 12, 2021, 5:10 p.m. OK Java 8 TESTS 21 623 35840000
138908989 bobbilyking D Dec. 12, 2021, 4:31 p.m. OK Java 8 TESTS 21 638 50995200
138914296 stevie1024 D Dec. 12, 2021, 4:49 p.m. OK Java 8 TESTS 21 654 52224000
138907797 thedesalizes D Dec. 12, 2021, 4:27 p.m. OK Java 8 TESTS 21 655 34406400
138948552 _Astron D Dec. 13, 2021, 4:13 a.m. OK Kotlin 1.4 TESTS 21 623 14745600
138945535 wuchaojie1097 D Dec. 13, 2021, 2:49 a.m. OK Kotlin 1.4 TESTS 21 982 41779200
138911217 Schullz D Dec. 12, 2021, 4:38 p.m. OK MS C++ 2017 TESTS 21 202 11878400
138914976 P___ D Dec. 12, 2021, 4:51 p.m. OK MS C++ 2017 TESTS 21 405 22118400
138930689 Eldies D Dec. 12, 2021, 6:56 p.m. OK MS C++ 2017 TESTS 21 467 6041600
138924754 Eldies D Dec. 12, 2021, 5:49 p.m. OK MS C++ 2017 TESTS 21 467 6041600
138930615 Eldies D Dec. 12, 2021, 6:55 p.m. OK MS C++ 2017 TESTS 21 467 7987200
138926700 Eldies D Dec. 12, 2021, 6:05 p.m. OK MS C++ 2017 TESTS 21 483 6041600
138910442 charleswang2001 D Dec. 12, 2021, 4:36 p.m. OK MS C++ 2017 TESTS 21 483 7987200
138932067 Eldies D Dec. 12, 2021, 7:19 p.m. OK MS C++ 2017 TESTS 21 483 8089600
138930261 Eldies D Dec. 12, 2021, 6:50 p.m. OK MS C++ 2017 TESTS 21 499 7987200
138927872 Eldies D Dec. 12, 2021, 6:18 p.m. OK MS C++ 2017 TESTS 21 514 6041600
138952883 Bambam_Shivam D Dec. 13, 2021, 5:46 a.m. OK PyPy 3 TESTS 21 451 44544000
138913499 mkawa2 D Dec. 12, 2021, 4:46 p.m. OK PyPy 3 TESTS 21 452 47616000
138931856 iimmortal D Dec. 12, 2021, 7:16 p.m. OK PyPy 3 TESTS 21 468 48640000
138911209 DBabichev D Dec. 12, 2021, 4:38 p.m. OK PyPy 3 TESTS 21 842 45977600
138905019 zii.hrs D Dec. 12, 2021, 4:22 p.m. OK PyPy 3 TESTS 21 920 103526400
138917273 mouryasatyam D Dec. 12, 2021, 4:59 p.m. OK PyPy 3 TESTS 21 951 245555200
138915282 Amiy_Tiwari D Dec. 12, 2021, 4:52 p.m. OK PyPy 3 TESTS 21 1107 48742400
138950088 singh.tarun.iit D Dec. 13, 2021, 4:51 a.m. OK PyPy 3 TESTS 21 1107 49459200
138911032 Moodymann D Dec. 12, 2021, 4:38 p.m. OK PyPy 3 TESTS 21 1201 45158400
138913267 woshigeshabi D Dec. 12, 2021, 4:45 p.m. OK PyPy 3 TESTS 21 1232 42393600
138949104 dutinmeow D Dec. 13, 2021, 4:28 a.m. OK PyPy 3-64 TESTS 21 311 57344000
138939795 codicon D Dec. 12, 2021, 10:25 p.m. OK PyPy 3-64 TESTS 21 327 57753600
138917825 plevande D Dec. 12, 2021, 5:01 p.m. OK PyPy 3-64 TESTS 21 452 55603200
138932995 lemiao12 D Dec. 12, 2021, 7:35 p.m. OK PyPy 3-64 TESTS 21 655 65638400
138935286 ctt312000 D Dec. 12, 2021, 8:20 p.m. OK PyPy 3-64 TESTS 21 779 54784000
138908108 ulyss D Dec. 12, 2021, 4:28 p.m. OK PyPy 3-64 TESTS 21 826 58368000
138920620 sanbada79 D Dec. 12, 2021, 5:09 p.m. OK PyPy 3-64 TESTS 21 998 66560000
138937085 stand_by D Dec. 12, 2021, 9:03 p.m. OK PyPy 3-64 TESTS 21 1060 57753600
138907621 _Temeraire D Dec. 12, 2021, 4:27 p.m. OK PyPy 3-64 TESTS 21 1076 55398400
138945941 conqueror_of_tourist D Dec. 13, 2021, 3:02 a.m. OK PyPy 3-64 TESTS 21 1793 49459200
138934678 OLOGY D Dec. 12, 2021, 8:07 p.m. OK Python 2 TESTS 21 436 30003200
138934353 OLOGY D Dec. 12, 2021, 8:01 p.m. OK Python 2 TESTS 21 483 26624000
138929938 OLOGY D Dec. 12, 2021, 6:45 p.m. OK Python 2 TESTS 21 1200 35020800
138910247 hopflink D Dec. 12, 2021, 4:35 p.m. OK Python 3 TESTS 21 1060 75571200
138944056 Trollium D Dec. 13, 2021, 1:49 a.m. OK Python 3 TESTS 21 1309 36352000
138916760 blueedge D Dec. 12, 2021, 4:57 p.m. OK Python 3 TESTS 21 1980 91648000
138926819 blueedge D Dec. 12, 2021, 6:06 p.m. OK Python 3 TESTS 21 1996 91648000
138920607 FakestAccount D Dec. 12, 2021, 5:09 p.m. OK Rust 2021 TESTS 21 467 33484800

remove filters

Back to search problems