Codeforces Round 943 (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
1968 Codeforces Round 943 (Div. 3) FINISHED False 8100 22518863 May 2, 2024, 2:45 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 15375 ) D Permutation Game PROGRAMMING brute force dfs and similar games graphs greedy math 1300

B'Bodya and Sasha found a permutation p_1, ... ,p_n and an array a_1, ... ,a_n . They decided to play a well-known "Permutation game". A permutation of length n is an array consisting of n distinct integers from 1 to n in arbitrary order. For example, [2,3,1,5,4] is a permutation, but [1,2,2] is not a permutation ( 2 appears twice in the array), and [1,3,4] is also not a permutation ( n=3 but there is 4 in the array). Both of them chose a starting position in the permutation. The game lasts k turns. The players make moves simultaneously. On each turn, two things happen to each player: Knowing Bodya 's starting position P_B and Sasha 's starting position P_S , determine who wins the game if both players are trying to win. The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of testcases. The first line of each testcase contains integers n , k , P_B , P_S ( 1 <= P_B,P_S <= n <= 2 cdot 10^5 , 1 <= k <= 10^9 ) -- length of the permutation, duration of the game, starting positions respectively. The next line contains n integers p_1, ... ,p_n ( 1 <= p_i <= n ) -- elements of the permutation p . The next line contains n integers a_1, ... ,a_n ( 1 <= a_i <= 10^9 ) -- elements of array a . It is guaranteed that the sum of values of n over all test cases does not exceed 2 cdot 10^5 . For each testcase output: Below you can find the explanation for the first testcase, where the game consists of k=2 turns. As we may see, Bodya 's score is greater, so he wins the game. It can be shown that Bodya always can win this game. '...

Tutorials

