Codeforces Round 722 (Div. 1)

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
1528 Codeforces Round 722 (Div. 1) FINISHED False 8100 115313062 May 24, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 15308 ) A Parsa's Humongous Tree PROGRAMMING brute force dfs and similar dp greedy trees

B"Parsa has a humongous tree on n vertices. On each vertex v he has written two integers l_v and r_v . To make Parsa's tree look even more majestic, Nima wants to assign a number a_v ( l_v <= a_v <= r_v ) to each vertex v such that the beauty of Parsa's tree is maximized. Nima's sense of the beauty is rather bizarre. He defines the beauty of the tree as the sum of |a_u - a_v| over all edges (u, v) of the tree. Since Parsa's tree is too large, Nima can't maximize its beauty on his own. Your task is to find the maximum possible beauty for Parsa's tree. The first line contains an integer t (1 <= t <= 250) -- the number of test cases. The description of the test cases follows. The first line of each test case contains a single integer n (2 <= n <= 10^5) -- the number of vertices in Parsa's tree. The i -th of the following n lines contains two integers l_i and r_i (1 <= l_i <= r_i <= 10^9) . Each of the next n-1 lines contains two integers u and v (1 <= u , v <= n, u neq v) meaning that there is an edge between the vertices u and v in Parsa's tree. It is guaranteed that the given graph is a tree. It is guaranteed that the sum of n over all test cases doesn't exceed 2 cdot 10^5 . For each test case print the maximum possible beauty for Parsa's tree. The trees in the example: In the first test case, one possible assignment is a = {1, 8 } which results in |1 - 8| = 7 . In the second test case, one of the possible assignments is a = {1, 5, 9 } which results in a beauty of |1 - 5| + |5 - 9| = 8 "...

Tutorials

