Codeforces Round 624 (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
1311 Codeforces Round 624 (Div. 3) FINISHED False 7200 154797911 Feb. 24, 2020, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 19169 ) B WeirdSort PROGRAMMING dfs and similar sortings 1200

B'You are given an array a of length n . You are also given a set of distinct positions p_1, p_2, ... , p_m , where 1 <= p_i < n . The position p_i means that you can swap elements a[p_i] and a[p_i + 1] . You can apply this operation any number of times for each of the given positions. Your task is to determine if it is possible to sort the initial array in non-decreasing order ( a_1 <= a_2 <= ... <= a_n ) using only allowed swaps. For example, if a = [3, 2, 1] and p = [1, 2] , then we can first swap elements a[2] and a[3] (because position 2 is contained in the given set p ). We get the array a = [3, 1, 2] . Then we swap a[1] and a[2] (position 1 is also contained in p ). We get the array a = [1, 3, 2] . Finally, we swap a[2] and a[3] again and get the array a = [1, 2, 3] , sorted in non-decreasing order. You can see that if a = [4, 1, 2, 3] and p = [3, 2] then you cannot sort the array. 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 each test case contains two integers n and m ( 1 <= m < n <= 100 ) -- the number of elements in a and the number of elements in p . The second line of the test case contains n integers a_1, a_2, ... , a_n ( 1 <= a_i <= 100 ). The third line of the test case contains m integers p_1, p_2, ... , p_m ( 1 <= p_i < n , all p_i are distinct) -- the set of positions described in the problem statement. For each test case, print the answer -- "YES" (without quotes) if you can sort the initial array in non-decreasing order ( a_1 <= a_2 <= ... <= a_n ) using only allowed swaps. Otherwise, print "NO". '...

Tutorials

