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 |
---|---|---|---|---|---|---|
1303 | Educational Codeforces Round 82 (Rated for Div. 2) | FINISHED | False | 7200 | 155834711 | Feb. 12, 2020, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 831 ) | G | Sum of Prefix Sums | PROGRAMMING | data structures divide and conquer geometry trees | 2700 |
B'We define the sum of prefix sums of an array [s_1, s_2, ... , s_k] as s_1 + (s_1 + s_2) + (s_1 + s_2 + s_3) + ... + (s_1 + s_2 + ... + s_k) . You are given a tree consisting of n vertices. Each vertex i has an integer a_i written on it. We define the value of the simple path from vertex u to vertex v as follows: consider all vertices appearing on the path from u to v , write down all the numbers written on these vertices in the order they appear on the path, and compute the sum of prefix sums of the resulting sequence. Your task is to calculate the maximum value over all paths in the tree. The first line contains one integer n ( 2 <= n <= 150000 ) -- the number of vertices in the tree. Then n - 1 lines follow, representing the edges of the tree. Each line contains two integers u_i and v_i ( 1 <= u_i, v_i <= n , u_i ne v_i ), denoting an edge between vertices u_i and v_i . It is guaranteed that these edges form a tree. The last line contains n integers a_1 , a_2 , ..., a_n ( 1 <= a_i <= 10^6 ). Print one integer -- the maximum value over all paths in the tree. The best path in the first example is from vertex 3 to vertex 1 . It gives the sequence [3, 3, 7, 1] , and the sum of prefix sums is 36 . '... |
Educational Codeforces Round 82 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
70916063 | rainboy | G | Feb. 12, 2020, 7:51 p.m. | OK | GNU C11 | TESTS | 69 | 2698 | 22937600 | 2700 | |
70929500 | rainboy | G | Feb. 13, 2020, 4:26 a.m. | OK | GNU C11 | TESTS | 69 | 2948 | 22937600 | 2700 | |
70941467 | WZYYN | G | Feb. 13, 2020, 8:33 a.m. | OK | GNU C++11 | TESTS | 70 | 545 | 113254400 | 2700 | |
71076481 | s_r_f | G | Feb. 14, 2020, 5:29 p.m. | OK | GNU C++11 | TESTS | 70 | 811 | 25395200 | 2700 | |
70889840 | XLor | G | Feb. 12, 2020, 4:01 p.m. | OK | GNU C++11 | TESTS | 69 | 857 | 15667200 | 2700 | |
70920766 | eriksuenderhauf | G | Feb. 12, 2020, 10:09 p.m. | OK | GNU C++11 | TESTS | 69 | 873 | 42188800 | 2700 | |
70920598 | eriksuenderhauf | G | Feb. 12, 2020, 10:03 p.m. | OK | GNU C++11 | TESTS | 69 | 873 | 42291200 | 2700 | |
70933572 | Frame233 | G | Feb. 13, 2020, 5:56 a.m. | OK | GNU C++11 | TESTS | 69 | 1045 | 48844800 | 2700 | |
71044499 | function_of_zero | G | Feb. 14, 2020, 8 a.m. | OK | GNU C++11 | TESTS | 70 | 1154 | 30310400 | 2700 | |
70909327 | The.Last.Wizard | G | Feb. 12, 2020, 5:52 p.m. | OK | GNU C++11 | TESTS | 69 | 1232 | 20582400 | 2700 | |
71053974 | knon0501 | G | Feb. 14, 2020, 11:03 a.m. | OK | GNU C++11 | TESTS | 70 | 1372 | 109363200 | 2700 | |
70949259 | Juney | G | Feb. 13, 2020, 10:43 a.m. | OK | GNU C++11 | TESTS | 70 | 1528 | 536371200 | 2700 | |
70926122 | wucstdio | G | Feb. 13, 2020, 2:37 a.m. | OK | GNU C++14 | TESTS | 69 | 561 | 31334400 | 2700 | |
70883386 | tmwilliamlin168 | G | Feb. 12, 2020, 3:43 p.m. | OK | GNU C++14 | TESTS | 69 | 826 | 30003200 | 2700 | |
70892936 | kmjp | G | Feb. 12, 2020, 4:10 p.m. | OK | GNU C++14 | TESTS | 69 | 841 | 43110400 | 2700 | |
70916789 | ksun123 | G | Feb. 12, 2020, 8:05 p.m. | OK | GNU C++14 | TESTS | 69 | 842 | 30003200 | 2700 | |
70906207 | sshs18102 | G | Feb. 12, 2020, 5:11 p.m. | OK | GNU C++14 | TESTS | 69 | 857 | 35123200 | 2700 | |
70943453 | sshs18102 | G | Feb. 13, 2020, 9:06 a.m. | OK | GNU C++14 | TESTS | 70 | 889 | 27750400 | 2700 | |
70896282 | ManstaCate | G | Feb. 12, 2020, 4:20 p.m. | OK | GNU C++14 | TESTS | 69 | 904 | 29184000 | 2700 | |
70947935 | makacha | G | Feb. 13, 2020, 10:18 a.m. | OK | GNU C++14 | TESTS | 70 | 935 | 44748800 | 2700 | |
71037273 | arnold518 | G | Feb. 14, 2020, 5:51 a.m. | OK | GNU C++14 | TESTS | 70 | 982 | 16384000 | 2700 | |
70950863 | Owen_codeisking | G | Feb. 13, 2020, 11:17 a.m. | OK | GNU C++14 | TESTS | 70 | 1060 | 23142400 | 2700 | |
70916637 | Jatana | G | Feb. 12, 2020, 8:02 p.m. | OK | GNU C++17 | TESTS | 69 | 530 | 88576000 | 2700 | |
71033664 | neal | G | Feb. 14, 2020, 4:29 a.m. | OK | GNU C++17 | TESTS | 70 | 561 | 24780800 | 2700 | |
71079587 | neal | G | Feb. 14, 2020, 6:31 p.m. | OK | GNU C++17 | TESTS | 70 | 561 | 24780800 | 2700 | |
70936308 | neal | G | Feb. 13, 2020, 6:51 a.m. | OK | GNU C++17 | TESTS | 69 | 592 | 24780800 | 2700 | |
71079595 | neal | G | Feb. 14, 2020, 6:32 p.m. | OK | GNU C++17 | TESTS | 70 | 592 | 24780800 | 2700 | |
71079399 | neal | G | Feb. 14, 2020, 6:28 p.m. | OK | GNU C++17 | TESTS | 70 | 592 | 24780800 | 2700 | |
71079349 | neal | G | Feb. 14, 2020, 6:27 p.m. | OK | GNU C++17 | TESTS | 70 | 607 | 24780800 | 2700 | |
70936214 | neal | G | Feb. 13, 2020, 6:49 a.m. | OK | GNU C++17 | TESTS | 69 | 623 | 24780800 | 2700 | |
70936374 | neal | G | Feb. 13, 2020, 6:52 a.m. | OK | GNU C++17 | TESTS | 69 | 655 | 24780800 | 2700 | |
70954368 | andrew | G | Feb. 13, 2020, 12:22 p.m. | OK | GNU C++17 | TESTS | 70 | 779 | 41574400 | 2700 | |
71096226 | dalt | G | Feb. 15, 2020, 5:01 a.m. | OK | Java 8 | TESTS | 70 | 2121 | 60928000 | 2700 | |
70917047 | ashraf101 | G | Feb. 12, 2020, 8:13 p.m. | OK | Java 8 | TESTS | 69 | 2215 | 41779200 | 2700 | |
70916173 | Harpae | G | Feb. 12, 2020, 7:53 p.m. | OK | Java 8 | TESTS | 69 | 2355 | 41779200 | 2700 | |
71096194 | dalt | G | Feb. 15, 2020, 5 a.m. | OK | Java 8 | TESTS | 70 | 2730 | 60928000 | 2700 | |
70916359 | Harpae | G | Feb. 12, 2020, 7:56 p.m. | OK | Java 8 | TESTS | 69 | 3650 | 80076800 | 2700 |
Back to search problems