Codeforces Round #722 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
117207152 Gassa A May 24, 2021, 3:04 p.m. OK D TESTS 9 327 24268800
117274799 priority A May 25, 2021, 1:51 a.m. OK GNU C++11 TESTS 9 46 4403200
117189713 Mitsukasa_Ayase A May 24, 2021, 2:43 p.m. OK GNU C++11 TESTS 9 46 4403200
117189779 myx12345 A May 24, 2021, 2:43 p.m. OK GNU C++11 TESTS 9 46 4915200
117195918 jhknmj A May 24, 2021, 2:49 p.m. OK GNU C++11 TESTS 9 46 8806400
117190330 oisdoaiu A May 24, 2021, 2:43 p.m. OK GNU C++11 TESTS 9 62 4403200
117191702 CallmeChallenger A May 24, 2021, 2:44 p.m. OK GNU C++11 TESTS 9 62 5222400
117197702 clfzs A May 24, 2021, 2:51 p.m. OK GNU C++11 TESTS 9 62 8806400
117190594 youngsystem A May 24, 2021, 2:43 p.m. OK GNU C++11 TESTS 9 62 27238400
117190270 01191020csl A May 24, 2021, 2:43 p.m. OK GNU C++11 TESTS 9 77 4812800
117277492 fishcathu. A May 25, 2021, 3:01 a.m. OK GNU C++11 TESTS 9 77 6451200
117203485 yongjun18 A May 24, 2021, 2:59 p.m. OK GNU C++14 TESTS 9 171 6656000
117186514 Gioto A May 24, 2021, 2:40 p.m. OK GNU C++14 TESTS 9 187 6656000
117184736 Lily A May 24, 2021, 2:39 p.m. OK GNU C++14 TESTS 9 187 6656000
117276328 tzxydby A May 25, 2021, 2:36 a.m. OK GNU C++14 TESTS 9 187 6656000
117190432 huaji_qwq A May 24, 2021, 2:43 p.m. OK GNU C++14 TESTS 9 187 8806400
117183343 DmitryGrigorev A May 24, 2021, 2:38 p.m. OK GNU C++14 TESTS 9 202 4915200
117273887 SF-Manman A May 25, 2021, 1:16 a.m. OK GNU C++14 TESTS 9 202 5836800
117188807 espr1t A May 24, 2021, 2:42 p.m. OK GNU C++14 TESTS 9 202 6553600
117212213 hansen111 A May 24, 2021, 3:12 p.m. OK GNU C++14 TESTS 9 202 6656000
117273981 nandonathaniel A May 25, 2021, 1:20 a.m. OK GNU C++14 TESTS 9 202 6656000
117279627 frostr A May 25, 2021, 3:45 a.m. OK GNU C++17 TESTS 9 46 8908800
117253897 iaNTU A May 24, 2021, 5:19 p.m. OK GNU C++17 TESTS 9 77 7475200
117191509 Sutaner A May 24, 2021, 2:44 p.m. OK GNU C++17 TESTS 9 77 12390400
117194409 yukihana0416 A May 24, 2021, 2:47 p.m. OK GNU C++17 TESTS 9 109 21196800
117258502 collapse A May 24, 2021, 5:59 p.m. OK GNU C++17 TESTS 9 156 6553600
117194101 windy7926778 A May 24, 2021, 2:47 p.m. OK GNU C++17 TESTS 9 156 10240000
117278871 anubhav100rao A May 25, 2021, 3:29 a.m. OK GNU C++17 TESTS 9 186 10240000
117211965 aa2985759 A May 24, 2021, 3:12 p.m. OK GNU C++17 TESTS 9 186 10444800
117276646 Altale0 A May 25, 2021, 2:43 a.m. OK GNU C++17 TESTS 9 187 6041600
117188696 yaufung A May 24, 2021, 2:42 p.m. OK GNU C++17 TESTS 9 187 6553600
117184777 LayCurse A May 24, 2021, 2:39 p.m. OK GNU C++17 (64) TESTS 9 61 106291200
117186329 zlt1117 A May 24, 2021, 2:40 p.m. OK GNU C++17 (64) TESTS 9 108 7782400
117184607 Fuyuki A May 24, 2021, 2:39 p.m. OK GNU C++17 (64) TESTS 9 109 12595200
117195463 Jerry_L A May 24, 2021, 2:48 p.m. OK GNU C++17 (64) TESTS 9 140 17715200
117192623 heno239 A May 24, 2021, 2:45 p.m. OK GNU C++17 (64) TESTS 9 155 5529600
117271847 Ari A May 24, 2021, 11:46 p.m. OK GNU C++17 (64) TESTS 9 155 7782400
117187181 Bakry_ A May 24, 2021, 2:41 p.m. OK GNU C++17 (64) TESTS 9 155 7782400
117262976 DocDoor A May 24, 2021, 7:06 p.m. OK GNU C++17 (64) TESTS 9 155 7782400
117258604 over_flow A May 24, 2021, 6 p.m. OK GNU C++17 (64) TESTS 9 155 8499200
117183227 yhx-12243 A May 24, 2021, 2:38 p.m. OK GNU C++17 (64) TESTS 9 155 8806400
117183678 uwi A May 24, 2021, 2:38 p.m. OK Java 11 TESTS 9 296 1945600
117256283 codeforpractise A May 24, 2021, 5:35 p.m. OK Java 11 TESTS 9 327 15667200
117271332 lucasr A May 24, 2021, 11:18 p.m. OK Java 11 TESTS 9 451 5529600
117264233 Discombobulated A May 24, 2021, 7:29 p.m. OK Java 11 TESTS 9 467 8908800
117194932 LNB A May 24, 2021, 2:47 p.m. OK Java 11 TESTS 9 498 22630400
117207651 cirno3153 A May 24, 2021, 3:05 p.m. OK Java 11 TESTS 9 529 20889600
117265961 devil_the_coder A May 24, 2021, 8:08 p.m. OK Java 11 TESTS 9 607 32153600
117270593 asamanta A May 24, 2021, 10:35 p.m. OK Java 11 TESTS 9 608 16588800
117196850 nick_301 A May 24, 2021, 2:50 p.m. OK Java 11 TESTS 9 608 21094400
117266301 devil_the_coder A May 24, 2021, 8:16 p.m. OK Java 11 TESTS 9 608 32153600
117196968 hu_tao A May 24, 2021, 2:50 p.m. OK Java 8 TESTS 9 265 8601600
117190484 fetetriste A May 24, 2021, 2:43 p.m. OK Java 8 TESTS 9 295 0
117272622 weak_child1 A May 25, 2021, 12:22 a.m. OK Java 8 TESTS 9 326 1228800
117194121 dalt A May 24, 2021, 2:47 p.m. OK Java 8 TESTS 9 358 6553600
117200160 pulkit1411 A May 24, 2021, 2:54 p.m. OK Java 8 TESTS 9 530 48128000
117213987 ika A May 24, 2021, 3:15 p.m. OK Java 8 TESTS 9 561 14848000
117243510 wphsucf A May 24, 2021, 4:23 p.m. OK Java 8 TESTS 9 607 16691200
117198392 YahiaSherif A May 24, 2021, 2:52 p.m. OK Java 8 TESTS 9 623 21504000
117269370 mareshkau A May 24, 2021, 9:43 p.m. OK Java 8 TESTS 9 966 70963200
117273081 Spheniscine A May 25, 2021, 12:43 a.m. OK Kotlin TESTS 9 374 17100800
117193821 Hakiobo A May 24, 2021, 2:46 p.m. OK Kotlin TESTS 9 592 20889600
117202710 Tlatoani A May 24, 2021, 2:58 p.m. OK Kotlin TESTS 9 748 20787200
117235762 titia A May 24, 2021, 4:01 p.m. OK Kotlin TESTS 9 826 18432000
117201311 tarattata1 A May 24, 2021, 2:56 p.m. OK MS C++ 2017 TESTS 9 249 4096000
117188471 Madball A May 24, 2021, 2:42 p.m. OK MS C++ 2017 TESTS 9 249 4710400
117197342 grey A May 24, 2021, 2:50 p.m. OK MS C++ 2017 TESTS 9 686 5529600
117191987 fairy_lettuce A May 24, 2021, 2:45 p.m. OK .NET Core C# TESTS 9 358 27443200
117202115 riantkb A May 24, 2021, 2:57 p.m. OK .NET Core C# TESTS 9 498 23756800
117188926 azukun A May 24, 2021, 2:42 p.m. OK .NET Core C# TESTS 9 514 36966400
117192298 dolphinigle A May 24, 2021, 2:45 p.m. OK PyPy 2 TESTS 9 748 27852800
117254331 titia A May 24, 2021, 5:21 p.m. OK PyPy 3 TESTS 9 514 33382400
117269293 FlakeLCR A May 24, 2021, 9:41 p.m. OK PyPy 3 TESTS 9 577 32972800
117255387 Kiri8128 A May 24, 2021, 5:28 p.m. OK PyPy 3 TESTS 9 702 43520000
117257895 jimm89 A May 24, 2021, 5:52 p.m. OK PyPy 3 TESTS 9 763 42291200
117255318 titia A May 24, 2021, 5:28 p.m. OK PyPy 3 TESTS 9 779 65945600
117197582 at_f A May 24, 2021, 2:51 p.m. OK PyPy 3 TESTS 9 780 46387200
117263896 FlakeLCR A May 24, 2021, 7:22 p.m. OK PyPy 3 TESTS 9 842 52736000
117203445 Kiri8128 A May 24, 2021, 2:59 p.m. OK PyPy 3 TESTS 9 858 55296000
117197833 not_tehlka A May 24, 2021, 2:51 p.m. OK PyPy 3 TESTS 9 904 47308800
117256833 titia A May 24, 2021, 5:41 p.m. OK PyPy 3 TESTS 9 936 68300800
117194802 cottoncotton A May 24, 2021, 2:47 p.m. OK Rust TESTS 9 78 7680000
117193626 shino16 A May 24, 2021, 2:46 p.m. OK Rust TESTS 9 124 15769600
117211015 orz_liuwei A May 24, 2021, 3:10 p.m. OK Rust TESTS 9 140 14438400
117187515 sansen A May 24, 2021, 2:41 p.m. OK Rust TESTS 9 155 16896000
117195329 toomer A May 24, 2021, 2:48 p.m. OK Rust TESTS 9 155 20070400
117194298 ngtkana A May 24, 2021, 2:47 p.m. OK Rust TESTS 9 249 8294400

remove filters

Back to search problems