Teza Round 1 (Codeforces Round 1015, Div. 1 + Div. 2)

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
2084 Teza Round 1 (Codeforces Round 1015, Div. 1 + Div. 2) FINISHED False 10800 32541923 April 5, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 11628 ) C You Soared Afar With Grace PROGRAMMING constructive algorithms greedy implementation

You are given a permutation (a) and (b) of length (n)(^{\text{∗}}). You can perform the following operation at most (n) times: Choose two indices (i) and (j) ((1 \le i, j \le n), (i \ne j)), swap (a_i) with (a_j), swap (b_i) with (b_j). Determine whether (a) and (b) can be reverses of each other after operations. In other words, for each (i = 1, 2, \ldots, n), (a_i = b_{n + 1 - i}). If it is possible, output any valid sequence of operations. Otherwise, output (-1). (^{\text{∗}})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). Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 10^4)). The description of the test cases follows. The first line of each test case contains a single integer (n) ((2 \le n \le 2 \cdot 10^5)) — the length of the permutations. The second line contains (n) integers (a_1, a_2, \ldots, a_n) ((1 \le a_i \le n)). The third line contains (n) integers (b_1, b_2, \ldots, b_n) ((1 \le b_i \le n)). It is guaranteed that (a) and (b) are permutations of length (n). It is guaranteed that the sum of (n) over all test cases does not exceed (2\cdot 10^5). For each test case, if it is impossible, output (-1) in the only line. Otherwise, output a single integer (m) ((0 \le m \le n)) — the number of operations in the first line. In the following (m) lines, output two integers — the indices (i) and (j) ((1 \le i, j \le n), (i \ne j)) in each operation in order. If there are multiple solutions, print any of them. In the second test case, $$$b$$

Tutorials

