Codeforces Round 937 (Div. 4)

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
1950 Codeforces Round 937 (Div. 4) FINISHED False 8100 25542863 March 28, 2024, 2:45 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 9566 ) F 0, 1, 2, Tree! PROGRAMMING greedy math trees

B"Find the minimum height of a rooted tree ^{ dagger} with a+b+c vertices that satisfies the following conditions: The tree above is rooted at the top vertex, and each vertex is labeled with the number of children it has. Here a=2 , b=1 , c=3 , and the height is 2 . ^{ dagger} A rooted tree is a connected graph without cycles, with a special vertex called the root. In a rooted tree, among any two vertices connected by an edge, one vertex is a parent (the one closer to the root), and the other one is a child. The distance between two vertices in a tree is the number of edges in the shortest path between them. The height of a rooted tree is the maximum distance from a vertex to the root. The first line contains an integer t ( 1 <= q t <= q 10^4 ) -- the number of test cases. The only line of each test case contains three integers a , b , and c ( 0 <= q a, b, c <= q 10^5 ; 1 <= q a + b + c ). The sum of a + b + c over all test cases does not exceed 3 cdot 10^5 . For each test case, if no such tree exists, output -1 . Otherwise, output one integer -- the minimum height of a tree satisfying the conditions in the statement. The first test case is pictured in the statement. It can be proven that you can't get a height smaller than 2 . In the second test case, you can form a tree with a single vertex and no edges. It has height 0 , which is clearly optimal. In the third test case, you can form a tree with two vertices joined by a single edge. It has height 1 , which is clearly optimal. "...

Tutorials

