Codeforces Round 661 (Div. 3)

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
1399 Codeforces Round 661 (Div. 3) FINISHED False 8100 140541863 Aug. 5, 2020, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 5931 ) E1 Weights Division (easy version) PROGRAMMING data structures dfs and similar greedy trees

B'Easy and hard versions are actually different problems, so we advise you to read both statements carefully. You are given a weighted rooted tree, vertex 1 is the root of this tree. A tree is a connected graph without cycles. A rooted tree has a special vertex called the root. A parent of a vertex v is the last different from v vertex on the path from the root to the vertex v . Children of vertex v are all vertices for which v is the parent. A vertex is a leaf if it has no children. The weighted tree is such a tree that each edge of this tree has some weight. The weight of the path is the sum of edges weights on this path. The weight of the path from the vertex to itself is 0 . You can make a sequence of zero or more moves. On each move, you select an edge and divide its weight by 2 rounding down. More formally, during one move, you choose some edge i and divide its weight by 2 rounding down ( w_i := <= ft lfloor frac{w_i}{2} right rfloor ). Your task is to find the minimum number of moves required to make the sum of weights of paths from the root to each leaf at most S . In other words, if w(i, j) is the weight of the path from the vertex i to the vertex j , then you have to make sum limits_{v in leaves} w(root, v) <= S , where leaves is the list of all leaves. You have to answer t independent test cases. The first line of the input contains one integer t ( 1 <= t <= 2 cdot 10^4 ) -- the number of test cases. Then t test cases follow. The first line of the test case contains two integers n and S ( 2 <= n <= 10^5; 1 <= S <= 10^{16} ) -- the number of vertices in the tree and the maximum possible sum of weights you have to obtain. The next n-1 lines describe edges of the tree. The edge i is described as three integers v_i , u_i and w_i ( 1 <= v_i, u_i <= n; 1 <= w_i <= 10^6 ), wh'...

Tutorials

