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 |
|---|---|---|---|---|---|---|
| 2066 | Codeforces Round 1004 (Div. 1) | FINISHED | False | 7200 | 37121123 | Feb. 11, 2025, 2:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 2444 ) | C | Bitwise Slides | PROGRAMMING | bitmasks combinatorics dp math |
You are given an array (a_1, a_2, \ldots, a_n). Also, you are given three variables (P,Q,R), initially equal to zero. You need to process all the numbers (a_1, a_2, \ldots, a_n), in the order from (1) to (n) . When processing the next (a_i), you must perform exactly one of the three actions of your choice: (P := P \oplus a_i) (Q := Q \oplus a_i) (R := R \oplus a_i) (\oplus) denotes the bitwise XOR operation . When performing actions, you must follow the main rule : it is necessary that after each action, all three numbers (P,Q,R) are not pairwise distinct. There are a total of (3^n) ways to perform all (n) actions. How many of them do not violate the main rule ? Since the answer can be quite large, find it modulo (10^9 + 7). 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 an integer (n) ((1 \le n \le 2 \cdot 10^5)) — 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 \le 10^9)) — the elements of the array (a). It is guaranteed that the sum of the values of (n) for all test cases does not exceed (2 \cdot 10^5). For each test case, output the number of ways to perform all (n) actions without violating the main rule , modulo (10^9 + 7). In the first test case, there are 3 valid sequences of operations: PPP , QQQ , RRR . In the second test case, there are 9 valid sequences of operations: PPPP , PPPQ , PPPR , QQQP , QQQQ , QQQR , RRRP , RRRQ , RRRR . |
| 139415 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 305762361 | mban259 | C | Feb. 12, 2025, 5:51 a.m. | OK | C# 10 | TESTS | 20 | 187 | 29491200 | ||
| 305697688 | Amao_Fox | C | Feb. 11, 2025, 4:32 p.m. | OK | C++17 (GCC 7-32) | TESTS | 20 | 109 | 3276800 | ||
| 305678740 | unordered_map | C | Feb. 11, 2025, 4 p.m. | OK | C++17 (GCC 7-32) | TESTS | 20 | 109 | 4812800 | ||
| 305657435 | AlienAre | C | Feb. 11, 2025, 3:25 p.m. | OK | C++17 (GCC 7-32) | TESTS | 20 | 124 | 4915200 | ||
| 305673570 | XiaY | C | Feb. 11, 2025, 3:51 p.m. | OK | C++17 (GCC 7-32) | TESTS | 20 | 124 | 8192000 | ||
| 305672452 | SuRiNonSul | C | Feb. 11, 2025, 3:49 p.m. | OK | C++17 (GCC 7-32) | TESTS | 20 | 139 | 0 | ||
| 305693629 | NeverGonnaKnowWhoIAm | C | Feb. 11, 2025, 4:27 p.m. | OK | C++17 (GCC 7-32) | TESTS | 20 | 139 | 102400 | ||
| 305740991 | lwm7708 | C | Feb. 12, 2025, 12:22 a.m. | OK | C++17 (GCC 7-32) | TESTS | 20 | 140 | 0 | ||
| 305726741 | -adhd- | C | Feb. 11, 2025, 8:22 p.m. | OK | C++17 (GCC 7-32) | TESTS | 20 | 140 | 0 | ||
| 305671482 | AliiSh | C | Feb. 11, 2025, 3:48 p.m. | OK | C++17 (GCC 7-32) | TESTS | 20 | 140 | 0 | ||
| 305675054 | kes0716 | C | Feb. 11, 2025, 3:54 p.m. | OK | C++17 (GCC 7-32) | TESTS | 20 | 140 | 102400 | ||
| 305742196 | thunder_pie | C | Feb. 12, 2025, 12:50 a.m. | OK | C++20 (GCC 13-64) | TESTS | 20 | 93 | 1331200 | ||
| 305749644 | yoru_sacri | C | Feb. 12, 2025, 3:05 a.m. | OK | C++20 (GCC 13-64) | TESTS | 20 | 108 | 102400 | ||
| 305676706 | fydj | C | Feb. 11, 2025, 3:57 p.m. | OK | C++20 (GCC 13-64) | TESTS | 20 | 108 | 3788800 | ||
| 305696114 | Apteryxx | C | Feb. 11, 2025, 4:30 p.m. | OK | C++20 (GCC 13-64) | TESTS | 20 | 109 | 102400 | ||
| 305664461 | kmjp | C | Feb. 11, 2025, 3:36 p.m. | OK | C++20 (GCC 13-64) | TESTS | 20 | 109 | 921600 | ||
| 305684842 | loK10 | C | Feb. 11, 2025, 4:11 p.m. | OK | C++20 (GCC 13-64) | TESTS | 20 | 109 | 1638400 | ||
| 305663261 | EasonTAO | C | Feb. 11, 2025, 3:34 p.m. | OK | C++20 (GCC 13-64) | TESTS | 20 | 109 | 4812800 | ||
| 305691541 | Shoo | C | Feb. 11, 2025, 4:24 p.m. | OK | C++20 (GCC 13-64) | TESTS | 20 | 109 | 8089600 | ||
| 305680578 | H_W_Y | C | Feb. 11, 2025, 4:04 p.m. | OK | C++20 (GCC 13-64) | TESTS | 20 | 109 | 8089600 | ||
| 305678578 | xiaopangfeiyu | C | Feb. 11, 2025, 4 p.m. | OK | C++20 (GCC 13-64) | TESTS | 20 | 109 | 8089600 | ||
| 305695792 | cmk666 | C | Feb. 11, 2025, 4:29 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 20 | 93 | 1331200 | ||
| 305746551 | 424479543 | C | Feb. 12, 2025, 2:15 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 20 | 108 | 102400 | ||
| 305678308 | MattTheNub | C | Feb. 11, 2025, 4 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 20 | 108 | 102400 | ||
| 305653856 | ecnerwala | C | Feb. 11, 2025, 3:20 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 20 | 108 | 307200 | ||
| 305748601 | pengpeng_fudan | C | Feb. 12, 2025, 2:49 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 20 | 109 | 0 | ||
| 305715791 | Drew_ | C | Feb. 11, 2025, 6:34 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 20 | 109 | 0 | ||
| 305669479 | fastmath | C | Feb. 11, 2025, 3:44 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 20 | 109 | 0 | ||
| 305684269 | rniya | C | Feb. 11, 2025, 4:10 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 20 | 109 | 102400 | ||
| 305674552 | katyaporay | C | Feb. 11, 2025, 3:53 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 20 | 109 | 102400 | ||
| 305667557 | t9unkubj | C | Feb. 11, 2025, 3:41 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 20 | 109 | 102400 | ||
| 305673064 | Gassa | C | Feb. 11, 2025, 3:50 p.m. | OK | D | TESTS | 20 | 156 | 16179200 | ||
| 305736130 | Gassa | C | Feb. 11, 2025, 10:18 p.m. | OK | D | TESTS | 20 | 187 | 10649600 | ||
| 305741773 | rainboy | C | Feb. 12, 2025, 12:40 a.m. | OK | GNU C11 | TESTS | 20 | 124 | 3276800 | ||
| 305690115 | baoziiQwQ | C | Feb. 11, 2025, 4:21 p.m. | OK | Go | TESTS | 20 | 234 | 7884800 | ||
| 305677515 | Quasicoherent | C | Feb. 11, 2025, 3:58 p.m. | OK | Java 21 | TESTS | 20 | 389 | 3993600 | ||
| 305682729 | Electromaster | C | Feb. 11, 2025, 4:07 p.m. | OK | Kotlin 1.9 | TESTS | 20 | 375 | 5120000 | ||
| 305745048 | smilences | C | Feb. 12, 2025, 1:47 a.m. | OK | PyPy 3-64 | TESTS | 20 | 156 | 30720000 | ||
| 305743540 | smilences | C | Feb. 12, 2025, 1:19 a.m. | OK | PyPy 3-64 | TESTS | 20 | 186 | 29184000 | ||
| 305685929 | eepsilon | C | Feb. 11, 2025, 4:13 p.m. | OK | PyPy 3-64 | TESTS | 20 | 202 | 34611200 | ||
| 305694083 | toam | C | Feb. 11, 2025, 4:28 p.m. | OK | PyPy 3-64 | TESTS | 20 | 234 | 30617600 | ||
| 305675329 | Alex239 | C | Feb. 11, 2025, 3:54 p.m. | OK | PyPy 3-64 | TESTS | 20 | 249 | 23347200 | ||
| 305742177 | conqueror_of_tourist | C | Feb. 12, 2025, 12:50 a.m. | OK | PyPy 3-64 | TESTS | 20 | 265 | 30310400 | ||
| 305675114 | 16777216 | C | Feb. 11, 2025, 3:54 p.m. | OK | PyPy 3-64 | TESTS | 20 | 281 | 30412800 | ||
| 305688638 | Mukundan314 | C | Feb. 11, 2025, 4:19 p.m. | OK | PyPy 3-64 | TESTS | 20 | 359 | 25804800 | ||
| 305681351 | dyppp | C | Feb. 11, 2025, 4:05 p.m. | OK | PyPy 3-64 | TESTS | 20 | 578 | 50380800 | ||
| 305654353 | aPNJ777 | C | Feb. 11, 2025, 3:21 p.m. | OK | PyPy 3-64 | TESTS | 20 | 796 | 29900800 | ||
| 305656604 | Egor | C | Feb. 11, 2025, 3:24 p.m. | OK | Rust 2021 | TESTS | 20 | 93 | 0 | ||
| 305656507 | sansen | C | Feb. 11, 2025, 3:24 p.m. | OK | Rust 2021 | TESTS | 20 | 93 | 3379200 | ||
| 305671437 | cologne1723 | C | Feb. 11, 2025, 3:47 p.m. | OK | Rust 2021 | TESTS | 20 | 108 | 3379200 |
Back to search problems