Codeforces Round 872 (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
1824 Codeforces Round 872 (Div. 1) FINISHED False 7200 53632463 May 8, 2023, 12:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 137 ) E LuoTianyi and Cartridge PROGRAMMING data structures trees 3500

B"LuoTianyi is watching the anime Made in Abyss. She finds that making a Cartridge is interesting. To describe the process of making a Cartridge more clearly, she abstracts the original problem and gives you the following problem. You are given a tree T consisting of n vertices. Each vertex has values a_i and b_i and each edge has values c_j and d_j . Now you are aim to build a tree T' as follows: Let A be the minimum of values a_i in T' and C be the minimum of values c_i in T' . Let B be the sum of b_i in T' and D be the sum of values d_i in T' . Let min(A, C) cdot (B + D) be the cost of T' . You need to find the maximum possible cost of T' . The first line contains one integer n ( 3 <= n <= 2 cdot 10^5 ) -- the number of vertices in the tree T . The second line contains n integers a_1, a_2, ldots, a_n ( 1 <= a_i <= 2 cdot 10^5 ), where the i -th integer represents the a_i value of the i -th vertex. The third line contains n integers b_1, b_2, ldots, b_n ( 1 <= b_i <= 2 cdot 10^5 ), where the i -th integer represents the b_i value of the i -th vertex. Then n-1 lines follow, the j -th of them contains four integers x_j,y_j,c_j,d_j ( 1 <= x_j,y_j <= n,1 <= c_j,d_j <= 2 cdot 10^5 ) representing the edge (x_j,y_j) and its values c_j and d_j respectively. It's guaranteed that edges form a tree. Print a single integer -- the maximum possible cost of T' . The tree from the first example is shown in the statement. The tree from the second example is shown below: A = 1, B = 18, C = 1, D = 17 , so the cost is min(1,1) cdot (18 + 17) = 35 . "...

Tutorials

CodeForces Round 872(Div. 1&2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
206325093 2000031264 E May 18, 2023, 10:20 a.m. OK GNU C++14 TESTS 59 826 92876800 3500
205443063 grass8sheep E May 11, 2023, 2:32 p.m. OK GNU C++14 TESTS 59 919 92876800 3500
205186716 roohaande E May 9, 2023, 5:40 a.m. OK GNU C++14 TESTS 58 935 39321600 3500
205443087 grass8sheep E May 11, 2023, 2:33 p.m. OK GNU C++14 TESTS 59 935 92876800 3500
205378716 jiaosiyuan E May 11, 2023, 12:47 a.m. OK GNU C++14 TESTS 58 1013 91340800 3500
205378729 jiaosiyuan E May 11, 2023, 12:47 a.m. OK GNU C++14 TESTS 58 1029 91340800 3500
205378637 jiaosiyuan E May 11, 2023, 12:45 a.m. OK GNU C++14 TESTS 58 1044 91340800 3500
205715750 Mango2011 E May 13, 2023, 12:14 p.m. OK GNU C++14 TESTS 59 1107 47820800 3500
205326301 luogu_bot3 E May 10, 2023, 12:31 p.m. OK GNU C++14 TESTS 58 1123 90112000 3500
205694626 C1942huangjiaxu E May 13, 2023, 8:48 a.m. OK GNU C++14 TESTS 59 1247 266240000 3500
205445833 vamsipalapati_15 E May 11, 2023, 2:56 p.m. OK GNU C++17 TESTS 59 810 71372800 3500
205388309 gottipatiyasaswini E May 11, 2023, 4:44 a.m. OK GNU C++17 TESTS 59 810 71372800 3500
205632063 Pavan125 E May 12, 2023, 6:08 p.m. OK GNU C++17 TESTS 59 842 92876800 3500
205593030 21h51a6677 E May 12, 2023, 3:36 p.m. OK GNU C++17 TESTS 59 889 92876800 3500
205445740 Ahmed_Nassar E May 11, 2023, 2:55 p.m. OK GNU C++17 TESTS 59 889 92876800 3500
205692773 2000032077cse E May 13, 2023, 8:34 a.m. OK GNU C++17 TESTS 59 904 92876800 3500
206320002 soudhamini_2000031088 E May 18, 2023, 9:27 a.m. OK GNU C++17 TESTS 59 919 92876800 3500
205972491 Karthik1106 E May 15, 2023, 11:17 a.m. OK GNU C++17 TESTS 59 935 92876800 3500
205940557 neerajam E May 15, 2023, 4:35 a.m. OK GNU C++17 TESTS 59 935 92876800 3500
205130495 Um_nik E May 8, 2023, 2:46 p.m. OK GNU C++17 TESTS 58 1263 130969600 3500
205513118 yzc2005 E May 12, 2023, 8:19 a.m. OK GNU C++17 (64) TESTS 59 608 78233600 3500
205389216 Alex_Wei E May 11, 2023, 5:01 a.m. OK GNU C++17 (64) TESTS 59 1013 126668800 3500
205222196 sunzh E May 9, 2023, 12:19 p.m. OK GNU C++17 (64) TESTS 58 1029 88166400 3500
205331173 keyijing E May 10, 2023, 1:15 p.m. OK GNU C++17 (64) TESTS 58 1216 65228800 3500
205199896 Kubic E May 9, 2023, 8:38 a.m. OK GNU C++17 (64) TESTS 58 1248 91340800 3500
205199227 chappy1 E May 9, 2023, 8:30 a.m. OK GNU C++17 (64) TESTS 58 1294 91340800 3500
205193800 Kubic E May 9, 2023, 7:21 a.m. OK GNU C++17 (64) TESTS 58 1294 91340800 3500
205337143 tricyzhkx E May 10, 2023, 2:07 p.m. OK GNU C++17 (64) TESTS 58 1310 63283200 3500
205742136 zihouzhong E May 13, 2023, 4:30 p.m. OK GNU C++17 (64) TESTS 59 1840 181657600 3500
205433529 BeyondHeaven E May 11, 2023, 1:12 p.m. OK GNU C++17 (64) TESTS 59 1903 181657600 3500
206340717 orazaly78 E May 18, 2023, 12:42 p.m. OK GNU C++20 (64) TESTS 59 499 30208000 3500
205235861 acniu E May 9, 2023, 2:15 p.m. OK GNU C++20 (64) TESTS 58 514 30208000 3500
205514104 Soner trrsnb E May 12, 2023, 8:28 a.m. OK GNU C++20 (64) TESTS 59 592 78233600 3500
205235298 acniu E May 9, 2023, 2:10 p.m. OK GNU C++20 (64) TESTS 58 795 46182400 3500
205232550 acniu E May 9, 2023, 1:46 p.m. OK GNU C++20 (64) TESTS 58 826 46080000 3500
205224230 TonyStark_987 E May 9, 2023, 12:36 p.m. OK GNU C++20 (64) TESTS 58 919 54374400 3500
205217624 iliya7 E May 9, 2023, 11:39 a.m. OK GNU C++20 (64) TESTS 58 919 54374400 3500
205186629 CrTsIr E May 9, 2023, 5:39 a.m. OK GNU C++20 (64) TESTS 58 919 54374400 3500
206011386 srinija_chowdary9 E May 15, 2023, 4:58 p.m. OK GNU C++20 (64) TESTS 59 997 54374400 3500
205317548 DataStructures E May 10, 2023, 11:04 a.m. OK GNU C++20 (64) TESTS 58 1060 64819200 3500

remove filters

Back to search problems