141155

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
314143589 IRacle C April 5, 2025, 4:57 p.m. OK C# 10 TESTS 19 359 49561600
314183692 chenzaiyu C April 6, 2025, 1:10 a.m. OK C++17 (GCC 7-32) TESTS 19 125 2457600
314166260 RameshD C April 5, 2025, 7:35 p.m. OK C++17 (GCC 7-32) TESTS 19 139 307200
314185465 wzc_IOI_czw C April 6, 2025, 1:57 a.m. OK C++17 (GCC 7-32) TESTS 19 139 2457600
314199938 Agent_S C April 6, 2025, 5:49 a.m. OK C++17 (GCC 7-32) TESTS 19 139 4096000
314197150 simplyjoke C April 6, 2025, 5:20 a.m. OK C++17 (GCC 7-32) TESTS 19 139 4096000
314185115 m1p9iij1b3 C April 6, 2025, 1:48 a.m. OK C++17 (GCC 7-32) TESTS 19 140 307200
314186497 vulontrautruonglonbo C April 6, 2025, 2:20 a.m. OK C++17 (GCC 7-32) TESTS 19 140 1433600
314188224 MkttyptL C April 6, 2025, 2:54 a.m. OK C++17 (GCC 7-32) TESTS 19 140 2457600
314179796 limabeans C April 5, 2025, 11:15 p.m. OK C++17 (GCC 7-32) TESTS 19 140 2457600
314199347 iss_ C April 6, 2025, 5:43 a.m. OK C++17 (GCC 7-32) TESTS 19 140 4096000
314184658 gongruixin C April 6, 2025, 1:36 a.m. OK C++20 (GCC 13-64) TESTS 19 62 6963200
314182871 dengchengyu C April 6, 2025, 12:49 a.m. OK C++20 (GCC 13-64) TESTS 19 77 11673600
314187089 Humaoxing C April 6, 2025, 2:31 a.m. OK C++20 (GCC 13-64) TESTS 19 109 2457600
314186973 sad_me C April 6, 2025, 2:29 a.m. OK C++20 (GCC 13-64) TESTS 19 109 2457600
314189349 liujinrui C April 6, 2025, 3:17 a.m. OK C++20 (GCC 13-64) TESTS 19 109 3276800
314198921 oyosevolnona C April 6, 2025, 5:39 a.m. OK C++20 (GCC 13-64) TESTS 19 109 4096000
314184172 sad_deb C April 6, 2025, 1:22 a.m. OK C++20 (GCC 13-64) TESTS 19 109 4096000
314179907 Osama_Ashraf01 C April 5, 2025, 11:19 p.m. OK C++20 (GCC 13-64) TESTS 19 109 4096000
314184715 xiaoyuhao C April 6, 2025, 1:38 a.m. OK C++20 (GCC 13-64) TESTS 19 109 4915200
314184690 sad_deb C April 6, 2025, 1:37 a.m. OK C++20 (GCC 13-64) TESTS 19 109 4915200
314194108 saklan C April 6, 2025, 4:38 a.m. OK C++23 (GCC 14-64, msys2) TESTS 19 108 3993600
314200018 Crc254 C April 6, 2025, 5:49 a.m. OK C++23 (GCC 14-64, msys2) TESTS 19 109 921600
314195734 slashTeen C April 6, 2025, 5:03 a.m. OK C++23 (GCC 14-64, msys2) TESTS 19 109 921600
314181754 IsacBieber C April 6, 2025, 12:17 a.m. OK C++23 (GCC 14-64, msys2) TESTS 19 109 921600
314191477 BloomingSummerEnding C April 6, 2025, 3:55 a.m. OK C++23 (GCC 14-64, msys2) TESTS 19 109 1228800
314182739 DonChipilin C April 6, 2025, 12:45 a.m. OK C++23 (GCC 14-64, msys2) TESTS 19 109 1228800
314169880 el3a43r_Station C April 5, 2025, 8:18 p.m. OK C++23 (GCC 14-64, msys2) TESTS 19 109 1228800
314194054 GT-code C April 6, 2025, 4:38 a.m. OK C++23 (GCC 14-64, msys2) TESTS 19 109 4096000
314195381 LittleQiu233 C April 6, 2025, 4:58 a.m. OK C++23 (GCC 14-64, msys2) TESTS 19 109 5836800
314191334 S1amese C April 6, 2025, 3:52 a.m. OK C++23 (GCC 14-64, msys2) TESTS 19 124 921600
314171697 NenadDapic C April 5, 2025, 8:43 p.m. OK FPC TESTS 19 234 4096000
314199227 ahmedafeef C April 6, 2025, 5:42 a.m. OK GNU C11 TESTS 19 531 4096000
314198946 ahmedafeef C April 6, 2025, 5:39 a.m. OK GNU C11 TESTS 19 531 4096000
314195598 ahmedafeef C April 6, 2025, 5:01 a.m. OK GNU C11 TESTS 19 531 4096000
314142182 shiou C April 5, 2025, 4:53 p.m. OK Go TESTS 19 249 19251200
314161809 Master_Shifu46 C April 5, 2025, 6:53 p.m. OK Java 21 TESTS 19 343 3891200
314146177 anees03 C April 5, 2025, 5:06 p.m. OK Java 21 TESTS 19 468 16588800
314186012 yang_wei C April 6, 2025, 2:09 a.m. OK Java 21 TESTS 19 483 7884800
314150604 rheetiksharma603 C April 5, 2025, 5:21 p.m. OK Java 21 TESTS 19 859 33792000
314149372 AlanMartinez C April 5, 2025, 5:17 p.m. OK Java 21 TESTS 19 952 11776000
314164400 praxkilleryt C April 5, 2025, 7:17 p.m. OK Java 21 TESTS 19 952 57139200
314144564 wddd C April 5, 2025, 5:01 p.m. OK Java 21 TESTS 19 968 44134400
314149240 LoserVicky C April 5, 2025, 5:16 p.m. OK Java 21 TESTS 19 1046 63590400
314150214 aroradhairya314 C April 5, 2025, 5:20 p.m. OK Java 21 TESTS 19 1093 61952000
314150806 phongnc C April 5, 2025, 5:22 p.m. OK Java 21 TESTS 19 1109 7168000
314145233 sachinbisht2961 C April 5, 2025, 5:03 p.m. OK Java 8 TESTS 19 202 0
314148442 Luyi16_no_head C April 5, 2025, 5:13 p.m. OK Java 8 TESTS 19 296 5017600
314171947 ashishcloudkaptan C April 5, 2025, 8:47 p.m. OK Java 8 TESTS 19 343 29491200
314142985 pm_to_the_am C April 5, 2025, 4:56 p.m. OK Java 8 TESTS 19 374 12697600
314149668 bittubittu C April 5, 2025, 5:18 p.m. OK Java 8 TESTS 19 812 48947200
314144182 prime29 C April 5, 2025, 4:59 p.m. OK Java 8 TESTS 19 1233 64819200
314153260 1998tarun C April 5, 2025, 5:30 p.m. OK Java 8 TESTS 19 1265 18841600
314143121 SilverBullet4869 C April 5, 2025, 4:56 p.m. OK Java 8 TESTS 19 1578 70246400
314149636 iitamansharma C April 5, 2025, 5:18 p.m. OK Kotlin 1.9 TESTS 19 1937 71884800
314196282 ahtoh_ C April 6, 2025, 5:10 a.m. OK Node.js TESTS 19 374 66355200
314194177 11DE784A C April 6, 2025, 4:40 a.m. OK PyPy 3 TESTS 19 578 20172800
314164040 AV_the_coder C April 5, 2025, 7:13 p.m. OK PyPy 3 TESTS 19 593 22425600
314145846 dorado7 C April 5, 2025, 5:05 p.m. OK PyPy 3 TESTS 19 921 30105600
314153473 seetwenty2020 C April 5, 2025, 5:31 p.m. OK PyPy 3 TESTS 19 984 36454400
314168035 pmaddineedi C April 5, 2025, 7:55 p.m. OK PyPy 3 TESTS 19 984 45363200
314141998 pmaddineedi C April 5, 2025, 4:53 p.m. OK PyPy 3 TESTS 19 984 45363200
314143835 _whiskey_ C April 5, 2025, 4:58 p.m. OK PyPy 3 TESTS 19 1046 46592000
314144779 gr_priyk C April 5, 2025, 5:01 p.m. OK PyPy 3 TESTS 19 1155 46694400
314161778 toshitpant C April 5, 2025, 6:53 p.m. OK PyPy 3 TESTS 19 1280 79974400
314154903 FadedDio C April 5, 2025, 5:34 p.m. OK PyPy 3 TESTS 19 1374 74854400
314172701 azerbenmed1730 C April 5, 2025, 8:58 p.m. OK PyPy 3-64 TESTS 19 234 38707200
314173030 azerbenmed1730 C April 5, 2025, 9:03 p.m. OK PyPy 3-64 TESTS 19 249 37273600
314174288 azerbenmed1730 C April 5, 2025, 9:22 p.m. OK PyPy 3-64 TESTS 19 249 38604800
314174674 azerbenmed1730 C April 5, 2025, 9:27 p.m. OK PyPy 3-64 TESTS 19 249 39014400
314145206 PatrickHamilton C April 5, 2025, 5:03 p.m. OK PyPy 3-64 TESTS 19 249 56524800
314192742 maruf_khan96 C April 6, 2025, 4:17 a.m. OK PyPy 3-64 TESTS 19 280 31334400
314154727 flyinggit C April 5, 2025, 5:34 p.m. OK PyPy 3-64 TESTS 19 281 30617600
314195558 saipr C April 6, 2025, 5 a.m. OK PyPy 3-64 TESTS 19 296 49459200
314194883 mtand872 C April 6, 2025, 4:50 a.m. OK PyPy 3-64 TESTS 19 311 28057600
314172750 azerbenmed1730 C April 5, 2025, 8:58 p.m. OK PyPy 3-64 TESTS 19 327 37376000
314189978 StoneXie C April 6, 2025, 3:29 a.m. OK Python 3 TESTS 19 577 36249600
314172582 jr_03 C April 5, 2025, 8:56 p.m. OK Python 3 TESTS 19 593 53760000
314159975 Sanoy-si C April 5, 2025, 6:38 p.m. OK Python 3 TESTS 19 640 61542400
314147714 kon27 C April 5, 2025, 5:11 p.m. OK Python 3 TESTS 19 702 50176000
314159959 ayushdreams147 C April 5, 2025, 6:38 p.m. OK Python 3 TESTS 19 796 58470400
314191690 jvatsal0709 C April 6, 2025, 3:59 a.m. OK Python 3 TESTS 19 859 43212800
314146726 kurkure_momos C April 5, 2025, 5:08 p.m. OK Python 3 TESTS 19 1468 158720000
314145212 Erito C April 5, 2025, 5:03 p.m. OK Python 3 TESTS 19 1624 268390400
314148339 1Demiurg C April 5, 2025, 5:13 p.m. OK Python 3 TESTS 19 1640 85811200
314148996 22104110 C April 5, 2025, 5:15 p.m. OK Python 3 TESTS 19 1640 158720000
314201178 vstiff C April 6, 2025, 6:02 a.m. OK Rust 2021 TESTS 19 77 11366400
314196676 amal064 C April 6, 2025, 5:14 a.m. OK Rust 2021 TESTS 19 93 5836800
314196394 amal064 C April 6, 2025, 5:11 a.m. OK Rust 2021 TESTS 19 93 5836800
314196141 amal064 C April 6, 2025, 5:08 a.m. OK Rust 2021 TESTS 19 93 5836800
314195954 amal064 C April 6, 2025, 5:05 a.m. OK Rust 2021 TESTS 19 108 5836800
314195815 amal064 C April 6, 2025, 5:04 a.m. OK Rust 2021 TESTS 19 108 6860800
314145521 JimmyKirk C April 5, 2025, 5:04 p.m. OK Rust 2021 TESTS 19 139 28262400

remove filters

Back to search problems