Codeforces Round 1114 (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
2254 Codeforces Round 1114 (Div. 3) FINISHED False 8100 2301884 Aug. 4, 2026, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 3028 ) F Whiplash PROGRAMMING bitmasks constructive algorithms math

Yousef has given you an even integer (n) and two arrays, (a) and (b), both consisting of (n) non-negative integers. You can perform the following operation on array (a) any number of times (possibly zero): Choose an index (i) ((1 \le i \le n)). For all (j) such that (1 \le j \le n) and (j \neq i), replace (a_j) with (a_j \oplus a_i). (Here, (\oplus) denotes the bitwise XOR operation ). The element (a_i) remains unchanged. Determine whether it is possible to transform array (a) into array (b) using a finite number of operations. The first line contains an integer (t) ((1 \le t \le 10^4)) — the number of test cases. The description of the test cases follows. The first line of each test case contains an even integer (n) ((2 \le n \le 2 \cdot 10^5)) — the length of the array. The second line of each test case contains (n) integers (a_1, a_2, \dots, a_n) ((0 \le a_i \lt 2^{30})) — the elements of the array (a). The third line of each test case contains (n) integers (b_1, b_2, \dots, b_n) ((0 \le b_i \lt 2^{30})) — the elements of the array (b). It is guaranteed that the sum of (n) over all test cases does not exceed (2 \cdot 10^5). For each test case, output " YES " if the array (a) can be transformed into array (b) using a finite number of operations, and " NO " otherwise. You can output the answer in any case (upper or lower). For example, the strings " yEs ", " yes ", " Yes ", and " YES " will be recognized as positive responses. In the first test case, starting from (1, 2), there is no sequence of operations that ends at (1, 0), so the answer is " NO ". In the second test case, one valid sequence is: Choose index (2), (1, {\color{blue}{2}}, 4, 7 \rightarrow 3, {\color{blue}{2}}, 6, 5). Choose index (3), (3, 2, {\color{blue}{6}}, 5 \rightarrow 5, 4, {\color{blue}{6}}, 3). Choose index (4), $$$

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
385813598 Vedensky F Aug. 5, 2026, 11 p.m. OK C++17 (GCC 7-32) TESTS 22 125 0
385798187 Kani1000 F Aug. 5, 2026, 6:31 p.m. OK C++17 (GCC 7-32) TESTS 22 125 102400
385833244 confizhou F Aug. 6, 2026, 4:39 a.m. OK C++17 (GCC 7-32) TESTS 22 140 0
385830778 Kurumiaps F Aug. 6, 2026, 3:56 a.m. OK C++17 (GCC 7-32) TESTS 22 140 0
385829758 qwertyui66 F Aug. 6, 2026, 3:40 a.m. OK C++17 (GCC 7-32) TESTS 22 140 0
385806293 Overf1ow F Aug. 5, 2026, 8:06 p.m. OK C++17 (GCC 7-32) TESTS 22 140 0
385709149 xixihaha666 F Aug. 5, 2026, 3:08 a.m. OK C++17 (GCC 7-32) TESTS 22 140 0
385669527 jhatpat F Aug. 4, 2026, 4:42 p.m. OK C++17 (GCC 7-32) TESTS 22 140 0
385804628 matvii0 F Aug. 5, 2026, 7:41 p.m. OK C++17 (GCC 7-32) TESTS 22 140 102400
385800726 CardsPack F Aug. 5, 2026, 6:54 p.m. OK C++17 (GCC 7-32) TESTS 22 140 102400
385825510 zhaojunkai F Aug. 6, 2026, 2:51 a.m. OK C++20 (GCC 13-64) TESTS 22 109 0
385837665 prem1505 F Aug. 6, 2026, 5:47 a.m. OK C++20 (GCC 13-64) TESTS 22 109 102400
385814341 Ak_m7uslim F Aug. 5, 2026, 11:26 p.m. OK C++20 (GCC 13-64) TESTS 22 109 102400
385798289 M0rtAl_ F Aug. 5, 2026, 6:32 p.m. OK C++20 (GCC 13-64) TESTS 22 109 102400
385714712 yywyyyyy1w F Aug. 5, 2026, 4:34 a.m. OK C++20 (GCC 13-64) TESTS 22 109 102400
385713969 eatyumi F Aug. 5, 2026, 4:22 a.m. OK C++20 (GCC 13-64) TESTS 22 109 102400
385712711 Acce1erator07 F Aug. 5, 2026, 4:02 a.m. OK C++20 (GCC 13-64) TESTS 22 109 102400
385670888 huanxiel F Aug. 4, 2026, 4:44 p.m. OK C++20 (GCC 13-64) TESTS 22 109 102400
385701700 fanrunze F Aug. 5, 2026, 12:56 a.m. OK C++20 (GCC 13-64) TESTS 22 109 204800
385672457 wanasleep F Aug. 4, 2026, 4:47 p.m. OK C++20 (GCC 13-64) TESTS 22 109 819200
385721245 SIKONGZHENGDAREN F Aug. 5, 2026, 6 a.m. OK C++23 (GCC 14-64, msys2) TESTS 22 93 2662400
385813216 m.zcao F Aug. 5, 2026, 10:47 p.m. OK C++23 (GCC 14-64, msys2) TESTS 22 109 0
385839020 TarunKoneru F Aug. 6, 2026, 6:05 a.m. OK C++23 (GCC 14-64, msys2) TESTS 22 109 102400
385838414 jiangordon F Aug. 6, 2026, 5:58 a.m. OK C++23 (GCC 14-64, msys2) TESTS 22 109 102400
385829887 YOLU_gargaring F Aug. 6, 2026, 3:42 a.m. OK C++23 (GCC 14-64, msys2) TESTS 22 109 102400
385808766 helulu F Aug. 5, 2026, 8:48 p.m. OK C++23 (GCC 14-64, msys2) TESTS 22 109 102400
385803766 Bhavishya_72 F Aug. 5, 2026, 7:29 p.m. OK C++23 (GCC 14-64, msys2) TESTS 22 109 102400
385795498 _Santiago_ F Aug. 5, 2026, 6:13 p.m. OK C++23 (GCC 14-64, msys2) TESTS 22 109 102400
385795253 akshaykm F Aug. 5, 2026, 6:12 p.m. OK C++23 (GCC 14-64, msys2) TESTS 22 109 102400
385715541 x_A F Aug. 5, 2026, 4:46 a.m. OK C++23 (GCC 14-64, msys2) TESTS 22 109 102400
385831530 sriram_18 F Aug. 6, 2026, 4:10 a.m. OK Java 21 TESTS 22 250 1024000
385670940 knightL F Aug. 4, 2026, 4:44 p.m. OK Java 21 TESTS 22 328 614400
385809303 livenlife453 F Aug. 5, 2026, 8:59 p.m. OK Java 21 TESTS 22 359 4505600
385670933 martiansoul F Aug. 4, 2026, 4:44 p.m. OK Java 21 TESTS 22 375 4608000
385669549 aaryannage.dev F Aug. 4, 2026, 4:42 p.m. OK Java 21 TESTS 22 390 7884800
385672816 DevShrevan7 F Aug. 4, 2026, 4:47 p.m. OK Java 21 TESTS 22 390 8396800
385805282 AnthonyEdwards F Aug. 5, 2026, 7:50 p.m. OK Java 21 TESTS 22 781 40550400
385714323 ironman263 F Aug. 5, 2026, 4:27 a.m. OK Java 21 TESTS 22 968 1126400
385808340 livenlife453 F Aug. 5, 2026, 8:40 p.m. OK Java 21 TESTS 22 1406 48742400
385802442 leonlian F Aug. 5, 2026, 7:13 p.m. OK Java 8 TESTS 22 265 4812800
385703926 chinesedfan F Aug. 5, 2026, 1:36 a.m. OK Node.js TESTS 22 453 37990400
385673140 madglog F Aug. 4, 2026, 4:48 p.m. OK PyPy 3 TESTS 22 265 32768000
385704236 ramumali2002 F Aug. 5, 2026, 1:42 a.m. OK PyPy 3 TESTS 22 656 21606400
385718049 pvb_10 F Aug. 5, 2026, 5:21 a.m. OK PyPy 3-64 TESTS 22 203 32768000
385721738 Kartikey07 F Aug. 5, 2026, 6:05 a.m. OK PyPy 3-64 TESTS 22 203 32870400
385673892 kaedeeeee F Aug. 4, 2026, 4:49 p.m. OK PyPy 3-64 TESTS 22 218 36761600
385703942 ac_ning F Aug. 5, 2026, 1:37 a.m. OK PyPy 3-64 TESTS 22 218 43520000
385837893 TheAppleTree F Aug. 6, 2026, 5:51 a.m. OK PyPy 3-64 TESTS 22 234 29798400
385702424 jakekim F Aug. 5, 2026, 1:09 a.m. OK PyPy 3-64 TESTS 22 250 31948800
385812962 user_not_found_404___ F Aug. 5, 2026, 10:39 p.m. OK PyPy 3-64 TESTS 22 250 32972800
385673168 yatindhoni F Aug. 4, 2026, 4:48 p.m. OK PyPy 3-64 TESTS 22 250 33177600
385694731 Nikrien F Aug. 4, 2026, 10:11 p.m. OK PyPy 3-64 TESTS 22 250 39014400
385671030 GarvitGaur F Aug. 4, 2026, 4:44 p.m. OK PyPy 3-64 TESTS 22 250 49254400
385832589 biltharesatyendra F Aug. 6, 2026, 4:28 a.m. OK Python 2 TESTS 22 500 13721600
385837100 amod_24 F Aug. 6, 2026, 5:38 a.m. OK Python 3 TESTS 22 281 34406400
385822227 AdrianKnox2000 F Aug. 6, 2026, 2:14 a.m. OK Python 3 TESTS 22 281 34611200
385711014 BitForge F Aug. 5, 2026, 3:37 a.m. OK Python 3 TESTS 22 296 45260800
385671592 amit123103 F Aug. 4, 2026, 4:45 p.m. OK Python 3 TESTS 22 296 54681600
385719064 adityaa6 F Aug. 5, 2026, 5:33 a.m. OK Python 3 TESTS 22 312 59084800
385672010 mionacs_ F Aug. 4, 2026, 4:46 p.m. OK Python 3 TESTS 22 343 36966400
385673231 2020akadaver F Aug. 4, 2026, 4:48 p.m. OK Python 3 TESTS 22 359 34816000
385674279 adarooshdatta F Aug. 4, 2026, 4:49 p.m. OK Python 3 TESTS 22 359 39628800
385712489 newbalance2 F Aug. 5, 2026, 3:59 a.m. OK Python 3 TESTS 22 421 55705600
385831663 kroyl F Aug. 6, 2026, 4:12 a.m. OK Rust 2024 TESTS 22 46 3379200
385697425 superoles F Aug. 4, 2026, 11:14 p.m. OK Rust 2024 TESTS 22 62 4915200

remove filters

Back to search problems