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 |
|---|---|---|---|---|---|---|
| 2032 | Codeforces Round 983 (Div. 2) | FINISHED | False | 7200 | 45933923 | Nov. 1, 2024, 2:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 6175 ) | D | Genokraken | PROGRAMMING | binary search constructive algorithms data structures graphs interactive trees two pointers |
This is an interactive problem. Upon clearing the Waterside Area, Gretel has found a monster named Genokraken, and she's keeping it contained for her scientific studies. The monster's nerve system can be structured as a tree(^{\dagger}) of (n) nodes (really, everything should stop resembling trees all the time(\ldots)) , numbered from (0) to (n-1), with node (0) as the root. Gretel's objective is to learn the exact structure of the monster's nerve system — more specifically, she wants to know the values (p_1, p_2, \ldots, p_{n-1}) of the tree, where (p_i) ((0 \le p_i < i)) is the direct parent node of node (i) ((1 \le i \le n - 1)). She doesn't know exactly how the nodes are placed, but she knows a few convenient facts: If we remove root node (0) and all adjacent edges, this tree will turn into a forest consisting of only paths(^{\ddagger}). Each node that was initially adjacent to the node (0) will be the end of some path . The nodes are indexed in a way that if (1 \le x \le y \le n - 1), then (p_x \le p_y). Node (1) has exactly two adjacent nodes (including the node (0)). Gretel can make queries to the containment cell: " ? a b " ((1 \le a, b < n), (a \ne b)) — the cell will check if the simple path between nodes (a) and (b) contains the node (0). However, to avoid unexpected consequences by overstimulating the creature, Gretel wants to query at most (2n - 6) times. Though Gretel is gifted, she can't do everything all at once, so can you give her a helping hand? (^{\dagger})A tree is a connected graph where every pair of distinct nodes has exactly one simple path connecting them. (^{\ddagger})A path is a tree whose vertices can be listed in the order (v_1, v_2, \ldots, v_k) such that the edges are ((v_i, v_{i+1})) ((1 \le i < k)). Each test consists of multiple test cases. The first line contains a single integer (t) ($$$1 \le t \le 500 |
| Codeforces Round 983 (Div. 2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 289289486 | og.kostya | D | Nov. 1, 2024, 5:15 p.m. | OK | C# 10 | TESTS | 30 | 187 | 2560000 | ||
| 289338131 | niquefa_diego | D | Nov. 2, 2024, 12:03 a.m. | OK | C# 10 | TESTS | 30 | 296 | 3993600 | ||
| 289361557 | akshatpratapsingh2022 | D | Nov. 2, 2024, 6 a.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 140 | 0 | ||
| 289357144 | snavneet561 | D | Nov. 2, 2024, 5:19 a.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 140 | 0 | ||
| 289340990 | Lyberus | D | Nov. 2, 2024, 1:15 a.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 140 | 102400 | ||
| 289340008 | 4uck_d3v | D | Nov. 2, 2024, 12:52 a.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 140 | 102400 | ||
| 289338325 | MCdyc | D | Nov. 2, 2024, 12:10 a.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 140 | 102400 | ||
| 289292997 | Viecon_342524 | D | Nov. 1, 2024, 5:30 p.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 140 | 102400 | ||
| 289292029 | lockdown | D | Nov. 1, 2024, 5:26 p.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 140 | 102400 | ||
| 289358233 | Overlord993 | D | Nov. 2, 2024, 5:30 a.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 155 | 0 | ||
| 289350162 | dbGIs | D | Nov. 2, 2024, 3:50 a.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 155 | 0 | ||
| 289343339 | MODDI | D | Nov. 2, 2024, 2:03 a.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 155 | 0 | ||
| 289342442 | Abdullah-Ishfaq | D | Nov. 2, 2024, 1:45 a.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 124 | 102400 | ||
| 289302954 | dotNdash | D | Nov. 1, 2024, 6:20 p.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 124 | 102400 | ||
| 289300568 | sarvasva_309 | D | Nov. 1, 2024, 6:08 p.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 124 | 102400 | ||
| 289292562 | Flaming_Blade | D | Nov. 1, 2024, 5:28 p.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 124 | 307200 | ||
| 289342077 | kevin_Durant_ | D | Nov. 2, 2024, 1:38 a.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 125 | 102400 | ||
| 289340021 | xi-xi- | D | Nov. 2, 2024, 12:52 a.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 139 | 102400 | ||
| 289293279 | nianzi | D | Nov. 1, 2024, 5:31 p.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 139 | 102400 | ||
| 289348282 | LUVK | D | Nov. 2, 2024, 3:23 a.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 139 | 819200 | ||
| 289340558 | Ruayhb | D | Nov. 2, 2024, 1:05 a.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 139 | 24064000 | ||
| 289305026 | ThunderXGod | D | Nov. 1, 2024, 6:29 p.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 140 | 0 | ||
| 289295734 | KawaiiKlee | D | Nov. 1, 2024, 5:44 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 30 | 124 | 102400 | ||
| 289294924 | notarmen | D | Nov. 1, 2024, 5:40 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 30 | 124 | 204800 | ||
| 289321743 | a-c | D | Nov. 1, 2024, 8:04 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 30 | 124 | 8089600 | ||
| 289346154 | sangnguuuuuuu | D | Nov. 2, 2024, 2:50 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 30 | 139 | 102400 | ||
| 289346093 | sangnguuuuuuu | D | Nov. 2, 2024, 2:49 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 30 | 139 | 102400 | ||
| 289336182 | world_of_only_victors | D | Nov. 1, 2024, 11:13 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 30 | 139 | 102400 | ||
| 289345885 | sangnguuuuuuu | D | Nov. 2, 2024, 2:45 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 30 | 140 | 102400 | ||
| 289339730 | Free-Free-PaLestine | D | Nov. 2, 2024, 12:46 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 30 | 140 | 102400 | ||
| 289302703 | Sookeyy | D | Nov. 1, 2024, 6:18 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 30 | 140 | 102400 | ||
| 289351468 | CipherNova | D | Nov. 2, 2024, 4:08 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 30 | 155 | 0 | ||
| 289285591 | akhil2004 | D | Nov. 1, 2024, 4:34 p.m. | OK | GNU C11 | TESTS | 30 | 343 | 8396800 | ||
| 289342791 | alchyuan | D | Nov. 2, 2024, 1:52 a.m. | OK | GNU C11 | TESTS | 30 | 483 | 8499200 | ||
| 289325950 | alchyuan | D | Nov. 1, 2024, 8:39 p.m. | OK | GNU C11 | TESTS | 30 | 515 | 8499200 | ||
| 289353883 | amit_roy | D | Nov. 2, 2024, 4:40 a.m. | OK | Java 21 | TESTS | 30 | 561 | 1331200 | ||
| 289292648 | dusty.and.rusty | D | Nov. 1, 2024, 5:28 p.m. | OK | Java 21 | TESTS | 30 | 609 | 2560000 | ||
| 289346785 | congege | D | Nov. 2, 2024, 3 a.m. | OK | Java 21 | TESTS | 30 | 639 | 1024000 | ||
| 289291316 | Utsav82 | D | Nov. 1, 2024, 5:22 p.m. | OK | Java 21 | TESTS | 30 | 640 | 1740800 | ||
| 289298229 | SD125 | D | Nov. 1, 2024, 5:57 p.m. | OK | Java 21 | TESTS | 30 | 671 | 1536000 | ||
| 289352533 | sulabhambule | D | Nov. 2, 2024, 4:22 a.m. | OK | Java 21 | TESTS | 30 | 718 | 2355200 | ||
| 289302478 | kritikmodi | D | Nov. 1, 2024, 6:17 p.m. | OK | Java 21 | TESTS | 30 | 843 | 1843200 | ||
| 289297418 | polsage | D | Nov. 1, 2024, 5:52 p.m. | OK | Java 21 | TESTS | 30 | 858 | 1126400 | ||
| 289325114 | Akash_Sardar | D | Nov. 1, 2024, 8:31 p.m. | OK | Java 21 | TESTS | 30 | 953 | 1331200 | ||
| 289310430 | neel27 | D | Nov. 1, 2024, 6:58 p.m. | OK | Java 21 | TESTS | 30 | 1686 | 3174400 | ||
| 289355177 | achyut88 | D | Nov. 2, 2024, 4:56 a.m. | OK | Java 8 | TESTS | 30 | 515 | 0 | ||
| 289354921 | achyut88 | D | Nov. 2, 2024, 4:52 a.m. | OK | Java 8 | TESTS | 30 | 546 | 0 | ||
| 289349911 | ChaosL | D | Nov. 2, 2024, 3:46 a.m. | OK | PyPy 3 | TESTS | 30 | 608 | 9420800 | ||
| 289294063 | xlk | D | Nov. 1, 2024, 5:35 p.m. | OK | PyPy 3 | TESTS | 30 | 687 | 9625600 | ||
| 289345225 | _happiness_ | D | Nov. 2, 2024, 2:35 a.m. | OK | PyPy 3-64 | TESTS | 30 | 374 | 9113600 | ||
| 289293005 | newbrn | D | Nov. 1, 2024, 5:30 p.m. | OK | PyPy 3-64 | TESTS | 30 | 390 | 6246400 | ||
| 289351692 | gaidash | D | Nov. 2, 2024, 4:10 a.m. | OK | PyPy 3-64 | TESTS | 30 | 405 | 5734400 | ||
| 289347952 | Shri_874 | D | Nov. 2, 2024, 3:19 a.m. | OK | PyPy 3-64 | TESTS | 30 | 406 | 8192000 | ||
| 289353160 | Euphoriababy | D | Nov. 2, 2024, 4:30 a.m. | OK | PyPy 3-64 | TESTS | 30 | 421 | 4812800 | ||
| 289303085 | JasonMendoza2008 | D | Nov. 1, 2024, 6:20 p.m. | OK | PyPy 3-64 | TESTS | 30 | 421 | 139878400 | ||
| 289300907 | ow3nLLL | D | Nov. 1, 2024, 6:10 p.m. | OK | PyPy 3-64 | TESTS | 30 | 436 | 4300800 | ||
| 289314354 | Remineva | D | Nov. 1, 2024, 7:19 p.m. | OK | PyPy 3-64 | TESTS | 30 | 436 | 4915200 | ||
| 289351116 | gauravgamer1 | D | Nov. 2, 2024, 4:03 a.m. | OK | PyPy 3-64 | TESTS | 30 | 436 | 8192000 | ||
| 289321329 | DanielLong | D | Nov. 1, 2024, 8:02 p.m. | OK | PyPy 3-64 | TESTS | 30 | 437 | 6963200 | ||
| 289344490 | Akshar_7 | D | Nov. 2, 2024, 2:23 a.m. | OK | Python 3 | TESTS | 30 | 343 | 716800 | ||
| 289314365 | faroukfaiz | D | Nov. 1, 2024, 7:19 p.m. | OK | Python 3 | TESTS | 30 | 343 | 921600 | ||
| 289292865 | AkiLotus | D | Nov. 1, 2024, 5:30 p.m. | OK | Python 3 | TESTS | 30 | 374 | 1331200 | ||
| 289285229 | Techno_Sameer | D | Nov. 1, 2024, 4:33 p.m. | OK | Python 3 | TESTS | 30 | 1155 | 1126400 | ||
| 289311776 | tempturing | D | Nov. 1, 2024, 7:05 p.m. | OK | Python 3 | TESTS | 30 | 1218 | 2252800 | ||
| 289307345 | Cheshulko | D | Nov. 1, 2024, 6:41 p.m. | OK | Rust 2021 | TESTS | 30 | 203 | 102400 |
Back to search problems