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 |
|---|---|---|---|---|---|---|
| 2239 | Codeforces Round 1105 (Div. 1) | FINISHED | False | 9000 | 3338710 | June 27, 2026, 2:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 8899 ) | A | Nim Game Is XOR Game | PROGRAMMING | bitmasks constructive algorithms games greedy math |
Alice and Bob are playing a game with an array (a) consisting of (n) non-negative integers. Alice goes first. In each turn, the current player must choose an array of (n) non-negative integers (b = b_1, b_2, \ldots, b_n) that satisfies the following conditions: (0 \le b_i \le a_i) for all (1 \le i \le n); (\sum_{i=1}^n b_i \gt 0) (i.e. the array (b) does not consist entirely of zeros); (b_1 \oplus b_2 \oplus \ldots \oplus b_n = 0), where (\oplus) denotes the bitwise XOR operation . After choosing the array (b), the player updates the array (a) by performing (a_i \leftarrow a_i - b_i) for all (1 \le i \le n). The player who cannot perform such an operation loses the game. Determine the number of valid choices for the array (b) that Alice can make on her first turn to guarantee a win, assuming both players play optimally. Since this number may be large, output the answer modulo (998\,244\,353). 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) ((1 \le n \le 10^6)) — the length of the array (a). The second line of each test case contains (n) integers (a_1, a_2, \ldots, a_n) ((1 \le a_i \lt 2^{30})) — the contents of the array (a) It is guaranteed that the sum of (n) over all test cases does not exceed (10^6). For each test case, output the number of valid choices for the array (b) that Alice can make on her first turn to guarantee a win modulo (998\,244\,353). In the first test case, Alice must choose an array (b) of length (1). The conditions require (b_1 \le a_1), (b_1 \gt 0), and (b_1 = 0). It is impossible to satisfy (b_1 \gt 0) and (b_1 = 0) simultaneously. Thus, Alice has no valid moves and loses immediately. The answer is (0). In the sec |
| Codeforces Round 1105 (Div. 1, Div. 2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 380330814 | -firefly- | A | June 27, 2026, 2:53 p.m. | OK | C# 13 | TESTS | 5 | 375 | 4608000 | ||
| 380323022 | oceeff | A | June 27, 2026, 2:39 p.m. | OK | C++17 (GCC 7-32) | TESTS | 5 | 46 | 6144000 | ||
| 380329859 | WisedomCasual | A | June 27, 2026, 2:51 p.m. | OK | C++17 (GCC 7-32) | TESTS | 5 | 187 | 102400 | ||
| 380379194 | Potassium | A | June 27, 2026, 6:37 p.m. | OK | C++17 (GCC 7-32) | TESTS | 5 | 203 | 0 | ||
| 380378013 | dragonalt | A | June 27, 2026, 6:22 p.m. | OK | C++17 (GCC 7-32) | TESTS | 5 | 203 | 0 | ||
| 380324652 | potato167 | A | June 27, 2026, 2:42 p.m. | OK | C++17 (GCC 7-32) | TESTS | 5 | 203 | 0 | ||
| 380378713 | nokib | A | June 27, 2026, 6:30 p.m. | OK | C++17 (GCC 7-32) | TESTS | 5 | 203 | 102400 | ||
| 380349770 | TSU-001 | A | June 27, 2026, 3:37 p.m. | OK | C++17 (GCC 7-32) | TESTS | 5 | 203 | 3993600 | ||
| 380332338 | knightL | A | June 27, 2026, 2:55 p.m. | OK | C++17 (GCC 7-32) | TESTS | 5 | 203 | 3993600 | ||
| 380331622 | JaeminPark | A | June 27, 2026, 2:54 p.m. | OK | C++17 (GCC 7-32) | TESTS | 5 | 203 | 3993600 | ||
| 380330315 | vnedu | A | June 27, 2026, 2:52 p.m. | OK | C++17 (GCC 7-32) | TESTS | 5 | 203 | 3993600 | ||
| 380409265 | Milkcat2009 | A | June 28, 2026, 3:15 a.m. | OK | C++20 (GCC 13-64) | TESTS | 5 | 31 | 6144000 | ||
| 380323579 | permutation | A | June 27, 2026, 2:40 p.m. | OK | C++20 (GCC 13-64) | TESTS | 5 | 46 | 102400 | ||
| 380323700 | shiomusubi496 | A | June 27, 2026, 2:40 p.m. | OK | C++20 (GCC 13-64) | TESTS | 5 | 46 | 4710400 | ||
| 380324352 | BoaHancock | A | June 27, 2026, 2:42 p.m. | OK | C++20 (GCC 13-64) | TESTS | 5 | 62 | 4096000 | ||
| 380327860 | kaichou243 | A | June 27, 2026, 2:47 p.m. | OK | C++20 (GCC 13-64) | TESTS | 5 | 62 | 6553600 | ||
| 380343086 | fydj | A | June 27, 2026, 3:19 p.m. | OK | C++20 (GCC 13-64) | TESTS | 5 | 78 | 6144000 | ||
| 380331886 | lbmzxhb | A | June 27, 2026, 2:55 p.m. | OK | C++20 (GCC 13-64) | TESTS | 5 | 78 | 7987200 | ||
| 380384142 | radoslav11 | A | June 27, 2026, 7:32 p.m. | OK | C++20 (GCC 13-64) | TESTS | 5 | 125 | 102400 | ||
| 380327696 | 314tonick | A | June 27, 2026, 2:47 p.m. | OK | C++20 (GCC 13-64) | TESTS | 5 | 140 | 102400 | ||
| 380391335 | dp_coder | A | June 27, 2026, 8:43 p.m. | OK | C++20 (GCC 13-64) | TESTS | 5 | 156 | 102400 | ||
| 380325765 | Sulfox | A | June 27, 2026, 2:44 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 5 | 31 | 3276800 | ||
| 380323874 | maspy | A | June 27, 2026, 2:41 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 5 | 46 | 4403200 | ||
| 380328478 | LastKismet | A | June 27, 2026, 2:48 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 5 | 46 | 6144000 | ||
| 380325267 | woyebuzhidaowoshishui | A | June 27, 2026, 2:43 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 5 | 46 | 6144000 | ||
| 380324081 | 2sqrt3 | A | June 27, 2026, 2:41 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 5 | 46 | 6144000 | ||
| 380329854 | gunuozhang | A | June 27, 2026, 2:51 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 5 | 46 | 8192000 | ||
| 380327405 | iforandom | A | June 27, 2026, 2:47 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 5 | 46 | 10137600 | ||
| 380327603 | gty314159 | A | June 27, 2026, 2:47 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 5 | 125 | 3993600 | ||
| 380329486 | www_bilibili_com | A | June 27, 2026, 2:50 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 5 | 125 | 4096000 | ||
| 380329941 | Pt.ll | A | June 27, 2026, 2:51 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 5 | 125 | 8089600 | ||
| 380326086 | Gassa | A | June 27, 2026, 2:44 p.m. | OK | D | TESTS | 5 | 312 | 52736000 | ||
| 380322529 | hos.lyric | A | June 27, 2026, 2:38 p.m. | OK | D | TESTS | 5 | 359 | 55808000 | ||
| 380334409 | 101Noir | A | June 27, 2026, 2:59 p.m. | OK | Go | TESTS | 5 | 406 | 9420800 | ||
| 380323324 | gofrozen21 | A | June 27, 2026, 2:40 p.m. | OK | Java 21 | TESTS | 5 | 156 | 0 | ||
| 380372601 | Sumit_y_04nov | A | June 27, 2026, 5:24 p.m. | OK | Java 21 | TESTS | 5 | 203 | 921600 | ||
| 380325516 | nathanballman | A | June 27, 2026, 2:43 p.m. | OK | Java 21 | TESTS | 5 | 437 | 36454400 | ||
| 380324395 | LT1 | A | June 27, 2026, 2:42 p.m. | OK | Java 21 | TESTS | 5 | 453 | 37478400 | ||
| 380333330 | hardgonnapass | A | June 27, 2026, 2:57 p.m. | OK | Java 8 | TESTS | 5 | 218 | 0 | ||
| 380329600 | malachi_toney_goat | A | June 27, 2026, 2:50 p.m. | OK | Java 8 | TESTS | 5 | 328 | 70348800 | ||
| 380322912 | arvindf232 | A | June 27, 2026, 2:39 p.m. | OK | Kotlin 2.2 | TESTS | 5 | 234 | 0 | ||
| 380334863 | bitplease_ | A | June 27, 2026, 3 p.m. | OK | Node.js | TESTS | 5 | 156 | 24678400 | ||
| 380327064 | sos89756 | A | June 27, 2026, 2:46 p.m. | OK | PyPy 3 | TESTS | 5 | 1078 | 74444800 | ||
| 380324450 | toam | A | June 27, 2026, 2:42 p.m. | OK | PyPy 3-64 | TESTS | 5 | 203 | 115097600 | ||
| 380332138 | Maruzensky | A | June 27, 2026, 2:55 p.m. | OK | PyPy 3-64 | TESTS | 5 | 203 | 115200000 | ||
| 380383242 | TheAppleTree | A | June 27, 2026, 7:24 p.m. | OK | PyPy 3-64 | TESTS | 5 | 203 | 115404800 | ||
| 380329816 | mikelou | A | June 27, 2026, 2:51 p.m. | OK | PyPy 3-64 | TESTS | 5 | 218 | 119705600 | ||
| 380333277 | Mentholzzz | A | June 27, 2026, 2:57 p.m. | OK | PyPy 3-64 | TESTS | 5 | 234 | 89395200 | ||
| 380328088 | flakepym | A | June 27, 2026, 2:48 p.m. | OK | PyPy 3-64 | TESTS | 5 | 234 | 115200000 | ||
| 380382622 | BLAZEXZ | A | June 27, 2026, 7:18 p.m. | OK | PyPy 3-64 | TESTS | 5 | 234 | 124006400 | ||
| 380331538 | harurun4635 | A | June 27, 2026, 2:54 p.m. | OK | PyPy 3-64 | TESTS | 5 | 250 | 98611200 | ||
| 380381257 | haragr10 | A | June 27, 2026, 7:06 p.m. | OK | PyPy 3-64 | TESTS | 5 | 250 | 112435200 | ||
| 380390176 | user_not_found_404___ | A | June 27, 2026, 8:32 p.m. | OK | PyPy 3-64 | TESTS | 5 | 250 | 115097600 | ||
| 380325266 | Midhilesh | A | June 27, 2026, 2:43 p.m. | OK | Python 3 | TESTS | 5 | 265 | 105369600 | ||
| 380329063 | maworkin | A | June 27, 2026, 2:49 p.m. | OK | Python 3 | TESTS | 5 | 421 | 73523200 | ||
| 380402897 | Los_Combinasionas | A | June 27, 2026, 11:48 p.m. | OK | Python 3 | TESTS | 5 | 500 | 119910400 | ||
| 380326270 | sansen | A | June 27, 2026, 2:45 p.m. | OK | Rust 2021 | TESTS | 5 | 46 | 22323200 | ||
| 380331362 | DanielAnker | A | June 27, 2026, 2:54 p.m. | OK | Rust 2024 | TESTS | 5 | 46 | 21196800 | ||
| 380325234 | Solalyth | A | June 27, 2026, 2:43 p.m. | OK | Rust 2024 | TESTS | 5 | 46 | 41267200 | ||
| 380325309 | Egor | A | June 27, 2026, 2:43 p.m. | OK | Rust 2024 | TESTS | 5 | 62 | 307200 | ||
| 380331989 | darkkcyan | A | June 27, 2026, 2:55 p.m. | OK | Rust 2024 | TESTS | 5 | 62 | 24473600 | ||
| 380335691 | cvs-650 | A | June 27, 2026, 3:02 p.m. | OK | Rust 2024 | TESTS | 5 | 62 | 26214400 | ||
| 380326036 | qwerty787788 | A | June 27, 2026, 2:44 p.m. | OK | Rust 2024 | TESTS | 5 | 218 | 3993600 |
Back to search problems