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 |
|---|---|---|---|---|---|---|
| 2214 | April Fools Day Contest 2026 | FINISHED | False | 7200 | 5412296 | April 1, 2026, 2:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 311 ) | I | You Are a Robot | PROGRAMMING | *special |
There is a track system consisting of (n) intersections, numbered from (1) to (n). The track forms a tree rooted at intersection (1). An unstoppable trolley starts at intersection (1) and moves along the edges of the tree. Each edge, corresponding to a track segment, contains one of the following: a human, a robot, nothing. You are a robot, and all robots share a unified mind. You can control the direction of the trolley at any intersection it arrives at. The trolley stops when there are no further directions it can take. Determine the intersection at which the trolley will stop. If there are multiple possible answers, you may output any. Each test contains multiple test cases. The first line contains a single 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 integer (n) ((1 \le n \le 2 \cdot 10^5)) — the number of intersections. The second line of each test case contains (n - 1) integers (p_2, p_3, \ldots, p_n) ((1 \le p_i \lt i)), where (p_i) denotes the parent of intersection (i) in the tree. The third line of each test case contains (n - 1) integers (a_2, a_3, \ldots, a_n) ((0 \le a_i \le 2)), where (a_i) describes the type of the track segment between node (p_i) and node (i): (0) denotes an empty segment, (1) denotes a human, (2) denotes a robot. The sum of (n) over all test cases does not exceed (2 \cdot 10^5). For each test case, output a single integer denoting a possible answer. If there are multiple possible answers, you may output any. |
| April Fools Day Contest 2026 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 369253450 | 135678942570 | I | April 1, 2026, 4:25 p.m. | OK | C++17 (GCC 7-32) | TESTS | 15 | 93 | 102400 | ||
| 369277633 | Photon_ | I | April 1, 2026, 6:26 p.m. | OK | C++17 (GCC 7-32) | TESTS | 15 | 109 | 4505600 | ||
| 369269432 | pandaa73 | I | April 1, 2026, 5:26 p.m. | OK | C++17 (GCC 7-32) | TESTS | 15 | 125 | 4505600 | ||
| 369298737 | CAELO | I | April 2, 2026, 1:13 a.m. | OK | C++17 (GCC 7-32) | TESTS | 15 | 156 | 3788800 | ||
| 369259336 | MCPlayer542 | I | April 1, 2026, 4:33 p.m. | OK | C++17 (GCC 7-32) | TESTS | 15 | 156 | 6451200 | ||
| 369302762 | masy2011 | I | April 2, 2026, 2:41 a.m. | OK | C++17 (GCC 7-32) | TESTS | 15 | 312 | 2662400 | ||
| 369301970 | cmbzdq | I | April 2, 2026, 2:27 a.m. | OK | C++17 (GCC 7-32) | TESTS | 15 | 312 | 2662400 | ||
| 369266054 | hihitherethere | I | April 1, 2026, 5:04 p.m. | OK | C++17 (GCC 7-32) | TESTS | 15 | 578 | 12185600 | ||
| 369293762 | Pisatel | I | April 1, 2026, 10:34 p.m. | OK | C++20 (GCC 13-64) | TESTS | 15 | 93 | 0 | ||
| 369298537 | rui_er | I | April 2, 2026, 1:08 a.m. | OK | C++20 (GCC 13-64) | TESTS | 15 | 93 | 4096000 | ||
| 369262810 | Noobish_Monk | I | April 1, 2026, 4:44 p.m. | OK | C++20 (GCC 13-64) | TESTS | 15 | 109 | 102400 | ||
| 369291139 | GuilhermeKK | I | April 1, 2026, 9:21 p.m. | OK | C++20 (GCC 13-64) | TESTS | 15 | 125 | 7270400 | ||
| 369279396 | arthurxu17 | I | April 1, 2026, 6:42 p.m. | OK | C++20 (GCC 13-64) | TESTS | 15 | 125 | 7372800 | ||
| 369282014 | Igorjan94 | I | April 1, 2026, 7:08 p.m. | OK | C++20 (GCC 13-64) | TESTS | 15 | 125 | 8192000 | ||
| 369255114 | yrbDoshaYt2hlACPC | I | April 1, 2026, 4:28 p.m. | OK | C++20 (GCC 13-64) | TESTS | 15 | 125 | 12185600 | ||
| 369302444 | benben181 | I | April 2, 2026, 2:36 a.m. | OK | C++20 (GCC 13-64) | TESTS | 15 | 140 | 7270400 | ||
| 369265434 | CReatiQ | I | April 1, 2026, 4:59 p.m. | OK | C++20 (GCC 13-64) | TESTS | 15 | 140 | 11161600 | ||
| 369302583 | rodrigojamunda82_ | I | April 2, 2026, 2:38 a.m. | OK | C++20 (GCC 13-64) | TESTS | 15 | 140 | 12390400 | ||
| 369263512 | madhveshgupta | I | April 1, 2026, 4:48 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 15 | 93 | 102400 | ||
| 369294592 | CrafterKolyan | I | April 1, 2026, 11:06 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 15 | 93 | 204800 | ||
| 369257620 | Franuch | I | April 1, 2026, 4:31 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 15 | 93 | 1126400 | ||
| 369266067 | GUAIKATTO | I | April 1, 2026, 5:04 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 15 | 93 | 1331200 | ||
| 369255669 | neev_mittal | I | April 1, 2026, 4:28 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 15 | 93 | 2662400 | ||
| 369269782 | snowysecret | I | April 1, 2026, 5:29 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 15 | 93 | 2867200 | ||
| 369262530 | permutation | I | April 1, 2026, 4:43 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 15 | 93 | 9216000 | ||
| 369256267 | udayan8 | I | April 1, 2026, 4:29 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 15 | 109 | 204800 | ||
| 369261892 | Maksim1744 | I | April 1, 2026, 4:40 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 15 | 109 | 7680000 | ||
| 369264071 | monaxia | I | April 1, 2026, 4:51 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 15 | 125 | 4915200 | ||
| 369304903 | Saumya1708 | I | April 2, 2026, 3:20 a.m. | OK | Java 21 | TESTS | 17 | 984 | 68198400 | ||
| 369254777 | yg.margo | I | April 1, 2026, 4:27 p.m. | OK | Kotlin 2.2 | TESTS | 15 | 125 | 23756800 | ||
| 369301175 | Xellos | I | April 2, 2026, 2:10 a.m. | OK | PyPy 3-64 | TESTS | 15 | 171 | 35430400 | ||
| 369295416 | iedfa | I | April 1, 2026, 11:40 p.m. | OK | PyPy 3-64 | TESTS | 15 | 265 | 44134400 | ||
| 369258246 | Ergodic137 | I | April 1, 2026, 4:31 p.m. | OK | PyPy 3-64 | TESTS | 15 | 265 | 52428800 | ||
| 369260845 | Hallowno4 | I | April 1, 2026, 4:34 p.m. | OK | PyPy 3-64 | TESTS | 15 | 328 | 36659200 | ||
| 369269456 | KevZ3742 | I | April 1, 2026, 5:27 p.m. | OK | PyPy 3-64 | TESTS | 15 | 328 | 41062400 | ||
| 369270594 | adityano1 | I | April 1, 2026, 5:35 p.m. | OK | Python 3 | TESTS | 15 | 312 | 24576000 | ||
| 369260336 | twotilde | I | April 1, 2026, 4:34 p.m. | OK | Python 3 | TESTS | 15 | 468 | 49561600 | ||
| 369269552 | Liudas | I | April 1, 2026, 5:27 p.m. | OK | Python 3 | TESTS | 15 | 500 | 34713600 | ||
| 369260210 | failedbun | I | April 1, 2026, 4:34 p.m. | OK | Python 3 | TESTS | 15 | 515 | 54988800 |
Back to search problems