Codeforces Round 1065 (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
2171 Codeforces Round 1065 (Div. 3) FINISHED False 9000 12756323 Nov. 20, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 11720 ) C2 Renako Amaori and XOR Game (hard version) PROGRAMMING bitmasks games greedy

This is the hard version of the problem. The only difference between the easy and hard versions is that in the hard version, (a_i, b_i \leq 10^6). Renako is stuck between a rock and a hard place... and by that, of course, I mean Ajisai and Mai! Both of them want to hang out with her, and she just can't decide! So Ajisai and Mai have decided to play the XOR game. Ajisai and Mai are given arrays (a) and (b) of length (n) ((0\leq a_i, b_i\leq {\color{red}{10^6}})). They will play a game that lasts for (n) turns, where Ajisai moves on odd-numbered turns and Mai moves on even-numbered turns. On the (i)-th turn, the player to move may choose to swap (a_i) and (b_i), or pass. Note that if a swap occurs, the index that is being swapped must match the turn number . For example, on the first turn, Ajisai may choose to swap (a_1) and (b_1), or pass. On the second turn, Mai may choose to swap (a_2) and (b_2), or pass. This continues for (n) turns. Thus, only Ajisai can swap odd indices, and only Mai can swap even indices. At the end of the game, Ajisai achieves a score of (a_1 \oplus a_2 \oplus \dots \oplus a_n), and Mai achieves a score of (b_1 \oplus b_2 \oplus \dots \oplus b_n)(^{\text{∗}}). The player with the higher score wins. If the players have the same score, the game ends in a tie. Determine the outcome of the game with optimal play. More formally, one player is considered to win with optimal play if there exists a strategy for them such that they always win, regardless of their opponent's choices. The game is considered a tie with optimal play if neither player has such a strategy. (^{\text{∗}})(\oplus) denotes the bitwise XOR operation The first line contains a single integer (t) ((1\leq t\leq 10^4)) — the number of test cases. The first line of each test case contains a single integer (n) ((1\leq n\leq 2\cdot 10^5)). The second line of each test case contains $$$n$

Tutorials

