Codeforces Round 543 (Div. 1, based on Technocup 2019 Final Round)

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
1120 Codeforces Round 543 (Div. 1, based on Technocup 2019 Final Round) FINISHED False 7200 185725511 March 3, 2019, 3:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1454 ) D Power Tree PROGRAMMING dfs and similar dp ds graphs greedy trees 2400

B"You are given a rooted tree with n vertices, the root of the tree is the vertex 1 . Each vertex has some non-negative price. A leaf of the tree is a non-root vertex that has degree 1 . Arkady and Vasily play a strange game on the tree. The game consists of three stages. On the first stage Arkady buys some non-empty set of vertices of the tree. On the second stage Vasily puts some integers into all leaves of the tree. On the third stage Arkady can perform several (possibly none) operations of the following kind: choose some vertex v he bought on the first stage and some integer x , and then add x to all integers in the leaves in the subtree of v . The integer x can be positive, negative of zero. A leaf a is in the subtree of a vertex b if and only if the simple path between a and the root goes through b . Arkady's task is to make all integers in the leaves equal to zero. What is the minimum total cost s he has to pay on the first stage to guarantee his own win independently of the integers Vasily puts on the second stage? Also, we ask you to find all such vertices that there is an optimal (i.e. with cost s ) set of vertices containing this one such that Arkady can guarantee his own win buying this set on the first stage. The first line contains a single integer n ( 2 <= n <= 200 ,000 ) -- the number of vertices in the tree. The second line contains n integers c_1, c_2, ldots, c_n ( 0 <= c_i <= 10^9 ), where c_i is the price of the i -th vertex. Each of the next n - 1 lines contains two integers a and b ( 1 <= a, b <= n ), denoting an edge of the tree. In the first line print two integers: the minimum possible cost s Arkady has to pay to guarantee his own win, and the number of vertices k that belong to at least one optimal set. In the second line print k distinct integers in increasing order the "...

Tutorials

