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 |
---|---|---|---|---|---|---|
1389 | Educational Codeforces Round 92 (Rated for Div. 2) | FINISHED | False | 7200 | 135789899 | July 29, 2020, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 396 ) | G | Directing Edges | PROGRAMMING | dfs and similar dp graphs greedy trees |
B"You are given an undirected connected graph consisting of n vertices and m edges. k vertices of this graph are special. You have to direct each edge of this graph or leave it undirected. If you leave the i -th edge undirected, you pay w_i coins, and if you direct it, you don't have to pay for it. Let's call a vertex saturated if it is reachable from each special vertex along the edges of the graph (if an edge is undirected, it can be traversed in both directions). After you direct the edges of the graph (possibly leaving some of them undirected), you receive c_i coins for each saturated vertex i . Thus, your total profit can be calculated as sum limits_{i in S} c_i - sum limits_{j in U} w_j , where S is the set of saturated vertices, and U is the set of edges you leave undirected. For each vertex i , calculate the maximum possible profit you can get if you have to make the vertex i saturated. The first line contains three integers n , m and k ( 2 <= n <= 3 cdot 10^5 , n - 1 <= m <= min(3 cdot 10^5, frac{n(n-1)}{2}) , 1 <= k <= n ). The second line contains k pairwise distinct integers v_1 , v_2 , ..., v_k ( 1 <= v_i <= n ) -- the indices of the special vertices. The third line contains n integers c_1 , c_2 , ..., c_n ( 0 <= c_i <= 10^9 ). The fourth line contains m integers w_1 , w_2 , ..., w_m ( 0 <= w_i <= 10^9 ). Then m lines follow, the i -th line contains two integers x_i and y_i ( 1 <= x_i, y_i <= n , x_i ne y_i ) -- the endpoints of the i -th edge. There is at most one edge between each pair of vertices. Print n integers, where the i -th integer is the maximum profit you can get if you have to make the vertex i saturated. Consider the first example: The best course of action in the second example"... |
80809 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
88670042 | dysyn1314 | G | Aug. 1, 2020, 1:53 p.m. | OK | GNU C++11 | TESTS | 135 | 249 | 48844800 | ||
91711228 | yy_makemelove | G | Sept. 3, 2020, 11:15 a.m. | OK | GNU C++11 | TESTS | 135 | 280 | 97689600 | ||
88805701 | xiaoh105 | G | Aug. 3, 2020, 2:07 p.m. | OK | GNU C++11 | TESTS | 135 | 311 | 41472000 | ||
88673671 | EncodeTalker | G | Aug. 1, 2020, 2:42 p.m. | OK | GNU C++11 | TESTS | 135 | 312 | 42700800 | ||
91620393 | cnMember | G | Sept. 2, 2020, 7:23 a.m. | OK | GNU C++11 | TESTS | 135 | 327 | 33689600 | ||
88931722 | 2018liuzhiyuan | G | Aug. 5, 2020, 9:15 a.m. | OK | GNU C++11 | TESTS | 135 | 343 | 40652800 | ||
88930756 | 2018liuzhiyuan | G | Aug. 5, 2020, 9:01 a.m. | OK | GNU C++11 | TESTS | 135 | 374 | 43008000 | ||
88740273 | huayucaiji | G | Aug. 2, 2020, 2:53 p.m. | OK | GNU C++11 | TESTS | 135 | 421 | 76390400 | ||
91219814 | WaluntOvO | G | Aug. 28, 2020, 3:01 p.m. | OK | GNU C++11 | TESTS | 135 | 421 | 101990400 | ||
90746314 | ws_zzyer | G | Aug. 23, 2020, 10:23 a.m. | OK | GNU C++11 | TESTS | 135 | 436 | 48332800 | ||
88698277 | SuperJ6 | G | Aug. 2, 2020, 1:30 a.m. | OK | GNU C++14 | TESTS | 135 | 639 | 41574400 | ||
89998564 | nicoing | G | Aug. 15, 2020, 7:52 a.m. | OK | GNU C++14 | TESTS | 135 | 685 | 94924800 | ||
88698331 | SuperJ6 | G | Aug. 2, 2020, 1:33 a.m. | OK | GNU C++14 | TESTS | 135 | 686 | 41574400 | ||
88781630 | vjudge5 | G | Aug. 3, 2020, 8 a.m. | OK | GNU C++14 | TESTS | 135 | 701 | 39321600 | ||
88901878 | krijgertje | G | Aug. 4, 2020, 8:19 p.m. | OK | GNU C++14 | TESTS | 135 | 701 | 51609600 | ||
88901613 | krijgertje | G | Aug. 4, 2020, 8:13 p.m. | OK | GNU C++14 | TESTS | 135 | 701 | 51916800 | ||
90541356 | mahdi.hasnat | G | Aug. 21, 2020, 2:38 p.m. | OK | GNU C++14 | TESTS | 135 | 702 | 68096000 | ||
90195328 | abhi_neel | G | Aug. 17, 2020, 5:18 a.m. | OK | GNU C++14 | TESTS | 135 | 717 | 41779200 | ||
89516433 | nowrin_brown | G | Aug. 10, 2020, 2:08 p.m. | OK | GNU C++14 | TESTS | 135 | 717 | 47308800 | ||
89514762 | nowrin_brown | G | Aug. 10, 2020, 1:48 p.m. | OK | GNU C++14 | TESTS | 135 | 717 | 47308800 | ||
89971611 | iaNTU | G | Aug. 14, 2020, 8:16 p.m. | OK | GNU C++17 | TESTS | 135 | 623 | 40550400 | ||
88637298 | igba | G | Aug. 1, 2020, 5:59 a.m. | OK | GNU C++17 | TESTS | 135 | 670 | 43520000 | ||
88636067 | igba | G | Aug. 1, 2020, 5:35 a.m. | OK | GNU C++17 | TESTS | 135 | 685 | 47206400 | ||
88636338 | igba | G | Aug. 1, 2020, 5:40 a.m. | OK | GNU C++17 | TESTS | 135 | 686 | 43520000 | ||
91556220 | AM. | G | Sept. 1, 2020, 10:25 a.m. | OK | GNU C++17 | TESTS | 135 | 717 | 67891200 | ||
88778951 | marX | G | Aug. 3, 2020, 7:15 a.m. | OK | GNU C++17 | TESTS | 135 | 733 | 68198400 | ||
89535878 | Medeowex | G | Aug. 10, 2020, 8:59 p.m. | OK | GNU C++17 | TESTS | 135 | 748 | 39014400 | ||
88699814 | Falcon__ | G | Aug. 2, 2020, 2:39 a.m. | OK | GNU C++17 | TESTS | 135 | 748 | 70860800 | ||
88892320 | aurinegro | G | Aug. 4, 2020, 5:19 p.m. | OK | GNU C++17 | TESTS | 135 | 748 | 73420800 | ||
89632992 | acccccccc | G | Aug. 12, 2020, 8:06 a.m. | OK | GNU C++17 | TESTS | 135 | 763 | 37171200 | ||
90532786 | hello_codeforces | G | Aug. 21, 2020, 12:52 p.m. | OK | GNU C++17 (64) | TESTS | 135 | 436 | 40038400 | ||
90537469 | hello_codeforces | G | Aug. 21, 2020, 1:53 p.m. | OK | GNU C++17 (64) | TESTS | 135 | 498 | 40038400 | ||
88683564 | emma | G | Aug. 1, 2020, 5:17 p.m. | OK | GNU C++17 (64) | TESTS | 135 | 498 | 58368000 | ||
88716489 | nathanlee726 | G | Aug. 2, 2020, 8:48 a.m. | OK | GNU C++17 (64) | TESTS | 135 | 623 | 70246400 | ||
88750397 | kirdmivus | G | Aug. 2, 2020, 5:12 p.m. | OK | GNU C++17 (64) | TESTS | 135 | 624 | 63078400 | ||
90332090 | Lucina | G | Aug. 18, 2020, 5:19 p.m. | OK | GNU C++17 (64) | TESTS | 135 | 638 | 50073600 | ||
88702839 | AlexFetisov | G | Aug. 2, 2020, 4:26 a.m. | OK | GNU C++17 (64) | TESTS | 135 | 638 | 78438400 | ||
88756669 | wwdd | G | Aug. 2, 2020, 7:14 p.m. | OK | GNU C++17 (64) | TESTS | 135 | 655 | 106905600 | ||
88702860 | AlexFetisov | G | Aug. 2, 2020, 4:27 a.m. | OK | GNU C++17 (64) | TESTS | 135 | 670 | 78438400 | ||
88935369 | Macdu | G | Aug. 5, 2020, 10:09 a.m. | OK | GNU C++17 (64) | TESTS | 135 | 686 | 82534400 | ||
90020824 | meooow | G | Aug. 15, 2020, 1:13 p.m. | OK | Go | TESTS | 135 | 499 | 71168000 | ||
90038832 | meooow | G | Aug. 15, 2020, 5:51 p.m. | OK | Go | TESTS | 135 | 499 | 71270400 | ||
90496595 | PizzaLovers007 | G | Aug. 20, 2020, 9:24 p.m. | OK | Java 11 | TESTS | 135 | 1887 | 207667200 |
Back to search problems