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 |
|---|---|---|---|---|---|---|
| 2028 | Codeforces Round 986 (Div. 2) | FINISHED | False | 7200 | 45152723 | Nov. 10, 2024, 3:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 1892 ) | E | Alice's Adventures in the Rabbit Hole | PROGRAMMING | constructive algorithms dfs and similar dp greedy math probabilities trees |
Alice is at the bottom of the rabbit hole! The rabbit hole can be modeled as a tree(^{\text{∗}}) which has an exit at vertex (1), and Alice starts at some vertex (v). She wants to get out of the hole, but unfortunately, the Queen of Hearts has ordered her execution. Each minute, a fair coin is flipped. If it lands heads, Alice gets to move to an adjacent vertex of her current location, and otherwise, the Queen of Hearts gets to pull Alice to an adjacent vertex of the Queen's choosing. If Alice ever ends up on any of the non-root leaves(^{\text{†}}) of the tree, Alice loses. Assuming both of them move optimally, compute the probability that Alice manages to escape for every single starting vertex (1\le v\le n). Since these probabilities can be very small, output them modulo (998\,244\,353). Formally, let (M = 998\,244\,353). It can be shown that the exact answer can be expressed as an irreducible fraction (\frac{p}{q}), where (p) and (q) are integers and (q \not \equiv 0 \pmod{M}). Output the integer equal to (p \cdot q^{-1} \bmod M). In other words, output such an integer (x) that (0 \le x < M) and (x \cdot q \equiv p \pmod{M}). (^{\text{∗}})A tree is a connected simple graph which has (n) vertices and (n-1) edges. (^{\text{†}})A leaf is a vertex that is connected to exactly one edge. 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) ((2\le n\le 2\cdot 10^5)) — the number of vertices in the tree. The (i)-th of the next (n - 1) lines contains two integers (x_i) and (y_i) ((1 \le x_i, y_i \le n) and (x_i \neq y_i)) — the edges of the tree. It is guaranteed that the given edges form a tree. It is guaranteed that the sum of (n) over all test cases does not exceed $$$2\cdot 1 |
| Codeforces Round 986 (Div. 2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 290975589 | T404 | E | Nov. 10, 2024, 8:48 p.m. | OK | C++17 (GCC 7-32) | TESTS | 21 | 233 | 8089600 | ||
| 290946702 | Xu_Hongxi | E | Nov. 10, 2024, 5:17 p.m. | OK | C++17 (GCC 7-32) | TESTS | 21 | 250 | 21913600 | ||
| 290961777 | FD..LH..lloyJ | E | Nov. 10, 2024, 6:21 p.m. | OK | C++17 (GCC 7-32) | TESTS | 21 | 311 | 24166400 | ||
| 290991245 | Ion_Gravirei | E | Nov. 11, 2024, 1:06 a.m. | OK | C++17 (GCC 7-32) | TESTS | 21 | 312 | 28160000 | ||
| 290967628 | 0n1ycre | E | Nov. 10, 2024, 7:09 p.m. | OK | C++17 (GCC 7-32) | TESTS | 21 | 327 | 35123200 | ||
| 290994283 | GroupMatrix | E | Nov. 11, 2024, 2:14 a.m. | OK | C++17 (GCC 7-32) | TESTS | 21 | 343 | 20787200 | ||
| 290973449 | T404 | E | Nov. 10, 2024, 8:18 p.m. | OK | C++17 (GCC 7-32) | TESTS | 21 | 343 | 21094400 | ||
| 290988344 | vanvector | E | Nov. 10, 2024, 11:44 p.m. | OK | C++17 (GCC 7-32) | TESTS | 21 | 343 | 21299200 | ||
| 291002199 | fairy_land | E | Nov. 11, 2024, 4:19 a.m. | OK | C++17 (GCC 7-32) | TESTS | 21 | 343 | 31539200 | ||
| 290993657 | VulcanForge | E | Nov. 11, 2024, 2:01 a.m. | OK | C++17 (GCC 7-32) | TESTS | 21 | 343 | 36659200 | ||
| 290975898 | T404 | E | Nov. 10, 2024, 8:53 p.m. | OK | C++20 (GCC 13-64) | TESTS | 21 | 186 | 6451200 | ||
| 290969955 | ggxxdd | E | Nov. 10, 2024, 7:35 p.m. | OK | C++20 (GCC 13-64) | TESTS | 21 | 233 | 28979200 | ||
| 290958241 | StellarSpecter | E | Nov. 10, 2024, 6:01 p.m. | OK | C++20 (GCC 13-64) | TESTS | 21 | 249 | 37888000 | ||
| 290989944 | --tofu-- | E | Nov. 11, 2024, 12:32 a.m. | OK | C++20 (GCC 13-64) | TESTS | 21 | 265 | 27238400 | ||
| 290990472 | trp_hy | E | Nov. 11, 2024, 12:47 a.m. | OK | C++20 (GCC 13-64) | TESTS | 21 | 265 | 30617600 | ||
| 290996844 | A_FD | E | Nov. 11, 2024, 3 a.m. | OK | C++20 (GCC 13-64) | TESTS | 21 | 280 | 25088000 | ||
| 290981411 | Anas_Da | E | Nov. 10, 2024, 10:47 p.m. | OK | C++20 (GCC 13-64) | TESTS | 21 | 280 | 34611200 | ||
| 290982301 | DanTheMan. | E | Nov. 10, 2024, 11:14 p.m. | OK | C++20 (GCC 13-64) | TESTS | 21 | 280 | 36044800 | ||
| 290969002 | svinidla | E | Nov. 10, 2024, 7:24 p.m. | OK | C++20 (GCC 13-64) | TESTS | 21 | 280 | 40755200 | ||
| 291001854 | Xiaozzz | E | Nov. 11, 2024, 4:14 a.m. | OK | C++20 (GCC 13-64) | TESTS | 21 | 281 | 33587200 | ||
| 290971641 | Shu.Rong | E | Nov. 10, 2024, 7:54 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 21 | 156 | 0 | ||
| 290975679 | T404 | E | Nov. 10, 2024, 8:49 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 21 | 187 | 8089600 | ||
| 290961127 | wish_rajput | E | Nov. 10, 2024, 6:17 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 21 | 218 | 33382400 | ||
| 290946918 | Mtaylor | E | Nov. 10, 2024, 5:18 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 21 | 249 | 43622400 | ||
| 290967371 | deconstructionstar | E | Nov. 10, 2024, 7:06 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 21 | 281 | 9728000 | ||
| 290998696 | bubbarob19 | E | Nov. 11, 2024, 3:31 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 21 | 281 | 15360000 | ||
| 290964665 | _Seele_Vollerei_ | E | Nov. 10, 2024, 6:42 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 21 | 296 | 27545600 | ||
| 290979846 | bnayak22 | E | Nov. 10, 2024, 10:07 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 21 | 296 | 28672000 | ||
| 290959044 | Desh01 | E | Nov. 10, 2024, 6:05 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 21 | 296 | 32665600 | ||
| 290962554 | eternal_happiness | E | Nov. 10, 2024, 6:26 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 21 | 296 | 35328000 | ||
| 290946514 | pengin_2000 | E | Nov. 10, 2024, 5:17 p.m. | OK | GNU C11 | TESTS | 21 | 1452 | 19353600 | ||
| 290961733 | nguyenquocthao00 | E | Nov. 10, 2024, 6:21 p.m. | OK | Go | TESTS | 21 | 342 | 169369600 | ||
| 290950775 | taran_1407 | E | Nov. 10, 2024, 5:27 p.m. | OK | Java 21 | TESTS | 21 | 639 | 37171200 | ||
| 290945942 | theSSS | E | Nov. 10, 2024, 5:16 p.m. | OK | Java 21 | TESTS | 21 | 1421 | 53145600 | ||
| 290963005 | yallavamsipavan | E | Nov. 10, 2024, 6:29 p.m. | OK | Java 21 | TESTS | 21 | 1453 | 52940800 | ||
| 290969746 | Darth_Jar_Jar_Binks | E | Nov. 10, 2024, 7:32 p.m. | OK | Java 8 | TESTS | 21 | 421 | 7987200 | ||
| 290947040 | arvindf232 | E | Nov. 10, 2024, 5:18 p.m. | OK | Kotlin 1.9 | TESTS | 21 | 514 | 9523200 | ||
| 290968613 | Monocrap | E | Nov. 10, 2024, 7:19 p.m. | OK | PyPy 3-64 | TESTS | 21 | 655 | 49868800 | ||
| 290967513 | titia | E | Nov. 10, 2024, 7:07 p.m. | OK | PyPy 3-64 | TESTS | 21 | 874 | 70963200 | ||
| 291007754 | Heartbeateffect | E | Nov. 11, 2024, 5:38 a.m. | OK | PyPy 3-64 | TESTS | 21 | 1203 | 59699200 | ||
| 290948561 | ohys040411 | E | Nov. 10, 2024, 5:22 p.m. | OK | PyPy 3-64 | TESTS | 21 | 1327 | 74137600 | ||
| 290951606 | harurun4635 | E | Nov. 10, 2024, 5:28 p.m. | OK | PyPy 3-64 | TESTS | 21 | 1343 | 135168000 | ||
| 290963544 | OpKos | E | Nov. 10, 2024, 6:33 p.m. | OK | PyPy 3-64 | TESTS | 21 | 1374 | 94515200 | ||
| 291004672 | __baozii__ | E | Nov. 11, 2024, 4:54 a.m. | OK | PyPy 3-64 | TESTS | 21 | 1874 | 144281600 | ||
| 291004517 | __baozii__ | E | Nov. 11, 2024, 4:51 a.m. | OK | PyPy 3-64 | TESTS | 21 | 1937 | 138240000 | ||
| 290966622 | nintwa | E | Nov. 10, 2024, 6:59 p.m. | OK | PyPy 3-64 | TESTS | 21 | 1968 | 156672000 | ||
| 290946822 | VanyaM1 | E | Nov. 10, 2024, 5:18 p.m. | OK | PyPy 3-64 | TESTS | 21 | 1984 | 76083200 |
Back to search problems