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 |
|---|---|---|---|---|---|---|
| 2230 | Educational Codeforces Round 190 (Rated for Div. 2) | FINISHED | False | 7200 | 2474675 | May 18, 2026, 2:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 436 ) | F | Game on Growing Tree | PROGRAMMING | binary search dfs and similar dp games trees |
Consider a game for two players: Alice and Bob. They have a tree (T); initially, every vertex of this tree is white . Alice and Bob take turns: Alice goes first, then Bob, then Alice again, then Bob again, and so on. During Alice's first turn, she has to choose a vertex and put a chip in it, then paint the chosen vertex red . During every turn except for the first one, Alice has to move the chip into an adjacent white vertex and paint that vertex red . If, at the start of Alice's turn, there are no white vertices adjacent to the vertex with the chip, the game ends. During each of Bob's turns, he has to choose a white vertex and paint it blue . If there are no white vertices in the tree at the start of Bob's turn, the game ends. The final score of the game is the number of red vertices. Alice wants to maximize the score, Bob wants to minimize it. Both players play optimally. This is the description of the game. The statement of the problem follows. You are given a tree, initially consisting of only one vertex numbered (1). Then, (q) queries are performed; during the (i)-th query, a new vertex is added to the tree; this new vertex gets the number ((i+1)) and is connected to the vertex (v_i) by an edge. After each query, you have to print the final score of the game if Alice and Bob play on the current tree. The first line contains one integer (q) ((1 \le q \le 2 \cdot 10^5)) — the number of queries. The second line contains (q) integers (v_1, v_2, \dots, v_q) ((1 \le v_i \le i)), where (v_i) is the vertex that gets connected with the vertex ((i+1)) during the (i)-th query. Print (q) integers; the (i)-th of these integers should be the score if Alice and Bob play on the tree that you get after processing the (i)-th query. |
| Educational Codeforces Round 190 — Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 375163436 | dinohaur | F | May 18, 2026, 6:58 p.m. | OK | C++17 (GCC 7-32) | TESTS | 44 | 203 | 7680000 | ||
| 375139286 | ProvenConjecture | F | May 18, 2026, 4:10 p.m. | OK | C++17 (GCC 7-32) | TESTS | 44 | 234 | 30310400 | ||
| 375149051 | Bubbleawa | F | May 18, 2026, 4:34 p.m. | OK | C++17 (GCC 7-32) | TESTS | 44 | 250 | 31846400 | ||
| 375174211 | kalimm | F | May 18, 2026, 10:39 p.m. | OK | C++17 (GCC 7-32) | TESTS | 44 | 265 | 20684800 | ||
| 375152333 | potato167 | F | May 18, 2026, 5:02 p.m. | OK | C++17 (GCC 7-32) | TESTS | 44 | 296 | 19865600 | ||
| 375151211 | dsainvg | F | May 18, 2026, 4:50 p.m. | OK | C++17 (GCC 7-32) | TESTS | 44 | 296 | 26316800 | ||
| 375156296 | Nitter | F | May 18, 2026, 5:40 p.m. | OK | C++17 (GCC 7-32) | TESTS | 44 | 296 | 26726400 | ||
| 375140794 | coder2803 | F | May 18, 2026, 4:14 p.m. | OK | C++17 (GCC 7-32) | TESTS | 44 | 328 | 42700800 | ||
| 375176041 | vgo96 | F | May 18, 2026, 11:46 p.m. | OK | C++17 (GCC 7-32) | TESTS | 44 | 328 | 55398400 | ||
| 375152358 | Ijichi_Nijika | F | May 18, 2026, 5:02 p.m. | OK | C++17 (GCC 7-32) | TESTS | 44 | 515 | 8601600 | ||
| 375146090 | ManavH | F | May 18, 2026, 4:28 p.m. | OK | C++20 (GCC 13-64) | TESTS | 44 | 156 | 51302400 | ||
| 375146329 | dugu_qiubai | F | May 18, 2026, 4:28 p.m. | OK | C++20 (GCC 13-64) | TESTS | 44 | 187 | 47820800 | ||
| 375148653 | _nothuman444 | F | May 18, 2026, 4:34 p.m. | OK | C++20 (GCC 13-64) | TESTS | 44 | 203 | 21504000 | ||
| 375144072 | Intellegent | F | May 18, 2026, 4:23 p.m. | OK | C++20 (GCC 13-64) | TESTS | 44 | 218 | 11878400 | ||
| 375146138 | silverbullet_4869 | F | May 18, 2026, 4:28 p.m. | OK | C++20 (GCC 13-64) | TESTS | 44 | 218 | 30822400 | ||
| 375189901 | serein514 | F | May 19, 2026, 4:57 a.m. | OK | C++20 (GCC 13-64) | TESTS | 44 | 218 | 35942400 | ||
| 375136169 | StarSilk | F | May 18, 2026, 4:02 p.m. | OK | C++20 (GCC 13-64) | TESTS | 44 | 250 | 112537600 | ||
| 375141036 | howD | F | May 18, 2026, 4:15 p.m. | OK | C++20 (GCC 13-64) | TESTS | 44 | 281 | 36761600 | ||
| 375149190 | istillsurvivewithasmile | F | May 18, 2026, 4:34 p.m. | OK | C++20 (GCC 13-64) | TESTS | 44 | 296 | 68505600 | ||
| 375185418 | Deamer | F | May 19, 2026, 3:35 a.m. | OK | C++20 (GCC 13-64) | TESTS | 44 | 296 | 480972800 | ||
| 375145595 | DinhCongVan | F | May 18, 2026, 4:27 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 44 | 203 | 34304000 | ||
| 375188644 | Bonelight | F | May 19, 2026, 4:36 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 44 | 218 | 14438400 | ||
| 375192129 | CSQ31 | F | May 19, 2026, 5:29 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 44 | 218 | 18636800 | ||
| 375148058 | rahmat909009 | F | May 18, 2026, 4:32 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 44 | 218 | 29900800 | ||
| 375193762 | magikrap | F | May 19, 2026, 5:52 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 44 | 218 | 61747200 | ||
| 375144384 | Sam706870 | F | May 18, 2026, 4:23 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 44 | 234 | 43315200 | ||
| 375160179 | keainienie | F | May 18, 2026, 6:19 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 44 | 234 | 55808000 | ||
| 375194023 | magikrap | F | May 19, 2026, 5:56 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 44 | 234 | 68096000 | ||
| 375145797 | Nachia | F | May 18, 2026, 4:27 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 44 | 265 | 53964800 | ||
| 375165433 | xooks_1434 | F | May 18, 2026, 7:26 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 44 | 281 | 26316800 | ||
| 375144267 | loveax | F | May 18, 2026, 4:23 p.m. | OK | GNU C11 | TESTS | 44 | 281 | 66252800 | ||
| 375157515 | daniel.glabai | F | May 18, 2026, 5:52 p.m. | OK | Java 21 | TESTS | 44 | 781 | 46796800 | ||
| 375148150 | Doflaming0 | F | May 18, 2026, 4:33 p.m. | OK | PyPy 3-64 | TESTS | 44 | 843 | 78745600 | ||
| 375148328 | GarvitGaur | F | May 18, 2026, 4:33 p.m. | OK | PyPy 3-64 | TESTS | 44 | 1093 | 178380800 | ||
| 375158302 | martin0248159 | F | May 18, 2026, 6 p.m. | OK | PyPy 3-64 | TESTS | 44 | 1875 | 511078400 | ||
| 375143476 | Shahat0209 | F | May 18, 2026, 4:21 p.m. | OK | Python 3 | TESTS | 44 | 3500 | 84172800 |
Back to search problems