Codeforces Round #661 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
90504098 wyzwyz E1 Aug. 21, 2020, 3:46 a.m. OK GNU C++11 TESTS 21 217 19148800
90229536 luogu_bot1 E1 Aug. 17, 2020, 12:56 p.m. OK GNU C++11 TESTS 21 218 10035200
91207010 ShadyPi E1 Aug. 28, 2020, 12:28 p.m. OK GNU C++11 TESTS 21 218 18636800
91207528 ShadyPi E1 Aug. 28, 2020, 12:35 p.m. OK GNU C++11 TESTS 21 218 18841600
91697467 echozhou E1 Sept. 3, 2020, 7:45 a.m. OK GNU C++11 TESTS 21 249 22835200
90247136 luogu_bot2 E1 Aug. 17, 2020, 4:16 p.m. OK GNU C++11 TESTS 21 249 27033600
91379389 WaluntOvO E1 Aug. 30, 2020, 3:18 p.m. OK GNU C++11 TESTS 21 264 83660800
90883426 M_sea E1 Aug. 25, 2020, 8:45 a.m. OK GNU C++11 TESTS 21 343 12800000
90721810 huanggs E1 Aug. 23, 2020, 1:28 a.m. OK GNU C++11 TESTS 21 358 19558400
90802827 StarrySky1024 E1 Aug. 24, 2020, 7:06 a.m. OK GNU C++11 TESTS 21 358 23961600
90864202 Pateta E1 Aug. 25, 2020, 3:11 a.m. OK GNU C++14 TESTS 21 171 28057600
91177203 sujeet_99737 E1 Aug. 28, 2020, 3:47 a.m. OK GNU C++14 TESTS 21 187 41574400
90668155 shroud777 E1 Aug. 22, 2020, 8:05 a.m. OK GNU C++14 TESTS 21 249 24576000
91569579 oipotato E1 Sept. 1, 2020, 1:32 p.m. OK GNU C++14 TESTS 21 264 46489600
90038374 xwd456 E1 Aug. 15, 2020, 5:41 p.m. OK GNU C++14 TESTS 21 296 11980800
91063798 jakubfedak E1 Aug. 26, 2020, 2:41 p.m. OK GNU C++14 TESTS 21 312 15257600
90429621 nanhtu E1 Aug. 20, 2020, 3:29 a.m. OK GNU C++14 TESTS 21 327 14643200
90793936 madhuekshk3 E1 Aug. 24, 2020, 4:08 a.m. OK GNU C++14 TESTS 21 327 18329600
90477776 BaThUn E1 Aug. 20, 2020, 3:44 p.m. OK GNU C++14 TESTS 21 343 16896000
90795041 bharath. E1 Aug. 24, 2020, 4:39 a.m. OK GNU C++14 TESTS 21 343 17510400
90733446 thebesttv E1 Aug. 23, 2020, 7 a.m. OK GNU C++17 TESTS 21 218 22118400
90039351 Thallium_is_Vegetable E1 Aug. 15, 2020, 6:01 p.m. OK GNU C++17 TESTS 21 233 12800000
90310263 Mickey-snow E1 Aug. 18, 2020, 1:10 p.m. OK GNU C++17 TESTS 21 249 13107200
90352409 wish2lucky E1 Aug. 19, 2020, 2:29 a.m. OK GNU C++17 TESTS 21 249 39731200
91323752 WhySoSerious6490 E1 Aug. 30, 2020, 5:55 a.m. OK GNU C++17 TESTS 21 264 15564800
90224217 Clouder0 E1 Aug. 17, 2020, 11:48 a.m. OK GNU C++17 TESTS 21 280 9216000
90879511 m_aamirk E1 Aug. 25, 2020, 7:51 a.m. OK GNU C++17 TESTS 21 280 14028800
90263938 zakhar0 E1 Aug. 17, 2020, 9:18 p.m. OK GNU C++17 TESTS 21 295 45260800
90865323 _Samir E1 Aug. 25, 2020, 3:44 a.m. OK GNU C++17 TESTS 21 296 23040000
90733486 Soumya1 E1 Aug. 23, 2020, 7:01 a.m. OK GNU C++17 TESTS 21 296 39628800
91648822 sirearsh E1 Sept. 2, 2020, 2:21 p.m. OK GNU C++17 (64) TESTS 21 156 23142400
91462802 sirearsh E1 Aug. 31, 2020, 6:21 a.m. OK GNU C++17 (64) TESTS 21 186 27443200
91608566 bmu E1 Sept. 2, 2020, 3:35 a.m. OK GNU C++17 (64) TESTS 21 202 21094400
91462698 sirearsh E1 Aug. 31, 2020, 6:20 a.m. OK GNU C++17 (64) TESTS 21 202 27238400
91131200 KasugaAyumu E1 Aug. 27, 2020, 12:10 p.m. OK GNU C++17 (64) TESTS 21 202 32256000
91663580 ChethanJ E1 Sept. 2, 2020, 5:30 p.m. OK GNU C++17 (64) TESTS 21 217 21606400
90282489 Parsa84 E1 Aug. 18, 2020, 6:37 a.m. OK GNU C++17 (64) TESTS 21 217 23756800
90761061 jetha_lal E1 Aug. 23, 2020, 1:56 p.m. OK GNU C++17 (64) TESTS 21 217 47923200
91586385 clearlove20 E1 Sept. 1, 2020, 4:55 p.m. OK GNU C++17 (64) TESTS 21 218 22425600
91255030 kunaltawatia E1 Aug. 29, 2020, 4:25 a.m. OK GNU C++17 (64) TESTS 21 233 47411200
90522241 cribabby E1 Aug. 21, 2020, 10:13 a.m. OK Java 11 TESTS 21 904 71680000
90871056 Justyo E1 Aug. 25, 2020, 5:46 a.m. OK Java 11 TESTS 21 904 146739200
91250016 dubai03nsr E1 Aug. 29, 2020, 1:27 a.m. OK Java 11 TESTS 21 1434 44134400
90260544 skittles1412 E1 Aug. 17, 2020, 7:51 p.m. OK Java 11 TESTS 21 1465 55091200
91231788 shrey_shreyansh E1 Aug. 28, 2020, 5:13 p.m. OK Java 11 TESTS 21 1762 49971200
91231242 shrey_shreyansh E1 Aug. 28, 2020, 5:07 p.m. OK Java 11 TESTS 21 1902 49971200
91263329 kadintang1 E1 Aug. 29, 2020, 7:07 a.m. OK Java 11 TESTS 21 2308 36044800
91126249 BlinKer E1 Aug. 27, 2020, 10:59 a.m. OK Java 8 TESTS 21 1013 38707200
91096331 jxin31415 E1 Aug. 27, 2020, 1:04 a.m. OK Java 8 TESTS 21 1028 79052800
90498607 lansergecs E1 Aug. 20, 2020, 10:42 p.m. OK Java 8 TESTS 21 1045 16076800
90185636 vjudge3 E1 Aug. 17, 2020, 2:12 a.m. OK Java 8 TESTS 21 1060 19968000
90498555 lansergecs E1 Aug. 20, 2020, 10:40 p.m. OK Java 8 TESTS 21 1091 16076800
90498685 lansergecs E1 Aug. 20, 2020, 10:46 p.m. OK Java 8 TESTS 21 1122 16179200
90248768 Juniper E1 Aug. 17, 2020, 4:37 p.m. OK Java 8 TESTS 21 1122 38195200
90248111 Juniper E1 Aug. 17, 2020, 4:28 p.m. OK Java 8 TESTS 21 1123 38195200
90248867 Juniper E1 Aug. 17, 2020, 4:38 p.m. OK Java 8 TESTS 21 1123 38195200
90632322 AnandOza E1 Aug. 21, 2020, 7:13 p.m. OK Java 8 TESTS 21 1372 96460800
90032743 Mosyagin E1 Aug. 15, 2020, 4:04 p.m. OK Mono C# TESTS 21 1949 28774400
90861713 wei.youmn E1 Aug. 25, 2020, 1:45 a.m. OK MS C++ 2017 TESTS 21 685 11468800
90838591 wei.youmn E1 Aug. 24, 2020, 3:17 p.m. OK MS C++ 2017 TESTS 21 701 15155200
91288510 yumtam E1 Aug. 29, 2020, 1:39 p.m. OK PyPy 2 TESTS 21 1668 36249600
91287995 yumtam E1 Aug. 29, 2020, 1:32 p.m. OK PyPy 2 TESTS 21 1684 34611200
90698019 bravotango E1 Aug. 22, 2020, 3:07 p.m. OK PyPy 3 TESTS 21 1201 88985600
90893429 manhar E1 Aug. 25, 2020, 11:11 a.m. OK PyPy 3 TESTS 21 1591 87040000
90289405 Wenbo888 E1 Aug. 18, 2020, 8:16 a.m. OK PyPy 3 TESTS 21 2511 84992000
90289768 Wenbo888 E1 Aug. 18, 2020, 8:21 a.m. OK PyPy 3 TESTS 21 2683 86732800
90681057 jabhi_18 E1 Aug. 22, 2020, 10:58 a.m. OK PyPy 3 TESTS 21 2713 114995200
90675877 YMSeah E1 Aug. 22, 2020, 9:46 a.m. OK PyPy 3 TESTS 21 2760 133324800
90675773 YMSeah E1 Aug. 22, 2020, 9:44 a.m. OK Python 3 TESTS 21 2261 94003200
90674933 YMSeah E1 Aug. 22, 2020, 9:33 a.m. OK Python 3 TESTS 21 2900 89292800

remove filters

Back to search problems