Codeforces Round 937 (Div. 4) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
253854536 Anastasiya_Andreevna F March 28, 2024, 8:37 p.m. OK C# 10 TESTS 9 124 2048000
253887668 hsez_fzh F March 29, 2024, 5:21 a.m. OK C++14 (GCC 6-32) TESTS 9 0 0
253877260 Mentgreen F March 29, 2024, 3:11 a.m. OK C++14 (GCC 6-32) TESTS 9 15 0
253876393 Mentgreen F March 29, 2024, 2:58 a.m. OK C++14 (GCC 6-32) TESTS 9 15 0
253865245 abhi_0804 F March 28, 2024, 11:24 p.m. OK C++14 (GCC 6-32) TESTS 9 15 0
253864095 chsaksham F March 28, 2024, 11:01 p.m. OK C++14 (GCC 6-32) TESTS 9 15 0
253850753 _Lactosi F March 28, 2024, 7:59 p.m. OK C++14 (GCC 6-32) TESTS 9 15 0
253849523 nkb108 F March 28, 2024, 7:47 p.m. OK C++14 (GCC 6-32) TESTS 9 15 0
253835645 LilBunnyKing F March 28, 2024, 5:55 p.m. OK C++14 (GCC 6-32) TESTS 9 15 0
253855927 experimenta F March 28, 2024, 8:53 p.m. OK C++14 (GCC 6-32) TESTS 9 15 102400
253886484 IamSid44 F March 29, 2024, 5:09 a.m. OK C++14 (GCC 6-32) TESTS 9 15 614400
253886593 tr1cker F March 29, 2024, 5:10 a.m. OK C++17 (GCC 7-32) TESTS 9 0 0
253886468 wandw F March 29, 2024, 5:09 a.m. OK C++17 (GCC 7-32) TESTS 9 0 0
253883680 osir. F March 29, 2024, 4:38 a.m. OK C++17 (GCC 7-32) TESTS 9 0 0
253883627 xzx_123 F March 29, 2024, 4:37 a.m. OK C++17 (GCC 7-32) TESTS 9 0 0
253883122 _bekhruz F March 29, 2024, 4:31 a.m. OK C++17 (GCC 7-32) TESTS 9 0 0
253882962 ayush5556 F March 29, 2024, 4:29 a.m. OK C++17 (GCC 7-32) TESTS 9 0 0
253879955 MaxWelll F March 29, 2024, 3:51 a.m. OK C++17 (GCC 7-32) TESTS 9 0 0
253870408 BeAMan F March 29, 2024, 1:13 a.m. OK C++17 (GCC 7-32) TESTS 9 0 0
253866813 Yugen_ F March 28, 2024, 11:56 p.m. OK C++17 (GCC 7-32) TESTS 9 0 0
253864842 hahawa F March 28, 2024, 11:17 p.m. OK C++17 (GCC 7-32) TESTS 9 0 0
253880465 Urtusea F March 29, 2024, 3:58 a.m. OK C++20 (GCC 13-64) TESTS 9 0 0
253852402 -VIBE F March 28, 2024, 8:15 p.m. OK C++20 (GCC 13-64) TESTS 9 0 0
253836345 Mushfiqur_ F March 28, 2024, 6 p.m. OK C++20 (GCC 13-64) TESTS 9 0 0
253891973 Mysterious109 F March 29, 2024, 6 a.m. OK C++20 (GCC 13-64) TESTS 9 15 0
253891310 Zerozip F March 29, 2024, 5:54 a.m. OK C++20 (GCC 13-64) TESTS 9 15 0
253890892 SyedSohaib F March 29, 2024, 5:50 a.m. OK C++20 (GCC 13-64) TESTS 9 15 0
253890839 grate F March 29, 2024, 5:50 a.m. OK C++20 (GCC 13-64) TESTS 9 15 0
253890837 Ehsan F March 29, 2024, 5:50 a.m. OK C++20 (GCC 13-64) TESTS 9 15 0
253890636 ZhishengIE001 F March 29, 2024, 5:48 a.m. OK C++20 (GCC 13-64) TESTS 9 15 0
253890062 LAING2122 F March 29, 2024, 5:43 a.m. OK C++20 (GCC 13-64) TESTS 9 15 0
253862918 NenadDapic F March 28, 2024, 10:38 p.m. OK FPC TESTS 9 46 1740800
253844909 TianMeng30 F March 28, 2024, 7:05 p.m. OK GNU C11 TESTS 9 62 307200
253846600 lyongwolf F March 28, 2024, 7:20 p.m. OK Java 21 TESTS 9 265 0
253885261 yang_wei F March 29, 2024, 4:56 a.m. OK Java 21 TESTS 9 265 102400
253860142 polsage F March 28, 2024, 9:52 p.m. OK Java 21 TESTS 9 280 0
253888111 powervic08 F March 29, 2024, 5:25 a.m. OK Java 21 TESTS 9 296 307200
253847654 sree9398 F March 28, 2024, 7:29 p.m. OK Java 21 TESTS 9 311 409600
253836808 shubhangi120989 F March 28, 2024, 6:03 p.m. OK Java 21 TESTS 9 312 614400
253873661 Saurabh124 F March 29, 2024, 2:15 a.m. OK Java 21 TESTS 9 342 102400
253844608 CrazyTurtles F March 28, 2024, 7:02 p.m. OK Java 21 TESTS 9 358 819200
253872198 Fareedah F March 29, 2024, 1:49 a.m. OK Java 21 TESTS 9 374 2969600
253843506 Sumitsingh7 F March 28, 2024, 6:52 p.m. OK Java 8 TESTS 9 109 6451200
253876907 ygming F March 29, 2024, 3:06 a.m. OK Java 8 TESTS 9 139 0
253883143 NerfThis F March 29, 2024, 4:31 a.m. OK Java 8 TESTS 9 140 0
253883070 kasiru_69 F March 29, 2024, 4:30 a.m. OK Java 8 TESTS 9 155 0
253877742 coderman2004 F March 29, 2024, 3:18 a.m. OK Java 8 TESTS 9 155 0
253884188 kasiru_69 F March 29, 2024, 4:43 a.m. OK Java 8 TESTS 9 156 0
253877460 cdream F March 29, 2024, 3:14 a.m. OK Java 8 TESTS 9 186 0
253838390 Sovi_11 F March 28, 2024, 6:15 p.m. OK PyPy 3 TESTS 9 233 4608000
253850794 abhaygupta28 F March 28, 2024, 7:59 p.m. OK PyPy 3 TESTS 9 295 4710400
253841683 Jord8061 F March 28, 2024, 6:40 p.m. OK PyPy 3 TESTS 9 295 4710400
253842837 PhanDinhKhoi F March 28, 2024, 6:47 p.m. OK PyPy 3 TESTS 9 296 5324800
253876229 mikeac F March 29, 2024, 2:56 a.m. OK PyPy 3-64 TESTS 9 62 5427200
253847751 _twi_nami F March 28, 2024, 7:30 p.m. OK PyPy 3-64 TESTS 9 77 3276800
253864985 DRDIV F March 28, 2024, 11:19 p.m. OK PyPy 3-64 TESTS 9 77 4096000
253851607 MassimoG F March 28, 2024, 8:08 p.m. OK PyPy 3-64 TESTS 9 77 5734400
253864004 khalit7 F March 28, 2024, 10:59 p.m. OK PyPy 3-64 TESTS 9 77 6348800
253878654 Captainfly F March 29, 2024, 3:32 a.m. OK PyPy 3-64 TESTS 9 92 5017600
253849609 SoleProprietor F March 28, 2024, 7:48 p.m. OK PyPy 3-64 TESTS 9 93 5222400
253842987 RobinFromTheHood F March 28, 2024, 6:48 p.m. OK PyPy 3-64 TESTS 9 93 5632000
253847495 cybsbbb F March 28, 2024, 7:28 p.m. OK PyPy 3-64 TESTS 9 93 5939200
253876902 Drought F March 29, 2024, 3:06 a.m. OK PyPy 3-64 TESTS 9 93 6451200
253843210 OLOGY F March 28, 2024, 6:50 p.m. OK Python 2 TESTS 9 61 409600
253874220 OLOGY F March 29, 2024, 2:24 a.m. OK Python 2 TESTS 9 62 409600
253841566 OLOGY F March 28, 2024, 6:39 p.m. OK Python 2 TESTS 9 62 409600
253840475 OLOGY F March 28, 2024, 6:31 p.m. OK Python 2 TESTS 9 93 1433600
253843126 ZzimorodockK F March 28, 2024, 6:49 p.m. OK Python 3 TESTS 9 46 819200
253891069 AdityaVegad F March 29, 2024, 5:52 a.m. OK Python 3 TESTS 9 61 102400
253873261 lawang24 F March 29, 2024, 2:08 a.m. OK Python 3 TESTS 9 62 716800
253835729 Gouldh F March 28, 2024, 5:56 p.m. OK Python 3 TESTS 9 77 0
253836902 grecil F March 28, 2024, 6:04 p.m. OK Python 3 TESTS 9 77 0
253836585 grecil F March 28, 2024, 6:02 p.m. OK Python 3 TESTS 9 77 0
253847802 Slata F March 28, 2024, 7:30 p.m. OK Python 3 TESTS 9 77 307200
253859052 wsaleem F March 28, 2024, 9:35 p.m. OK Python 3 TESTS 9 92 0
253839079 edugong F March 28, 2024, 6:21 p.m. OK Python 3 TESTS 9 92 0
253850895 balaji_0987 F March 28, 2024, 8 p.m. OK Python 3 TESTS 9 93 0

remove filters

Back to search problems