74224

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
71857443 Executed2211 B Feb. 25, 2020, 12:41 p.m. OK Clang++17 Diagnostics TESTS 12 93 0 1200
71857518 Executed2211 B Feb. 25, 2020, 12:42 p.m. OK Clang++17 Diagnostics TESTS 12 498 10547200 1200
71833489 ftiasch B Feb. 25, 2020, 4:20 a.m. OK D TESTS 12 30 0 1200
71777607 iica B Feb. 24, 2020, 2:49 p.m. OK D TESTS 12 31 102400 1200
71779687 daut-dlang B Feb. 24, 2020, 2:54 p.m. OK D TESTS 12 46 0 1200
71777473 ruban B Feb. 24, 2020, 2:49 p.m. OK Delphi TESTS 12 31 31436800 1200
71810961 PAG B Feb. 24, 2020, 4:48 p.m. OK FPC TESTS 12 15 819200 1200
71854862 Zef1611 B Feb. 25, 2020, 11:59 a.m. OK FPC TESTS 12 31 0 1200
71779349 Mike4235 B Feb. 24, 2020, 2:53 p.m. OK FPC TESTS 12 31 0 1200
71812429 namandeo B Feb. 24, 2020, 5:05 p.m. OK GNU C11 TESTS 12 15 0 1200
71866739 adnan_toky B Feb. 25, 2020, 3:02 p.m. OK GNU C11 TESTS 12 30 0 1200
71823320 kaiboy B Feb. 24, 2020, 8:51 p.m. OK GNU C11 TESTS 12 30 0 1200
71805181 codingking B Feb. 24, 2020, 4:18 p.m. OK GNU C11 TESTS 12 30 0 1200
71789636 -Historia- B Feb. 24, 2020, 3:20 p.m. OK GNU C11 TESTS 12 30 0 1200
71789205 doyoung0305 B Feb. 24, 2020, 3:19 p.m. OK GNU C11 TESTS 12 30 0 1200
71928487 sheraram B Feb. 26, 2020, 4:55 p.m. OK GNU C11 TESTS 12 31 0 1200
71871562 tawraat0187 B Feb. 25, 2020, 4:24 p.m. OK GNU C11 TESTS 12 31 0 1200
71807407 2000LJH2000 B Feb. 24, 2020, 4:27 p.m. OK GNU C11 TESTS 12 31 0 1200
71806237 akshat2808 B Feb. 24, 2020, 4:22 p.m. OK GNU C11 TESTS 12 31 0 1200
71923141 ydh B Feb. 26, 2020, 3:24 p.m. OK GNU C++11 TESTS 12 15 0 1200
71890504 rOhaS0rL4Q5 B Feb. 26, 2020, 1:56 a.m. OK GNU C++11 TESTS 12 15 0 1200
71890389 CrispyCommand B Feb. 26, 2020, 1:50 a.m. OK GNU C++11 TESTS 12 15 0 1200
71888800 glTeee B Feb. 26, 2020, 12:21 a.m. OK GNU C++11 TESTS 12 15 0 1200
71842219 xcs112358 B Feb. 25, 2020, 7:52 a.m. OK GNU C++11 TESTS 12 15 0 1200
71838346 NTTTT B Feb. 25, 2020, 6:30 a.m. OK GNU C++11 TESTS 12 15 0 1200
71808008 kinwat B Feb. 24, 2020, 4:29 p.m. OK GNU C++11 TESTS 12 15 0 1200
71803874 Maxliu B Feb. 24, 2020, 4:12 p.m. OK GNU C++11 TESTS 12 15 0 1200
71803448 ESPOX B Feb. 24, 2020, 4:10 p.m. OK GNU C++11 TESTS 12 15 0 1200
71801041 Aayush_2001 B Feb. 24, 2020, 4 p.m. OK GNU C++11 TESTS 12 15 0 1200
71855558 _grand B Feb. 25, 2020, 12:11 p.m. OK GNU C++14 TESTS 12 15 0 1200
71866904 carcar B Feb. 25, 2020, 3:04 p.m. OK GNU C++14 TESTS 12 15 0 1200
71869836 vjudge3 B Feb. 25, 2020, 3:54 p.m. OK GNU C++14 TESTS 12 15 0 1200
71871244 rush69 B Feb. 25, 2020, 4:18 p.m. OK GNU C++14 TESTS 12 15 0 1200
71889366 A_Jyo B Feb. 26, 2020, 12:54 a.m. OK GNU C++14 TESTS 12 15 0 1200
71901616 wanqiaoNO2 B Feb. 26, 2020, 8:08 a.m. OK GNU C++14 TESTS 12 15 0 1200
71919045 4ul_sharma B Feb. 26, 2020, 2:12 p.m. OK GNU C++14 TESTS 12 15 0 1200
71932289 sadia.csedu B Feb. 26, 2020, 6:07 p.m. OK GNU C++14 TESTS 12 15 0 1200
71935253 N0__0ne B Feb. 26, 2020, 7:11 p.m. OK GNU C++14 TESTS 12 15 0 1200
71946209 gerard.onats B Feb. 27, 2020, 2:06 a.m. OK GNU C++14 TESTS 12 15 0 1200
71945637 Fill_in B Feb. 27, 2020, 1:38 a.m. OK GNU C++17 TESTS 12 15 0 1200
71969837 logicroc B Feb. 27, 2020, 11:55 a.m. OK GNU C++17 TESTS 12 15 0 1200
71964506 the_belal B Feb. 27, 2020, 10:09 a.m. OK GNU C++17 TESTS 12 15 0 1200
71957762 paulthewineguy B Feb. 27, 2020, 7:51 a.m. OK GNU C++17 TESTS 12 15 0 1200
71934604 abishek_mondal B Feb. 26, 2020, 6:58 p.m. OK GNU C++17 TESTS 12 15 0 1200
71925146 suryansh38 B Feb. 26, 2020, 3:58 p.m. OK GNU C++17 TESTS 12 15 0 1200
71924768 H_J_Granger B Feb. 26, 2020, 3:52 p.m. OK GNU C++17 TESTS 12 15 0 1200
71923801 sanskar27jain B Feb. 26, 2020, 3:36 p.m. OK GNU C++17 TESTS 12 15 0 1200
71922389 vjudge3 B Feb. 26, 2020, 3:10 p.m. OK GNU C++17 TESTS 12 15 0 1200
71921617 andriy_zhuk B Feb. 26, 2020, 2:57 p.m. OK GNU C++17 TESTS 12 15 0 1200
71815652 aflexon B Feb. 24, 2020, 5:50 p.m. OK Go TESTS 12 31 0 1200
71813202 jaimatadiletsrock B Feb. 24, 2020, 5:14 p.m. OK Go TESTS 12 31 0 1200
71787004 snow_bear_328 B Feb. 24, 2020, 3:13 p.m. OK Go TESTS 12 31 0 1200
71840825 farmerboy B Feb. 25, 2020, 7:22 a.m. OK Go TESTS 12 217 0 1200
71941368 d0uch3b4g B Feb. 26, 2020, 10:04 p.m. OK Go TESTS 12 218 0 1200
71782045 j31d0 B Feb. 24, 2020, 3 p.m. OK Haskell TESTS 12 77 102400 1200
71881459 mr___hacker____ B Feb. 25, 2020, 7:45 p.m. OK Java 11 TESTS 12 170 0 1200
71797822 TheSawan B Feb. 24, 2020, 3:48 p.m. OK Java 11 TESTS 12 170 0 1200
71940148 yamen.haddad B Feb. 26, 2020, 9:19 p.m. OK Java 11 TESTS 12 171 0 1200
71913522 VinayVr B Feb. 26, 2020, 12:33 p.m. OK Java 11 TESTS 12 171 0 1200
71871057 Anonymous B Feb. 25, 2020, 4:15 p.m. OK Java 11 TESTS 12 171 0 1200
71863246 Azakarka B Feb. 25, 2020, 2:09 p.m. OK Java 11 TESTS 12 171 0 1200
71789869 aswals8991 B Feb. 24, 2020, 3:21 p.m. OK Java 11 TESTS 12 171 0 1200
71931661 asafiul B Feb. 26, 2020, 5:55 p.m. OK Java 11 TESTS 12 186 0 1200
71851477 girkarkshitij B Feb. 25, 2020, 11:03 a.m. OK Java 11 TESTS 12 186 0 1200
71840730 adamjamil B Feb. 25, 2020, 7:20 a.m. OK Java 11 TESTS 12 186 0 1200
71952720 dyhu083 B Feb. 27, 2020, 5:52 a.m. OK Java 8 TESTS 12 93 0 1200
71849705 Hasib_Ullah B Feb. 25, 2020, 10:28 a.m. OK Java 8 TESTS 12 108 0 1200
71811164 A5SAS51N B Feb. 24, 2020, 4:50 p.m. OK Java 8 TESTS 12 108 0 1200
71808352 vishal.a.burman23 B Feb. 24, 2020, 4:31 p.m. OK Java 8 TESTS 12 108 0 1200
71795701 _Tema_ B Feb. 24, 2020, 3:40 p.m. OK Java 8 TESTS 12 108 0 1200
71788704 maruthi12 B Feb. 24, 2020, 3:17 p.m. OK Java 8 TESTS 12 108 0 1200
71786655 shashwat07 B Feb. 24, 2020, 3:12 p.m. OK Java 8 TESTS 12 108 0 1200
71780625 liuhanguang B Feb. 24, 2020, 2:56 p.m. OK Java 8 TESTS 12 108 0 1200
71778814 a_2410 B Feb. 24, 2020, 2:52 p.m. OK Java 8 TESTS 12 108 0 1200
71938282 e_is_cool B Feb. 26, 2020, 8:24 p.m. OK Java 8 TESTS 12 109 0 1200
71813975 walborn B Feb. 24, 2020, 5:25 p.m. OK JavaScript TESTS 12 31 204800 1200
71782109 watarimaycry2 B Feb. 24, 2020, 3 p.m. OK JavaScript TESTS 12 61 819200 1200
71822449 jhonber B Feb. 24, 2020, 8:22 p.m. OK JavaScript TESTS 12 109 1331200 1200
71948287 Benq B Feb. 27, 2020, 3:25 a.m. OK Kotlin TESTS 12 124 0 1200
71777539 avm B Feb. 24, 2020, 2:49 p.m. OK Kotlin TESTS 12 124 0 1200
71814763 YESMAths B Feb. 24, 2020, 5:36 p.m. OK Kotlin TESTS 12 139 0 1200
71814829 YESMAths B Feb. 24, 2020, 5:37 p.m. OK Kotlin TESTS 12 140 0 1200
71814037 SlavaG B Feb. 24, 2020, 5:26 p.m. OK Kotlin TESTS 12 140 512000 1200
71914264 yakamoto B Feb. 26, 2020, 12:46 p.m. OK Kotlin TESTS 12 155 716800 1200
71780115 HanaYukii B Feb. 24, 2020, 2:55 p.m. OK Kotlin TESTS 12 156 0 1200
71787945 dkozak94 B Feb. 24, 2020, 3:15 p.m. OK Kotlin TESTS 12 170 204800 1200
71863556 Spheniscine B Feb. 25, 2020, 2:13 p.m. OK Kotlin TESTS 12 170 921600 1200
71868863 Heltion B Feb. 25, 2020, 3:37 p.m. OK Kotlin TESTS 12 170 1228800 1200
71810300 DanilaMaestro B Feb. 24, 2020, 4:41 p.m. OK Mono C# TESTS 12 46 1024000 1200
71843798 TRR B Feb. 25, 2020, 8:26 a.m. OK Mono C# TESTS 12 61 1024000 1200
71779993 T-D-K B Feb. 24, 2020, 2:55 p.m. OK Mono C# TESTS 12 61 4198400 1200
71784406 korntest B Feb. 24, 2020, 3:06 p.m. OK Mono C# TESTS 12 62 1024000 1200
71957788 suslov93 B Feb. 27, 2020, 7:51 a.m. OK Mono C# TESTS 12 62 4710400 1200
71792795 riantkb B Feb. 24, 2020, 3:30 p.m. OK Mono C# TESTS 12 62 5222400 1200
71787324 Anastasiya_Andreevna B Feb. 24, 2020, 3:14 p.m. OK Mono C# TESTS 12 77 3788800 1200
71790978 V.Gladin B Feb. 24, 2020, 3:24 p.m. OK Mono C# TESTS 12 78 5017600 1200
71799505 faxse B Feb. 24, 2020, 3:54 p.m. OK Mono C# TESTS 12 78 5529600 1200
71799899 geronimo00 B Feb. 24, 2020, 3:56 p.m. OK Mono C# TESTS 12 93 4812800 1200
71779799 leesiwon B Feb. 24, 2020, 2:54 p.m. OK MS C++ TESTS 12 15 0 1200
71785051 2xiaoapei B Feb. 24, 2020, 3:07 p.m. OK MS C++ TESTS 12 30 0 1200
71839632 vjudge1 B Feb. 25, 2020, 6:56 a.m. OK MS C++ TESTS 12 31 0 1200
71850213 licunchun2006 B Feb. 25, 2020, 10:39 a.m. OK MS C++ TESTS 12 31 0 1200
71786918 MambaMentality B Feb. 24, 2020, 3:13 p.m. OK MS C++ TESTS 12 31 0 1200
71783938 Yidaibajun B Feb. 24, 2020, 3:04 p.m. OK MS C++ TESTS 12 31 0 1200
71782401 godovald B Feb. 24, 2020, 3:01 p.m. OK MS C++ TESTS 12 31 0 1200
71859171 vjudge4 B Feb. 25, 2020, 1:08 p.m. OK MS C++ TESTS 12 31 0 1200
71829584 vjudge4 B Feb. 25, 2020, 1:49 a.m. OK MS C++ TESTS 12 31 0 1200
71816272 vjudge2 B Feb. 24, 2020, 6 p.m. OK MS C++ TESTS 12 31 0 1200
71836191 wangchenchen1 B Feb. 25, 2020, 5:38 a.m. OK MS C++ 2017 TESTS 12 15 307200 1200
71790833 kim_young_hyun B Feb. 24, 2020, 3:24 p.m. OK MS C++ 2017 TESTS 12 30 0 1200
71844456 Starak B Feb. 25, 2020, 8:41 a.m. OK MS C++ 2017 TESTS 12 30 0 1200
71795249 kjjgo35 B Feb. 24, 2020, 3:38 p.m. OK MS C++ 2017 TESTS 12 30 0 1200
71794910 529886336 B Feb. 24, 2020, 3:37 p.m. OK MS C++ 2017 TESTS 12 30 0 1200
71794794 refined B Feb. 24, 2020, 3:36 p.m. OK MS C++ 2017 TESTS 12 30 0 1200
71780435 Gravekper B Feb. 24, 2020, 2:56 p.m. OK MS C++ 2017 TESTS 12 30 307200 1200
71797048 bibibihhh B Feb. 24, 2020, 3:45 p.m. OK MS C++ 2017 TESTS 12 30 307200 1200
71930654 Seyber B Feb. 26, 2020, 5:35 p.m. OK MS C++ 2017 TESTS 12 31 0 1200
71954865 creativa B Feb. 27, 2020, 6:42 a.m. OK MS C++ 2017 TESTS 12 31 0 1200
71814477 klond90 B Feb. 24, 2020, 5:32 p.m. OK Node.js TESTS 12 155 2150400 1200
71791193 badawhite B Feb. 24, 2020, 3:25 p.m. OK Node.js TESTS 12 171 4198400 1200
71785887 deskata1997 B Feb. 24, 2020, 3:10 p.m. OK Node.js TESTS 12 202 4812800 1200
71781012 shivam1420 B Feb. 24, 2020, 2:57 p.m. OK Node.js TESTS 12 218 4403200 1200
71798702 EgorDjae B Feb. 24, 2020, 3:51 p.m. OK PascalABC.NET TESTS 12 342 307200 1200
71801832 Vladivostok B Feb. 24, 2020, 4:04 p.m. OK PascalABC.NET TESTS 12 421 0 1200
71902828 OrelHere B Feb. 26, 2020, 8:42 a.m. OK PascalABC.NET TESTS 12 655 512000 1200
71781249 denchik007orel57 B Feb. 24, 2020, 2:58 p.m. OK PascalABC.NET TESTS 12 655 512000 1200
71782358 rsFalse B Feb. 24, 2020, 3 p.m. OK Perl TESTS 12 498 0 1200
71909485 mayakin B Feb. 26, 2020, 11:14 a.m. OK PHP TESTS 12 31 409600 1200
71793125 erbolat0311 B Feb. 24, 2020, 3:31 p.m. OK PHP TESTS 12 186 0 1200
71787837 Bekzaat17 B Feb. 24, 2020, 3:15 p.m. OK PHP TESTS 12 546 0 1200
71841206 snape_here B Feb. 25, 2020, 7:30 a.m. OK PyPy 2 TESTS 12 124 921600 1200
71779965 rkstalker B Feb. 24, 2020, 2:55 p.m. OK PyPy 2 TESTS 12 139 921600 1200
71788994 bazzyadb B Feb. 24, 2020, 3:18 p.m. OK PyPy 2 TESTS 12 155 1433600 1200
71792248 abhigupta4 B Feb. 24, 2020, 3:28 p.m. OK PyPy 2 TESTS 12 170 819200 1200
71780501 anshuman16423 B Feb. 24, 2020, 2:56 p.m. OK PyPy 2 TESTS 12 202 1945600 1200
71781401 mudit B Feb. 24, 2020, 2:58 p.m. OK PyPy 3 TESTS 12 140 1740800 1200
71919951 vorzawk B Feb. 26, 2020, 2:28 p.m. OK PyPy 3 TESTS 12 155 1740800 1200
71864025 TimurABS B Feb. 25, 2020, 2:21 p.m. OK PyPy 3 TESTS 12 155 1740800 1200
71781591 uddeshya.singh B Feb. 24, 2020, 2:59 p.m. OK PyPy 3 TESTS 12 155 1740800 1200
71797982 frostD B Feb. 24, 2020, 3:48 p.m. OK PyPy 3 TESTS 12 155 1843200 1200
71782677 nagitaosu B Feb. 24, 2020, 3:01 p.m. OK PyPy 3 TESTS 12 155 1945600 1200
71782229 mudit B Feb. 24, 2020, 3 p.m. OK PyPy 3 TESTS 12 155 1945600 1200
71777822 neweekoff B Feb. 24, 2020, 2:50 p.m. OK PyPy 3 TESTS 12 155 1945600 1200
71912328 nandini18056 B Feb. 26, 2020, 12:11 p.m. OK PyPy 3 TESTS 12 155 2048000 1200
71846663 tiwari0000 B Feb. 25, 2020, 9:27 a.m. OK PyPy 3 TESTS 12 155 2048000 1200
71784577 anil_vemula B Feb. 24, 2020, 3:06 p.m. OK Python 2 TESTS 12 202 0 1200
71782131 berke_a B Feb. 24, 2020, 3 p.m. OK Python 2 TESTS 12 295 0 1200
71793749 happy_dalai B Feb. 24, 2020, 3:33 p.m. OK Python 2 TESTS 12 312 204800 1200
71820398 elistark B Feb. 24, 2020, 7:25 p.m. OK Python 2 TESTS 12 358 102400 1200
71793053 bertrandovide B Feb. 24, 2020, 3:31 p.m. OK Python 2 TESTS 12 436 5324800 1200
71792445 lockelamora1337 B Feb. 24, 2020, 3:29 p.m. OK Python 2 TESTS 12 592 102400 1200
71791047 resita B Feb. 24, 2020, 3:24 p.m. OK Python 2 TESTS 12 639 102400 1200
71930887 vip1k B Feb. 26, 2020, 5:40 p.m. OK Python 3 TESTS 12 108 307200 1200
71836125 KanhuKeNanu B Feb. 25, 2020, 5:36 a.m. OK Python 3 TESTS 12 108 307200 1200
71802241 BlackBear B Feb. 24, 2020, 4:05 p.m. OK Python 3 TESTS 12 108 307200 1200
71792518 Defjia B Feb. 24, 2020, 3:29 p.m. OK Python 3 TESTS 12 108 307200 1200
71862835 devesh1102 B Feb. 25, 2020, 2:03 p.m. OK Python 3 TESTS 12 109 307200 1200
71820441 shubhi_ B Feb. 24, 2020, 7:26 p.m. OK Python 3 TESTS 12 109 307200 1200
71808772 underdog2000 B Feb. 24, 2020, 4:32 p.m. OK Python 3 TESTS 12 109 307200 1200
71804194 queencurry B Feb. 24, 2020, 4:13 p.m. OK Python 3 TESTS 12 109 307200 1200
71796537 eugalt B Feb. 24, 2020, 3:43 p.m. OK Python 3 TESTS 12 109 307200 1200
71792251 velu276 B Feb. 24, 2020, 3:28 p.m. OK Python 3 TESTS 12 109 307200 1200
71823330 clearlycloudy B Feb. 24, 2020, 8:52 p.m. OK Rust TESTS 12 30 307200 1200
71819683 mversic101 B Feb. 24, 2020, 7:08 p.m. OK Rust TESTS 12 31 102400 1200
71793238 toterpinguin B Feb. 24, 2020, 3:31 p.m. OK Rust TESTS 12 31 102400 1200
71795101 WillToPower B Feb. 24, 2020, 3:37 p.m. OK Rust TESTS 12 46 0 1200
71783320 manta1130 B Feb. 24, 2020, 3:03 p.m. OK Rust TESTS 12 46 0 1200
71782092 akiradeveloper B Feb. 24, 2020, 3 p.m. OK Rust TESTS 12 46 204800 1200
71792447 petr.ossipov B Feb. 24, 2020, 3:29 p.m. OK Scala TESTS 12 499 0 1200

remove filters

Back to search problems