Codeforces Round 922 (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
1918 Codeforces Round 922 (Div. 2) FINISHED False 7800 30554663 Jan. 30, 2024, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 928 ) F Caterpillar on a Tree PROGRAMMING binary search dfs and similar graphs greedy implementation trees

B"The caterpillar decided to visit every node of the tree. Initially, it is sitting at the root. The tree is represented as a rooted tree with the root at the node 1 . Each crawl to a neighboring node takes 1 minute for the caterpillar. And there is a trampoline under the tree. If the caterpillar detaches from the tree and falls onto the trampoline, it will end up at the root of the tree in 0 seconds. But the trampoline is old and can withstand no more than k caterpillar's falls. What is the minimum time the caterpillar can take to visit all the nodes of the tree? More formally, we need to find the minimum time required to visit all the nodes of the tree, if the caterpillar starts at the root (node 1 ) and moves using two methods. The second method (teleportation) can be used at most k times. The caterpillar can finish the journey at any node. The first line of the input contains two integers: n ( 2 <= n <= 2 cdot 10^5 ) -- the number of nodes in the tree, and k ( 0 <= k <= 10^9 ) -- the maximum number of teleports to the root. The second line contains n-1 integers p_2 , p_3 , ..., p_n ( 1 <= p_i <= n ) -- the ancestors in the tree for nodes 2, 3, ldots, n ; node 1 is the root. Print a single number in a single line -- the minimum number of minutes required to visit all the nodes of the tree. The figure shows one of the ways to traverse the tree from the first test in 9 minutes. "...

Tutorials

Codeforces Round #922 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
244173008 Gassa F Jan. 30, 2024, 8:44 p.m. OK D TESTS 151 265 47820800
244143949 Gassa F Jan. 30, 2024, 4:42 p.m. OK D TESTS 151 280 36556800
244160351 rainboy F Jan. 30, 2024, 6:49 p.m. OK GNU C11 TESTS 151 124 19353600
244179246 DIvanCode F Jan. 30, 2024, 10:19 p.m. OK GNU C++17 TESTS 151 109 24166400
244134466 Tima3 F Jan. 30, 2024, 4:18 p.m. OK GNU C++17 TESTS 151 124 12902400
244189357 sha7dow F Jan. 31, 2024, 2:01 a.m. OK GNU C++17 TESTS 151 139 18022400
244144743 Kilani F Jan. 30, 2024, 4:44 p.m. OK GNU C++17 TESTS 151 139 25804800
244154074 Tenjin F Jan. 30, 2024, 6:17 p.m. OK GNU C++17 TESTS 151 139 43417600
244160520 KroosTheKeenGlint F Jan. 30, 2024, 6:50 p.m. OK GNU C++17 TESTS 151 140 23040000
244193523 hht2005 F Jan. 31, 2024, 3:02 a.m. OK GNU C++17 TESTS 151 140 29798400
244183387 McPqndq F Jan. 31, 2024, midnight OK GNU C++17 TESTS 151 140 31641600
244200258 Nurss F Jan. 31, 2024, 4:32 a.m. OK GNU C++17 TESTS 151 140 40243200
244180612 AshToady F Jan. 30, 2024, 10:50 p.m. OK GNU C++17 TESTS 151 155 25804800
244141669 rijuyuezhu F Jan. 30, 2024, 4:36 p.m. OK GNU C++17 (64) TESTS 151 109 30412800
244144124 sufficient F Jan. 30, 2024, 4:42 p.m. OK GNU C++17 (64) TESTS 151 109 34508800
244199530 _wrpwrp F Jan. 31, 2024, 4:22 a.m. OK GNU C++17 (64) TESTS 151 124 36044800
244201466 Syrus F Jan. 31, 2024, 4:47 a.m. OK GNU C++17 (64) TESTS 151 139 44134400
244204282 daoqi F Jan. 31, 2024, 5:07 a.m. OK GNU C++17 (64) TESTS 151 140 32768000
244206991 AC-Automation F Jan. 31, 2024, 5:35 a.m. OK GNU C++17 (64) TESTS 151 140 33689600
244201359 Syrus F Jan. 31, 2024, 4:46 a.m. OK GNU C++17 (64) TESTS 151 140 44134400
244203316 jdurie F Jan. 31, 2024, 4:57 a.m. OK GNU C++17 (64) TESTS 151 140 46694400
244196520 RX93 F Jan. 31, 2024, 3:41 a.m. OK GNU C++17 (64) TESTS 151 155 39219200
244203182 hhhyh F Jan. 31, 2024, 4:56 a.m. OK GNU C++17 (64) TESTS 151 156 54476800
244179186 magnus.hegdahl F Jan. 30, 2024, 10:18 p.m. OK GNU C++20 (64) TESTS 151 108 28774400
244200369 Retired_Isaunoya F Jan. 31, 2024, 4:33 a.m. OK GNU C++20 (64) TESTS 151 108 39219200
244166858 tatata96 F Jan. 30, 2024, 7:40 p.m. OK GNU C++20 (64) TESTS 151 109 18739200
244198124 anotherGold F Jan. 31, 2024, 4:02 a.m. OK GNU C++20 (64) TESTS 151 109 22220800
244155785 MaGnsi0 F Jan. 30, 2024, 6:23 p.m. OK GNU C++20 (64) TESTS 151 109 38502400
244179639 magnus.hegdahl F Jan. 30, 2024, 10:29 p.m. OK GNU C++20 (64) TESTS 151 124 28876800
244138476 Temmie F Jan. 30, 2024, 4:28 p.m. OK GNU C++20 (64) TESTS 151 124 32051200
244179287 jamesbamber F Jan. 30, 2024, 10:20 p.m. OK GNU C++20 (64) TESTS 151 124 38502400
244135731 SSerxhs F Jan. 30, 2024, 4:21 p.m. OK GNU C++20 (64) TESTS 151 124 43212800
244192687 Coder-Osman F Jan. 31, 2024, 2:51 a.m. OK GNU C++20 (64) TESTS 151 124 43315200
244192543 cybsbbb F Jan. 31, 2024, 2:49 a.m. OK PyPy 3-64 TESTS 151 482 41062400
244161894 Little_Sheep_Yawn F Jan. 30, 2024, 7 p.m. OK PyPy 3-64 TESTS 151 483 44851200

remove filters

Back to search problems