Codeforces Round 987 (Div. 2)

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
2031 Codeforces Round 987 (Div. 2) FINISHED False 7200 44731523 Nov. 15, 2024, 12:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 2677 ) E Penchick and Chloe's Trees PROGRAMMING data structures dfs and similar dp greedy sortings trees

With just a few hours left until Penchick and Chloe leave for Singapore, they could hardly wait to see the towering trees at the Singapore Botanic Gardens! Attempting to contain their excitement, Penchick crafted a rooted tree to keep Chloe and himself busy. Penchick has a rooted tree(^{\text{∗}}) consisting of (n) vertices, numbered from (1) to (n), with vertex (1) as the root, and Chloe can select a non-negative integer (d) to create a perfect binary tree(^{\text{†}}) of depth (d). Since Penchick and Chloe are good friends, Chloe wants her tree to be isomorphic(^{\text{‡}}) to Penchick's tree. To meet this condition, Chloe can perform the following operation on her own tree any number of times: Select an edge ((u,v)), where (u) is the parent of (v). Remove vertex (v) and all the edges connected to (v), then connect all of (v)'s previous children directly to (u). In particular, doing an operation on an edge ((u, v)) where (v) is a leaf will delete vertex (v) without adding any new edges. Since constructing a perfect binary tree can be time-consuming, Chloe wants to choose the minimum (d) such that a perfect binary tree of depth (d) can be made isomorphic to Penchick's tree using the above operation. Note that she can't change the roots of the trees. (^{\text{∗}})A tree is a connected graph without cycles. A rooted tree is a tree where one vertex is special and called the root. The parent of vertex (v) is the first vertex on the simple path from (v) to the root. The root has no parent. A child of vertex (v) is any vertex (u) for which (v) is the parent. A leaf is any vertex without children. (^{\text{†}})A full binary tree is rooted tree, in which each node has (0) or (2) children. A perfect binary tree is a full binary tree in which every leaf is at the same distance from the root. The depth of such a tree is the distance from the root t

Tutorials