Разбор задач финала Технокубка 2019 и Codeforces Round #543

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
50754280 rainboy D March 3, 2019, 5:03 p.m. OK GNU C11 TESTS 86 873 18329600 2400
53002836 EncodeTalker D April 19, 2019, 8:03 a.m. OK GNU C++11 TESTS 86 109 19968000 2400
51431142 ymz D March 18, 2019, 12:22 a.m. OK GNU C++11 TESTS 86 124 17408000 2400
51931251 shaojianan D March 28, 2019, 10:29 a.m. OK GNU C++11 TESTS 86 124 19968000 2400
54562711 nantf D May 24, 2019, 2:44 p.m. OK GNU C++11 TESTS 86 124 22323200 2400
51264599 yybyyb D March 13, 2019, 2:55 p.m. OK GNU C++11 TESTS 86 124 24780800 2400
53304261 menjiantong D April 26, 2019, 12:42 a.m. OK GNU C++11 TESTS 86 124 31129600 2400
54550145 luogu_bot2 D May 24, 2019, 8:36 a.m. OK GNU C++11 TESTS 86 140 20582400 2400
54550156 stal_xy23z7b8 D May 24, 2019, 8:37 a.m. OK GNU C++11 TESTS 86 140 20582400 2400
69897178 vjudge3 D Jan. 31, 2020, 12:04 p.m. OK GNU C++11 TESTS 86 155 23040000 2400
50783962 Sooke D March 4, 2019, 12:36 p.m. OK GNU C++11 TESTS 86 155 24064000 2400
50801683 qiqi20021026 D March 5, 2019, 12:27 a.m. OK GNU C++14 TESTS 86 186 31641600 2400
52511123 sunyunqi D April 8, 2019, 11:12 p.m. OK GNU C++14 TESTS 86 217 18227200 2400
53324158 ragnarosS D April 26, 2019, 2:36 p.m. OK GNU C++14 TESTS 86 218 17817600 2400
52512859 pkgunboat D April 9, 2019, 1:40 a.m. OK GNU C++14 TESTS 86 218 20787200 2400
52512882 pkgunboat D April 9, 2019, 1:41 a.m. OK GNU C++14 TESTS 86 233 24473600 2400
50779950 mayaohua2003 D March 4, 2019, 10:52 a.m. OK GNU C++14 TESTS 86 233 24985600 2400
51041292 antguz D March 8, 2019, 5:05 p.m. OK GNU C++14 TESTS 86 248 20377600 2400
50807740 alechuang98 D March 5, 2019, 6:37 a.m. OK GNU C++14 TESTS 86 249 19558400 2400
53488952 RNS_KSB D April 29, 2019, 6:59 a.m. OK GNU C++14 TESTS 86 249 20172800 2400
50779403 wwwxxxddd D March 4, 2019, 10:36 a.m. OK GNU C++14 TESTS 86 249 23040000 2400
68724957 yosupo D Jan. 13, 2020, 5:36 p.m. OK GNU C++17 TESTS 86 187 39219200 2400
50912832 Kalashnikov D March 7, 2019, 3:59 a.m. OK GNU C++17 TESTS 86 202 17612800 2400
50808637 luogu_bot1 D March 5, 2019, 7:13 a.m. OK GNU C++17 TESTS 86 202 17612800 2400
50808617 374272 D March 5, 2019, 7:12 a.m. OK GNU C++17 TESTS 86 202 17612800 2400
50804022 JiangYutong D March 5, 2019, 3:28 a.m. OK GNU C++17 TESTS 86 202 18227200 2400
60351992 llbra9z D Sept. 10, 2019, 2:39 p.m. OK GNU C++17 TESTS 86 218 19046400 2400
60352168 luogu_bot5 D Sept. 10, 2019, 2:43 p.m. OK GNU C++17 TESTS 86 218 19046400 2400
61213151 yuxizi D Sept. 24, 2019, 12:02 p.m. OK GNU C++17 TESTS 86 218 22118400 2400
62822882 vjudge1 D Oct. 17, 2019, 5:10 p.m. OK GNU C++17 TESTS 86 218 26214400 2400
52221235 jkxjkx1031 D April 2, 2019, 6:42 a.m. OK GNU C++17 TESTS 86 233 26419200 2400
50759061 uwi D March 3, 2019, 6:26 p.m. OK Java 8 TESTS 86 389 13312000 2400
64939721 dalt D Nov. 15, 2019, 3:39 a.m. OK Java 8 TESTS 86 467 115609600 2400
50999124 Jeel_Vaishnav D March 8, 2019, 5:55 a.m. OK Java 8 TESTS 86 639 109158400 2400
60828861 gamesterrex D Sept. 19, 2019, 5:52 a.m. OK Java 8 TESTS 86 701 112128000 2400
60828957 gamesterrex D Sept. 19, 2019, 5:56 a.m. OK Java 8 TESTS 86 702 115097600 2400
60748181 beginner1010 D Sept. 18, 2019, 3:55 a.m. OK Java 8 TESTS 86 716 81203200 2400
50753187 ilyakor D March 3, 2019, 4:50 p.m. OK Java 8 TESTS 86 764 70451200 2400
50766905 Dukkha D March 3, 2019, 11:20 p.m. OK Java 8 TESTS 86 889 113971200 2400
51475323 xodiac D March 19, 2019, 9:02 a.m. OK Java 8 TESTS 86 1138 139776000 2400
64478709 vjudge2 D Nov. 7, 2019, 3:12 p.m. OK MS C++ TESTS 86 187 20992000 2400
50916094 LoneFox D March 7, 2019, 6:27 a.m. OK MS C++ TESTS 86 327 24268800 2400
67277711 sansen D Dec. 20, 2019, 10:51 a.m. OK Rust TESTS 86 358 32051200 2400

remove filters

Back to search problems