Codeforces Round 1065 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
350001292 Neron C2 Nov. 20, 2025, 10:49 p.m. OK C# 13 TESTS 11 186 2252800
350001547 Neron C2 Nov. 20, 2025, 10:56 p.m. OK C# 13 TESTS 11 187 2355200
350001446 Neron C2 Nov. 20, 2025, 10:53 p.m. OK C# 13 TESTS 11 187 2355200
350001638 Neron C2 Nov. 20, 2025, 10:59 p.m. OK C# 13 TESTS 11 202 2457600
350147833 Shoyeb45 C2 Nov. 22, 2025, 4:41 a.m. OK C++17 (GCC 7-32) TESTS 11 109 0
350143797 yhaha52 C2 Nov. 22, 2025, 3:27 a.m. OK C++17 (GCC 7-32) TESTS 11 109 0
350088406 Riyad_shamiul C2 Nov. 21, 2025, 3:27 p.m. OK C++17 (GCC 7-32) TESTS 11 109 0
350070295 Agnight866 C2 Nov. 21, 2025, 1:15 p.m. OK C++17 (GCC 7-32) TESTS 11 109 0
350010656 phanvien C2 Nov. 21, 2025, 2:45 a.m. OK C++17 (GCC 7-32) TESTS 11 109 0
350005346 chiennnnn C2 Nov. 21, 2025, 12:53 a.m. OK C++17 (GCC 7-32) TESTS 11 109 0
349997174 denary C2 Nov. 20, 2025, 9:23 p.m. OK C++17 (GCC 7-32) TESTS 11 109 0
350010403 sw2022 C2 Nov. 21, 2025, 2:40 a.m. OK C++17 (GCC 7-32) TESTS 11 109 1638400
350009713 sw2022 C2 Nov. 21, 2025, 2:28 a.m. OK C++17 (GCC 7-32) TESTS 11 109 1638400
350145763 akshatshah1605 C2 Nov. 22, 2025, 4:05 a.m. OK C++17 (GCC 7-32) TESTS 11 124 0
350141698 TANIM67 C2 Nov. 22, 2025, 2:47 a.m. OK C++20 (GCC 13-64) TESTS 11 93 0
350136500 Geothermal C2 Nov. 22, 2025, 12:44 a.m. OK C++20 (GCC 13-64) TESTS 11 93 0
350135056 turkhuu622 C2 Nov. 21, 2025, 11:55 p.m. OK C++20 (GCC 13-64) TESTS 11 93 0
350080892 MrMushroom C2 Nov. 21, 2025, 2:33 p.m. OK C++20 (GCC 13-64) TESTS 11 93 0
350006173 zzhtlx C2 Nov. 21, 2025, 1:13 a.m. OK C++20 (GCC 13-64) TESTS 11 93 0
350004948 ipanforever C2 Nov. 21, 2025, 12:42 a.m. OK C++20 (GCC 13-64) TESTS 11 93 0
350144579 czc_dashing C2 Nov. 22, 2025, 3:43 a.m. OK C++20 (GCC 13-64) TESTS 11 108 0
350134503 dip_sam C2 Nov. 21, 2025, 11:37 p.m. OK C++20 (GCC 13-64) TESTS 11 108 0
350111887 ThomasDB C2 Nov. 21, 2025, 6:26 p.m. OK C++20 (GCC 13-64) TESTS 11 108 0
350110359 TheKnightHawk C2 Nov. 21, 2025, 6:14 p.m. OK C++20 (GCC 13-64) TESTS 11 108 0
350117311 JavierAriasHe C2 Nov. 21, 2025, 7:12 p.m. OK C++23 (GCC 14-64, msys2) TESTS 11 93 0
350098561 vishaldangwal09 C2 Nov. 21, 2025, 4:40 p.m. OK C++23 (GCC 14-64, msys2) TESTS 11 93 0
350085822 Badbottle C2 Nov. 21, 2025, 3:08 p.m. OK C++23 (GCC 14-64, msys2) TESTS 11 93 0
350079548 YangJ1an C2 Nov. 21, 2025, 2:23 p.m. OK C++23 (GCC 14-64, msys2) TESTS 11 93 0
350060667 Michael_Kaiser_02 C2 Nov. 21, 2025, 11:59 a.m. OK C++23 (GCC 14-64, msys2) TESTS 11 93 0
350059176 arielmonster C2 Nov. 21, 2025, 11:47 a.m. OK C++23 (GCC 14-64, msys2) TESTS 11 93 0
350017145 soumyaxcoder C2 Nov. 21, 2025, 4:31 a.m. OK C++23 (GCC 14-64, msys2) TESTS 11 93 0
350016069 KalashShah C2 Nov. 21, 2025, 4:12 a.m. OK C++23 (GCC 14-64, msys2) TESTS 11 93 0
350014945 richsled C2 Nov. 21, 2025, 3:53 a.m. OK C++23 (GCC 14-64, msys2) TESTS 11 93 0
350014621 Scanffer C2 Nov. 21, 2025, 3:48 a.m. OK C++23 (GCC 14-64, msys2) TESTS 11 93 0
350016691 gxlois C2 Nov. 21, 2025, 4:23 a.m. OK D TESTS 11 500 37683200
349990191 posieDON99 C2 Nov. 20, 2025, 7:50 p.m. OK GNU C11 TESTS 11 139 1740800
350052585 junjun257 C2 Nov. 21, 2025, 10:52 a.m. OK GNU C11 TESTS 11 171 1638400
350114569 Pqrsaw C2 Nov. 21, 2025, 6:48 p.m. OK GNU C11 TESTS 11 187 36966400
350014821 uffhottie C2 Nov. 21, 2025, 3:50 a.m. OK Go TESTS 11 140 5017600
350098105 nguyennhat.110120 C2 Nov. 21, 2025, 4:37 p.m. OK Go TESTS 11 218 6246400
350018062 pri_singh C2 Nov. 21, 2025, 4:48 a.m. OK Java 21 TESTS 11 265 512000
350057777 sobhit_raghav C2 Nov. 21, 2025, 11:36 a.m. OK Java 21 TESTS 11 265 1024000
350017787 harsh_indoria C2 Nov. 21, 2025, 4:43 a.m. OK Java 21 TESTS 11 342 1638400
350075204 Spencer1s C2 Nov. 21, 2025, 1:52 p.m. OK Java 21 TESTS 11 343 4505600
350118433 NpHardcore_05 C2 Nov. 21, 2025, 7:22 p.m. OK Java 21 TESTS 11 358 716800
350078655 Kshitiz_san C2 Nov. 21, 2025, 2:17 p.m. OK Java 21 TESTS 11 358 5017600
350059222 sulabhambule C2 Nov. 21, 2025, 11:47 a.m. OK Java 21 TESTS 11 374 4812800
350012806 Diffusity_2005 C2 Nov. 21, 2025, 3:19 a.m. OK Java 21 TESTS 11 389 5939200
350077475 Spencer1s C2 Nov. 21, 2025, 2:08 p.m. OK Java 21 TESTS 11 390 4096000
350085427 Rajat633 C2 Nov. 21, 2025, 3:06 p.m. OK Java 21 TESTS 11 390 4198400
350069580 TejashRamdharani C2 Nov. 21, 2025, 1:09 p.m. OK Java 8 TESTS 11 218 3993600
350073194 TejashRamdharani C2 Nov. 21, 2025, 1:37 p.m. OK Java 8 TESTS 11 265 3993600
349990446 samamn_varshney C2 Nov. 20, 2025, 7:53 p.m. OK Java 8 TESTS 11 358 16384000
349994731 yashbansal99 C2 Nov. 20, 2025, 8:45 p.m. OK Java 8 TESTS 11 687 0
350106044 not_mohith C2 Nov. 21, 2025, 5:40 p.m. OK Java 8 TESTS 11 718 0
350119959 ronwonwon C2 Nov. 21, 2025, 7:36 p.m. OK Java 8 TESTS 11 734 8908800
350069377 SlavaG C2 Nov. 21, 2025, 1:08 p.m. OK Kotlin 2.2 TESTS 11 483 17305600
350123939 marcin7cd C2 Nov. 21, 2025, 8:16 p.m. OK PyPy 3 TESTS 11 1108 25395200
350110423 bisleribaddie C2 Nov. 21, 2025, 6:14 p.m. OK PyPy 3 TESTS 11 1296 22835200
350024515 henok_t_k C2 Nov. 21, 2025, 6:27 a.m. OK PyPy 3-64 TESTS 11 171 28262400
350070849 aa_despa C2 Nov. 21, 2025, 1:19 p.m. OK PyPy 3-64 TESTS 11 186 31744000
350035482 clonecuantan C2 Nov. 21, 2025, 8:30 a.m. OK PyPy 3-64 TESTS 11 187 38502400
350003627 lattermatter C2 Nov. 21, 2025, midnight OK PyPy 3-64 TESTS 11 202 25702400
350132619 OpKos C2 Nov. 21, 2025, 10:43 p.m. OK PyPy 3-64 TESTS 11 202 32563200
350095388 Equinox_Ya C2 Nov. 21, 2025, 4:17 p.m. OK PyPy 3-64 TESTS 11 202 33075200
349998517 newwares C2 Nov. 20, 2025, 9:47 p.m. OK PyPy 3-64 TESTS 11 202 33280000
350128023 DVP01 C2 Nov. 21, 2025, 9:08 p.m. OK PyPy 3-64 TESTS 11 202 34611200
350054652 lightningforce C2 Nov. 21, 2025, 11:10 a.m. OK PyPy 3-64 TESTS 11 202 35020800
350053201 kabir_singh C2 Nov. 21, 2025, 10:57 a.m. OK PyPy 3-64 TESTS 11 203 45670400
350076915 PVHKReddy C2 Nov. 21, 2025, 2:04 p.m. OK Python 3 TESTS 11 202 40038400
350153457 shaomai C2 Nov. 22, 2025, 5:57 a.m. OK Python 3 TESTS 11 249 40038400
350039758 skyoceanland C2 Nov. 21, 2025, 9:04 a.m. OK Python 3 TESTS 11 281 31334400
350137282 raghav_dev C2 Nov. 22, 2025, 1:07 a.m. OK Python 3 TESTS 11 343 31334400
350075645 ZonesTissyc C2 Nov. 21, 2025, 1:55 p.m. OK Python 3 TESTS 11 359 31334400
350029794 Pandit79 C2 Nov. 21, 2025, 7:31 a.m. OK Python 3 TESTS 11 406 31539200
350015655 alif25755 C2 Nov. 21, 2025, 4:04 a.m. OK Python 3 TESTS 11 1436 31436800
350126060 MishanyaSiu C2 Nov. 21, 2025, 8:42 p.m. OK Python 3 TESTS 11 1906 31334400
350042642 NagisaF C2 Nov. 21, 2025, 9:26 a.m. OK Rust 2021 TESTS 11 77 1331200
350120922 Monster027 C2 Nov. 21, 2025, 7:45 p.m. OK Rust 2024 TESTS 11 77 4505600
350003482 despair C2 Nov. 20, 2025, 11:56 p.m. OK Rust 2024 TESTS 11 78 1433600
350123250 _JG_ C2 Nov. 21, 2025, 8:08 p.m. OK Rust 2024 TESTS 11 124 819200

remove filters

Back to search problems