Codeforces Round 987 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
291684901 og.kostya E Nov. 15, 2024, 5:40 p.m. OK C# 10 TESTS 85 812 100556800
291666276 shinlena E Nov. 15, 2024, 3:59 p.m. OK C++17 (GCC 7-32) TESTS 85 312 92160000
291671084 shinlena E Nov. 15, 2024, 4:26 p.m. OK C++17 (GCC 7-32) TESTS 85 374 81100800
291652288 XG0000 E Nov. 15, 2024, 2:24 p.m. OK C++17 (GCC 7-32) TESTS 85 406 30924800
291656358 cosmicmanhnopro E Nov. 15, 2024, 2:33 p.m. OK C++17 (GCC 7-32) TESTS 85 406 38809600
291719009 ghffghg E Nov. 15, 2024, 11:30 p.m. OK C++17 (GCC 7-32) TESTS 85 421 153497600
291707317 Turcavid E Nov. 15, 2024, 8:29 p.m. OK C++17 (GCC 7-32) TESTS 85 452 60006400
291725633 for_to E Nov. 16, 2024, 1:51 a.m. OK C++17 (GCC 7-32) TESTS 85 452 96460800
291664548 shinlena E Nov. 15, 2024, 3:51 p.m. OK C++17 (GCC 7-32) TESTS 85 468 80896000
291719699 mandy0109 E Nov. 15, 2024, 11:52 p.m. OK C++17 (GCC 7-32) TESTS 85 499 36044800
291653827 Cras0432 E Nov. 15, 2024, 2:28 p.m. OK C++17 (GCC 7-32) TESTS 85 499 84275200
291652753 fydj E Nov. 15, 2024, 2:26 p.m. OK C++20 (GCC 13-64) TESTS 85 202 30208000
291734100 ngmhhay E Nov. 16, 2024, 3:57 a.m. OK C++20 (GCC 13-64) TESTS 85 328 180428800
291670004 fishcathu. E Nov. 15, 2024, 4:21 p.m. OK C++20 (GCC 13-64) TESTS 85 374 50278400
291652073 igAC E Nov. 15, 2024, 2:24 p.m. OK C++20 (GCC 13-64) TESTS 85 374 168448000
291656766 T404 E Nov. 15, 2024, 2:34 p.m. OK C++20 (GCC 13-64) TESTS 85 390 44032000
291720301 Impulse4 E Nov. 16, 2024, 12:11 a.m. OK C++20 (GCC 13-64) TESTS 85 390 172748800
291666220 Tainel E Nov. 15, 2024, 3:59 p.m. OK C++20 (GCC 13-64) TESTS 85 406 52428800
291662631 Tainel E Nov. 15, 2024, 3:42 p.m. OK C++20 (GCC 13-64) TESTS 85 421 50688000
291663227 Tainel E Nov. 15, 2024, 3:45 p.m. OK C++20 (GCC 13-64) TESTS 85 421 52121600
291706389 csegura E Nov. 15, 2024, 8:20 p.m. OK C++20 (GCC 13-64) TESTS 85 436 42803200
291670762 _MASSIMO_ E Nov. 15, 2024, 4:24 p.m. OK C++23 (GCC 14-64, msys2) TESTS 85 327 46592000
291718646 hcywoi E Nov. 15, 2024, 11:19 p.m. OK C++23 (GCC 14-64, msys2) TESTS 85 342 46489600
291672484 LittleDongRabbit E Nov. 15, 2024, 4:31 p.m. OK C++23 (GCC 14-64, msys2) TESTS 85 374 50278400
291681515 wqweto E Nov. 15, 2024, 5:19 p.m. OK C++23 (GCC 14-64, msys2) TESTS 85 406 46284800
291735687 lrvideckis E Nov. 16, 2024, 4:20 a.m. OK C++23 (GCC 14-64, msys2) TESTS 85 421 42905600
291696237 BiggestOtaku E Nov. 15, 2024, 6:53 p.m. OK C++23 (GCC 14-64, msys2) TESTS 85 421 65433600
291669723 Retired_Isaunoya E Nov. 15, 2024, 4:19 p.m. OK C++23 (GCC 14-64, msys2) TESTS 85 437 43110400
291724139 xjsgl654321 E Nov. 16, 2024, 1:24 a.m. OK C++23 (GCC 14-64, msys2) TESTS 85 468 196710400
291702311 Shu.Rong E Nov. 15, 2024, 7:42 p.m. OK C++23 (GCC 14-64, msys2) TESTS 85 499 186675200
291697161 _Seele_Vollerei_ E Nov. 15, 2024, 7:01 p.m. OK C++23 (GCC 14-64, msys2) TESTS 85 499 190873600
291738027 sleepntsheep E Nov. 16, 2024, 4:53 a.m. OK GNU C11 TESTS 85 593 84889600
291653920 baoziiii1224 E Nov. 15, 2024, 2:28 p.m. OK Go TESTS 85 655 81920000
291666850 lyongwolf E Nov. 15, 2024, 4:02 p.m. OK Java 21 TESTS 85 655 36864000
291716587 dusty.and.rusty E Nov. 15, 2024, 10:29 p.m. OK Java 21 TESTS 85 1968 454246400
291714661 dusty.and.rusty E Nov. 15, 2024, 9:58 p.m. OK Java 21 TESTS 85 2014 154316800
291717969 DarLam E Nov. 15, 2024, 11 p.m. OK Java 21 TESTS 85 2062 153190400
291663243 WORTH E Nov. 15, 2024, 3:45 p.m. OK Java 21 TESTS 85 2546 487526400
291716757 dusty.and.rusty E Nov. 15, 2024, 10:32 p.m. OK Java 21 TESTS 85 3030 437555200
291712570 dusty.and.rusty E Nov. 15, 2024, 9:31 p.m. OK Java 21 TESTS 85 3452 205312000
291674441 bnmanubharadwaj E Nov. 15, 2024, 4:40 p.m. OK Node.js TESTS 85 499 68403200
291664090 sushmanth.dampur8780 E Nov. 15, 2024, 3:48 p.m. OK PyPy 3 TESTS 85 2749 347238400
291653814 sandstone E Nov. 15, 2024, 2:28 p.m. OK PyPy 3 TESTS 85 3265 315699200
291729085 golomb E Nov. 16, 2024, 2:48 a.m. OK PyPy 3-64 TESTS 85 811 145715200
291666645 TJacobus E Nov. 15, 2024, 4:01 p.m. OK PyPy 3-64 TESTS 85 984 184524800
291662422 Pras28 E Nov. 15, 2024, 3:42 p.m. OK PyPy 3-64 TESTS 85 1046 198041600
291663862 hxu10 E Nov. 15, 2024, 3:47 p.m. OK PyPy 3-64 TESTS 85 1062 193843200
291720077 CDastrup E Nov. 16, 2024, 12:03 a.m. OK PyPy 3-64 TESTS 85 1077 203161600
291652823 nikoro256 E Nov. 15, 2024, 2:26 p.m. OK PyPy 3-64 TESTS 85 1093 186368000
291665664 krism E Nov. 15, 2024, 3:56 p.m. OK PyPy 3-64 TESTS 85 1249 168038400
291656607 ohys040411 E Nov. 15, 2024, 2:34 p.m. OK PyPy 3-64 TESTS 85 2093 399564800
291655695 Heartbeateffect E Nov. 15, 2024, 2:32 p.m. OK PyPy 3-64 TESTS 85 2186 265523200
291656427 Egor E Nov. 15, 2024, 2:33 p.m. OK Rust 2021 TESTS 85 515 215142400
291652675 tirlimster E Nov. 15, 2024, 2:25 p.m. OK Rust 2021 TESTS 85 671 261632000

remove filters

Back to search problems