129096

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
262652081 thumbass D May 26, 2024, 5:29 a.m. OK C++14 (GCC 6-32) TESTS 14 109 102400 1300
263683768 jeeval2703 D June 1, 2024, 10:09 p.m. OK C++14 (GCC 6-32) TESTS 14 124 0 1300
262657121 thumbass D May 26, 2024, 6:16 a.m. OK C++14 (GCC 6-32) TESTS 14 124 0 1300
262271553 GVJNJ D May 23, 2024, 2:18 p.m. OK C++14 (GCC 6-32) TESTS 14 124 0 1300
262950828 ayuisaki D May 28, 2024, 3:26 a.m. OK C++14 (GCC 6-32) TESTS 14 124 1638400 1300
262705640 lzm_555994 D May 26, 2024, 12:49 p.m. OK C++14 (GCC 6-32) TESTS 14 124 1638400 1300
261447217 luogu_bot3 D May 18, 2024, 2:19 a.m. OK C++14 (GCC 6-32) TESTS 14 124 1638400 1300
262644767 luogu_bot5 D May 26, 2024, 3:52 a.m. OK C++14 (GCC 6-32) TESTS 14 124 2457600 1300
262644706 luogu_bot4 D May 26, 2024, 3:51 a.m. OK C++14 (GCC 6-32) TESTS 14 124 2457600 1300
261449312 luogu_bot3 D May 18, 2024, 2:52 a.m. OK C++14 (GCC 6-32) TESTS 14 124 3174400 1300
263689598 ErlandMB D June 2, 2024, 1:20 a.m. OK C++17 (GCC 7-32) TESTS 14 124 0 1300
263668866 idkn0x D June 1, 2024, 6:16 p.m. OK C++17 (GCC 7-32) TESTS 14 124 0 1300
263660621 sarthak2jain D June 1, 2024, 5:01 p.m. OK C++17 (GCC 7-32) TESTS 14 124 0 1300
263211397 Latertt D May 30, 2024, 8:12 a.m. OK C++17 (GCC 7-32) TESTS 14 124 0 1300
263096058 Aktian D May 29, 2024, 6:31 a.m. OK C++17 (GCC 7-32) TESTS 14 124 0 1300
263088929 Bhavya2805 D May 29, 2024, 5:18 a.m. OK C++17 (GCC 7-32) TESTS 14 124 0 1300
263063398 kaiseridusk D May 28, 2024, 8:38 p.m. OK C++17 (GCC 7-32) TESTS 14 124 0 1300
262893915 today.yesterday D May 27, 2024, 2:21 p.m. OK C++17 (GCC 7-32) TESTS 14 124 0 1300
262510063 worst-cf-coder D May 25, 2024, 12:39 p.m. OK C++17 (GCC 7-32) TESTS 14 124 0 1300
261932270 pafingl D May 20, 2024, 7:59 p.m. OK C++17 (GCC 7-32) TESTS 14 124 0 1300
261218147 riariti D May 16, 2024, 3:22 p.m. OK C++20 (GCC 13-64) TESTS 14 62 307200 1300
261448024 Golem__ D May 18, 2024, 2:33 a.m. OK C++20 (GCC 13-64) TESTS 14 62 3481600 1300
262222134 ehdxbc D May 23, 2024, 7:33 a.m. OK C++20 (GCC 13-64) TESTS 14 108 0 1300
261727762 KFK_Demon D May 20, 2024, 6:02 a.m. OK C++20 (GCC 13-64) TESTS 14 108 0 1300
261684959 stuffysprout D May 19, 2024, 5:24 p.m. OK C++20 (GCC 13-64) TESTS 14 108 0 1300
261538564 Hossainul D May 18, 2024, 1:52 p.m. OK C++20 (GCC 13-64) TESTS 14 108 0 1300
261267412 Sealy D May 17, 2024, 2:41 a.m. OK C++20 (GCC 13-64) TESTS 14 108 0 1300
261194542 JollyVictini D May 16, 2024, 12:28 p.m. OK C++20 (GCC 13-64) TESTS 14 108 0 1300
262664668 YamadaAnna D May 26, 2024, 7:17 a.m. OK C++20 (GCC 13-64) TESTS 14 108 921600 1300
263686248 andrewl746 D June 1, 2024, 11:28 p.m. OK C++20 (GCC 13-64) TESTS 14 109 0 1300
262283865 fpccvn D May 23, 2024, 4:05 p.m. OK FPC TESTS 14 155 3276800 1300
261728948 sabhinav22 D May 20, 2024, 6:16 a.m. OK GNU C11 TESTS 14 156 3276800 1300
261207448 cccccqw D May 16, 2024, 2:01 p.m. OK GNU C11 TESTS 14 156 3276800 1300
261074018 Martynas D May 15, 2024, 3:19 p.m. OK Go TESTS 14 233 6860800 1300
261199776 october_rain D May 16, 2024, 1:05 p.m. OK Haskell TESTS 14 1608 53555200 1300
262001874 BishtCoder D May 21, 2024, 10:54 a.m. OK Java 21 TESTS 14 296 921600 1300
261930154 stolis D May 20, 2024, 7:34 p.m. OK Java 21 TESTS 14 327 512000 1300
261762193 anshgrover25072002 D May 20, 2024, 10:17 a.m. OK Java 21 TESTS 14 358 23040000 1300
262646861 AKhacks D May 26, 2024, 4:22 a.m. OK Java 21 TESTS 14 358 25190400 1300
263252016 vjudge3 D May 30, 2024, 1:01 p.m. OK Java 21 TESTS 14 359 6246400 1300
262866578 Harshsharma28 D May 27, 2024, 10:48 a.m. OK Java 21 TESTS 14 389 14643200 1300
262058195 Festyve D May 21, 2024, 5:44 p.m. OK Java 21 TESTS 14 390 6656000 1300
262957224 _global D May 28, 2024, 4:47 a.m. OK Java 21 TESTS 14 421 7065600 1300
263069755 mangos194 D May 28, 2024, 10:52 p.m. OK Java 21 TESTS 14 452 12595200 1300
261220767 Sagy13 D May 16, 2024, 3:43 p.m. OK Java 21 TESTS 14 640 41472000 1300
261551694 aman28rwt D May 18, 2024, 3:39 p.m. OK Java 8 TESTS 14 187 0 1300
261321671 singhharman D May 17, 2024, 11:35 a.m. OK Java 8 TESTS 14 233 21094400 1300
261614565 KEYKB D May 19, 2024, 7:16 a.m. OK Java 8 TESTS 14 234 14028800 1300
261286892 Hemant_malav D May 17, 2024, 6:31 a.m. OK Java 8 TESTS 14 249 28876800 1300
262880064 tittiesboy99 D May 27, 2024, 12:33 p.m. OK Java 8 TESTS 14 296 15769600 1300
261593334 233030202 D May 19, 2024, 3:08 a.m. OK Java 8 TESTS 14 686 0 1300
261322520 ved20 D May 17, 2024, 11:42 a.m. OK Java 8 TESTS 14 718 4812800 1300
262846282 parth_7042 D May 27, 2024, 7:52 a.m. OK PHP TESTS 14 233 48332800 1300
262631369 NitroSpear D May 25, 2024, 11:34 p.m. OK PyPy 3 TESTS 14 562 20070400 1300
261757504 zhengyi20thu D May 20, 2024, 9:43 a.m. OK PyPy 3 TESTS 14 593 30208000 1300
262049921 lo_krlo_baatt D May 21, 2024, 4:33 p.m. OK PyPy 3 TESTS 14 796 20172800 1300
261701034 mahnameisayush D May 19, 2024, 8:33 p.m. OK PyPy 3 TESTS 14 796 64204800 1300
261223499 pogisinico D May 16, 2024, 4:05 p.m. OK PyPy 3-64 TESTS 14 186 28774400 1300
261705096 sathvik_67 D May 19, 2024, 9:47 p.m. OK PyPy 3-64 TESTS 14 202 32768000 1300
263418467 Tinky1224 D May 31, 2024, 6:03 a.m. OK PyPy 3-64 TESTS 14 202 33587200 1300
263653884 the_last_smilodon D June 1, 2024, 4:06 p.m. OK PyPy 3-64 TESTS 14 218 32870400 1300
262436889 Polynomu D May 24, 2024, 8:44 p.m. OK PyPy 3-64 TESTS 14 233 38604800 1300
261770334 pratyanch_jain D May 20, 2024, 11:29 a.m. OK PyPy 3-64 TESTS 14 233 39936000 1300
263251782 Charles_LHN D May 30, 2024, 12:59 p.m. OK PyPy 3-64 TESTS 14 234 37785600 1300
261615285 dhanyasinha D May 19, 2024, 7:22 a.m. OK PyPy 3-64 TESTS 14 249 28672000 1300
261476112 tomasnyberg D May 18, 2024, 7:03 a.m. OK PyPy 3-64 TESTS 14 249 41779200 1300
261725409 SaxenaYash D May 20, 2024, 5:32 a.m. OK PyPy 3-64 TESTS 14 265 28364800 1300
262162027 samoylovboris D May 22, 2024, 3:23 p.m. OK Python 3 TESTS 14 374 35635200 1300
263254766 mumuslp D May 30, 2024, 1:21 p.m. OK Python 3 TESTS 14 405 35635200 1300
261762910 ArafHasan D May 20, 2024, 10:23 a.m. OK Python 3 TESTS 14 405 35635200 1300
262853007 klu-2100030642 D May 27, 2024, 8:50 a.m. OK Python 3 TESTS 14 406 35737600 1300
261696527 gustavaman D May 19, 2024, 7:28 p.m. OK Python 3 TESTS 14 421 34304000 1300
261686499 Chmel_Tolstiy D May 19, 2024, 5:39 p.m. OK Python 3 TESTS 14 436 35430400 1300
261734877 aven_10 D May 20, 2024, 7:18 a.m. OK Python 3 TESTS 14 453 35430400 1300
262485313 ngocle2001 D May 25, 2024, 9:05 a.m. OK Python 3 TESTS 14 530 35635200 1300
261474559 ___a_s_1_2___ D May 18, 2024, 6:54 a.m. OK Python 3 TESTS 14 546 35737600 1300
262451860 akshaya0906 D May 25, 2024, 3:16 a.m. OK Python 3 TESTS 14 608 39321600 1300
261092810 Ktwsz D May 15, 2024, 6:22 p.m. OK Rust 2021 TESTS 14 93 7987200 1300
261565159 Tardimgg D May 18, 2024, 5:40 p.m. OK Rust 2021 TESTS 14 171 10035200 1300

remove filters

Back to search problems