Codeforces Round 1032 (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
2121 Codeforces Round 1032 (Div. 3) FINISHED False 8100 26234723 June 17, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 18137 ) D 1709 PROGRAMMING implementation sortings

You are given two arrays of integers (a_1, a_2, \ldots, a_n) and (b_1, b_2, \ldots, b_n). It is guaranteed that each integer from (1) to (2 \cdot n) appears in exactly one of the arrays. You need to perform a certain number of operations (possibly zero) so that both of the following conditions are satisfied: For each (1 \leq i < n), it holds that (a_i < a_{i + 1}) and (b_i < b_{i + 1}). For each (1 \leq i \leq n), it holds that (a_i < b_i). During each operation, you can perform exactly one of the following three actions: Choose an index (1 \leq i < n) and swap the values (a_i) and (a_{i + 1}). Choose an index (1 \leq i < n) and swap the values (b_i) and (b_{i + 1}). Choose an index (1 \leq i \leq n) and swap the values (a_i) and (b_i). You do not need to minimize the number of operations, but the total number must not exceed (1709). Find any sequence of operations that satisfies both conditions. Each test consists of multiple test cases. The first line contains a single integer (t) ((1 \leq t \leq 100)) — 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 \leq n \leq 40)) — the length of the arrays (a) and (b). The second line of each test case contains (n) integers (a_1, a_2, \ldots, a_n) ((1 \leq a_i \leq 2 \cdot n)). The third line of each test case contains (n) integers (b_1, b_2, \ldots, b_n) ((1 \leq b_i \leq 2 \cdot n)). It is guaranteed that each integer from (1) to (2 \cdot n) appears either in array (a) or in array (b). For each test case, output the sequence of operations. In the first line for each test case, output the number of operations (k). Note that (0 \leq k \leq 1709). In the following (k) lines for each test case, output the operations themselves: If you want to swap the values (a_i) and $$$a_{i +

Tutorials

Codeforces Round 1032 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
324929257 og.kostya D June 17, 2025, 5:32 p.m. OK C# 13 TESTS 10 108 4505600
324971831 _Kartik_Pal D June 18, 2025, 3:41 a.m. OK C++17 (GCC 7-32) TESTS 13 46 0
324962352 Ba4aaa_Albld D June 18, 2025, 1:16 a.m. OK C++17 (GCC 7-32) TESTS 13 46 0
324962264 Ba4aaa_Albld D June 18, 2025, 1:14 a.m. OK C++17 (GCC 7-32) TESTS 13 46 0
324951123 Szympankson D June 17, 2025, 8:20 p.m. OK C++17 (GCC 7-32) TESTS 10 46 0
324949249 kumarpriyanshu76872 D June 17, 2025, 7:51 p.m. OK C++17 (GCC 7-32) TESTS 10 46 0
324941404 Shami_Al D June 17, 2025, 6:21 p.m. OK C++17 (GCC 7-32) TESTS 10 46 0
324938571 rounakpatra D June 17, 2025, 5:55 p.m. OK C++17 (GCC 7-32) TESTS 10 46 0
324929492 reshikhr D June 17, 2025, 5:34 p.m. OK C++17 (GCC 7-32) TESTS 10 46 0
324923693 vyuu D June 17, 2025, 4:56 p.m. OK C++17 (GCC 7-32) TESTS 10 46 0
324919942 Krishna_Singh27 D June 17, 2025, 4:48 p.m. OK C++17 (GCC 7-32) TESTS 10 46 0
324974185 ArisuM1ka D June 18, 2025, 4:07 a.m. OK C++20 (GCC 13-64) TESTS 13 31 102400
324972063 CrazyApple D June 18, 2025, 3:43 a.m. OK C++20 (GCC 13-64) TESTS 13 46 0
324970497 YUYIZHI D June 18, 2025, 3:24 a.m. OK C++20 (GCC 13-64) TESTS 13 46 0
324965573 cleanser D June 18, 2025, 2:14 a.m. OK C++20 (GCC 13-64) TESTS 13 46 0
324961727 _Aya_Youssefff_ D June 18, 2025, 1:02 a.m. OK C++20 (GCC 13-64) TESTS 13 46 0
324961709 _TULIP_16 D June 18, 2025, 1:01 a.m. OK C++20 (GCC 13-64) TESTS 13 46 0
324959881 ink65536 D June 18, 2025, 12:13 a.m. OK C++20 (GCC 13-64) TESTS 13 46 0
324958624 BeGukesh D June 17, 2025, 11:26 p.m. OK C++20 (GCC 13-64) TESTS 13 46 0
324957702 MedKacem D June 17, 2025, 10:52 p.m. OK C++20 (GCC 13-64) TESTS 13 46 0
324952474 silent_Joy D June 17, 2025, 8:42 p.m. OK C++20 (GCC 13-64) TESTS 10 46 0
324984967 ggggg776543 D June 18, 2025, 6 a.m. OK C++23 (GCC 14-64, msys2) TESTS 19 46 0
324983977 sharodh25 D June 18, 2025, 5:51 a.m. OK C++23 (GCC 14-64, msys2) TESTS 14 46 0
324982832 azureboy D June 18, 2025, 5:40 a.m. OK C++23 (GCC 14-64, msys2) TESTS 14 46 0
324981885 rainbow777 D June 18, 2025, 5:30 a.m. OK C++23 (GCC 14-64, msys2) TESTS 14 46 0
324979034 saisriramdodda1302 D June 18, 2025, 5:01 a.m. OK C++23 (GCC 14-64, msys2) TESTS 13 46 0
324978376 _manitbansal.07 D June 18, 2025, 4:54 a.m. OK C++23 (GCC 14-64, msys2) TESTS 13 46 0
324975237 XUNRAN_XXXX D June 18, 2025, 4:19 a.m. OK C++23 (GCC 14-64, msys2) TESTS 13 46 0
324971228 False0099 D June 18, 2025, 3:33 a.m. OK C++23 (GCC 14-64, msys2) TESTS 13 46 0
324968556 Zheng_iii D June 18, 2025, 2:58 a.m. OK C++23 (GCC 14-64, msys2) TESTS 13 46 0
324967851 jjwawy999 D June 18, 2025, 2:48 a.m. OK C++23 (GCC 14-64, msys2) TESTS 13 46 0
324930278 ruban D June 17, 2025, 5:41 p.m. OK FPC TESTS 10 124 86937600
324920790 aaratrikashelly D June 17, 2025, 4:49 p.m. OK GNU C11 TESTS 10 343 102400
324976770 Reshare D June 18, 2025, 4:37 a.m. OK GNU C11 TESTS 13 358 102400
324946818 sohxm2k D June 17, 2025, 7:20 p.m. OK Java 21 TESTS 10 187 1126400
324955256 guharoypragyayan D June 17, 2025, 9:38 p.m. OK Java 21 TESTS 10 202 614400
324978768 atulya_jaiswal D June 18, 2025, 4:58 a.m. OK Java 21 TESTS 13 264 1024000
324921872 GoodBoy20 D June 17, 2025, 4:49 p.m. OK Java 21 TESTS 10 265 1024000
324927134 GoodBoy20 D June 17, 2025, 5:17 p.m. OK Java 21 TESTS 10 280 716800
324927113 bhanageviraj D June 17, 2025, 5:17 p.m. OK Java 21 TESTS 10 280 1638400
324926975 Virajbhanage D June 17, 2025, 5:16 p.m. OK Java 21 TESTS 10 280 1638400
324978263 atulya_jaiswal D June 18, 2025, 4:52 a.m. OK Java 21 TESTS 13 281 819200
324927031 GoodBoy20 D June 17, 2025, 5:17 p.m. OK Java 21 TESTS 10 281 819200
324920315 FF_GAMERZ D June 17, 2025, 4:48 p.m. OK Java 21 TESTS 10 281 1126400
324930372 Eslam_Ahmed D June 17, 2025, 5:42 p.m. OK Java 8 TESTS 10 140 0
324921990 Trouble_shooter D June 17, 2025, 4:49 p.m. OK Java 8 TESTS 10 156 0
324974648 tirthgohil1410 D June 18, 2025, 4:12 a.m. OK Java 8 TESTS 13 171 0
324937609 Sumitsingh7 D June 17, 2025, 5:47 p.m. OK Java 8 TESTS 10 374 6963200
324952162 kasiru_69 D June 17, 2025, 8:36 p.m. OK Java 8 TESTS 10 389 0
324977229 skk_codes D June 18, 2025, 4:41 a.m. OK Java 8 TESTS 13 406 0
324981997 BINGIMAHARSHI D June 18, 2025, 5:31 a.m. OK Java 8 TESTS 14 562 0
324962676 Ba4aaa_Albld D June 18, 2025, 1:22 a.m. OK PyPy 3 TESTS 13 202 9420800
324925934 aayushprasad00691 D June 17, 2025, 5:09 p.m. OK PyPy 3 TESTS 10 234 9728000
324958404 coder.sy D June 17, 2025, 11:17 p.m. OK PyPy 3 TESTS 13 249 9523200
324920439 SanyKing239 D June 17, 2025, 4:48 p.m. OK PyPy 3 TESTS 10 265 9420800
324921913 s.adithya_reddy D June 17, 2025, 4:49 p.m. OK PyPy 3 TESTS 10 265 9625600
324929499 Calculuslove D June 17, 2025, 5:35 p.m. OK PyPy 3 TESTS 10 280 10035200
324921725 SanyKing239 D June 17, 2025, 4:49 p.m. OK PyPy 3 TESTS 10 296 9625600
324980609 sumitmandaliitr D June 18, 2025, 5:17 a.m. OK PyPy 3 TESTS 14 311 9932800
324919572 DSKroc D June 17, 2025, 4:47 p.m. OK PyPy 3 TESTS 10 390 11264000
324970306 Dias1177 D June 18, 2025, 3:22 a.m. OK PyPy 3 TESTS 13 405 10956800
324940748 Om_Singh_ D June 17, 2025, 6:15 p.m. OK PyPy 3-64 TESTS 10 124 5324800
324944582 gardengnome D June 17, 2025, 6:53 p.m. OK PyPy 3-64 TESTS 10 124 7065600
324949803 crystal_castles D June 17, 2025, 7:59 p.m. OK PyPy 3-64 TESTS 10 124 7577600
324920919 suraj_kewat D June 17, 2025, 4:49 p.m. OK PyPy 3-64 TESTS 10 124 7680000
324924456 PrinceWebCoder D June 17, 2025, 5 p.m. OK PyPy 3-64 TESTS 10 124 11776000
324947551 crystal_castles D June 17, 2025, 7:30 p.m. OK PyPy 3-64 TESTS 10 124 11878400
324950069 gustavaman D June 17, 2025, 8:03 p.m. OK PyPy 3-64 TESTS 10 139 9011200
324929564 Ashwin_S_19 D June 17, 2025, 5:35 p.m. OK PyPy 3-64 TESTS 10 139 9216000
324927085 Mohsha D June 17, 2025, 5:17 p.m. OK PyPy 3-64 TESTS 10 139 9216000
324944992 aaryabalajiabc D June 17, 2025, 6:58 p.m. OK PyPy 3-64 TESTS 10 140 6246400
324919636 xwd123 D June 17, 2025, 4:47 p.m. OK Python 3 TESTS 10 108 8294400
324969307 AddAdityaup D June 18, 2025, 3:08 a.m. OK Python 3 TESTS 13 203 614400
324938964 kshubham5642 D June 17, 2025, 5:59 p.m. OK Python 3 TESTS 10 217 2764800
324977204 prabhat.kr.sahu1 D June 18, 2025, 4:41 a.m. OK Python 3 TESTS 13 218 819200
324920530 radhikadahiya D June 17, 2025, 4:48 p.m. OK Python 3 TESTS 10 233 7884800
324925170 sriyamula999 D June 17, 2025, 5:04 p.m. OK Python 3 TESTS 10 234 409600
324976249 Rakshak7575 D June 18, 2025, 4:30 a.m. OK Python 3 TESTS 13 234 1638400
324976010 Bhavish777 D June 18, 2025, 4:28 a.m. OK Python 3 TESTS 13 234 1638400
324950948 abhiramchikatla03 D June 17, 2025, 8:17 p.m. OK Python 3 TESTS 10 249 1024000
324974936 svrmalaviya D June 18, 2025, 4:15 a.m. OK Python 3 TESTS 13 249 1536000

remove filters

Back to search problems