Codeforces Round 514 (Div. 2)

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
1059 Codeforces Round 514 (Div. 2) FINISHED False 7200 198775523 Oct. 5, 2018, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1469 ) E Split the Tree PROGRAMMING binary search data structures dp greedy trees 2400

B'You are given a rooted tree on n vertices, its root is the vertex number 1 . The i -th vertex contains a number w_i . Split it into the minimum possible number of vertical paths in such a way that each path contains no more than L vertices and the sum of integers w_i on each path does not exceed S . Each vertex should belong to exactly one path. A vertical path is a sequence of vertices v_1, v_2, ldots, v_k where v_i ( i ge 2 ) is the parent of v_{i - 1} . The first line contains three integers n , L , S ( 1 <= n <= 10^5 , 1 <= L <= 10^5 , 1 <= S <= 10^{18} ) -- the number of vertices, the maximum number of vertices in one path and the maximum sum in one path. The second line contains n integers w_1, w_2, ldots, w_n ( 1 <= w_i <= 10^9 ) -- the numbers in the vertices of the tree. The third line contains n - 1 integers p_2, ldots, p_n ( 1 <= p_i < i ), where p_i is the parent of the i -th vertex in the tree. Output one number -- the minimum number of vertical paths. If it is impossible to split the tree, output -1 . In the first sample the tree is split into {1 }, {2 }, {3 } . In the second sample the tree is split into {1, 2 }, {3 } or {1, 3 }, {2 } . In the third sample it is impossible to split the tree. '...

Tutorials

Codeforces Round #514 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
44254274 oyldz93 E Oct. 13, 2018, 11:44 a.m. OK GNU C11 TESTS 27 46 9625600 2400
43978507 SovietPower E Oct. 7, 2018, 11:37 p.m. OK GNU C++11 TESTS 27 31 6348800 2400
44525412 FlashHu E Oct. 19, 2018, 1:48 a.m. OK GNU C++11 TESTS 27 31 9728000 2400
48715355 Rayment E Jan. 22, 2019, 10:55 a.m. OK GNU C++11 TESTS 27 31 13824000 2400
43850761 zyfzyf E Oct. 5, 2018, 3:41 p.m. OK GNU C++11 TESTS 27 31 18329600 2400
54548185 __23333 E May 24, 2019, 7:31 a.m. OK GNU C++11 TESTS 27 31 20684800 2400
64197847 Even_Bao E Nov. 4, 2019, 10:25 a.m. OK GNU C++11 TESTS 27 31 20889600 2400
46361689 Clao_015 E Nov. 29, 2018, 11:29 a.m. OK GNU C++11 TESTS 27 31 29184000 2400
46361770 luogu_bot1 E Nov. 29, 2018, 11:30 a.m. OK GNU C++11 TESTS 27 31 29184000 2400
53846501 Connected_failed E May 7, 2019, 11:17 a.m. OK GNU C++11 TESTS 27 31 63385600 2400
53869974 Connected_failed E May 8, 2019, 8:10 a.m. OK GNU C++11 TESTS 27 31 112230400 2400
44111998 remoon E Oct. 11, 2018, 12:18 p.m. OK GNU C++14 TESTS 27 61 63897600 2400
45437030 lwqqq E Nov. 8, 2018, 8:37 a.m. OK GNU C++14 TESTS 27 62 1228800 2400
46573306 hungbmt1503 E Dec. 4, 2018, 7:14 a.m. OK GNU C++14 TESTS 27 62 1228800 2400
44334012 GT_18 E Oct. 14, 2018, 8:02 p.m. OK GNU C++14 TESTS 27 62 2457600 2400
46136463 IPRIT E Nov. 24, 2018, 6:09 a.m. OK GNU C++14 TESTS 27 62 13619200 2400
53191405 jpSwing E April 23, 2019, 1:03 p.m. OK GNU C++14 TESTS 27 62 14848000 2400
43911572 nickluo E Oct. 6, 2018, 4:29 p.m. OK GNU C++14 TESTS 27 62 21094400 2400
46677850 Nostalgically E Dec. 6, 2018, 10:45 a.m. OK GNU C++14 TESTS 27 62 45568000 2400
43950097 gs15120 E Oct. 7, 2018, 3:51 p.m. OK GNU C++14 TESTS 27 77 1638400 2400
44651088 sourav54 E Oct. 21, 2018, 11:30 a.m. OK GNU C++14 TESTS 27 77 1740800 2400
43906386 Mlxa E Oct. 6, 2018, 2:15 p.m. OK GNU C++17 TESTS 27 31 1331200 2400
44751192 ReaLNero1 E Oct. 23, 2018, 8:02 p.m. OK GNU C++17 TESTS 27 31 1536000 2400
43951756 MccNess E Oct. 7, 2018, 4:52 p.m. OK GNU C++17 TESTS 27 62 1638400 2400
62187728 vjudge3 E Oct. 9, 2019, 8:46 a.m. OK GNU C++17 TESTS 27 62 3993600 2400
44056246 lavin E Oct. 10, 2018, 12:43 a.m. OK GNU C++17 TESTS 27 62 9932800 2400
43982856 fdironia E Oct. 8, 2018, 4:37 a.m. OK GNU C++17 TESTS 27 77 921600 2400
43921505 pyBlob E Oct. 7, 2018, 12:10 a.m. OK GNU C++17 TESTS 27 77 1228800 2400
49966293 almasip E Feb. 15, 2019, 8:57 p.m. OK GNU C++17 TESTS 27 77 1740800 2400
43905906 Mlxa E Oct. 6, 2018, 2:05 p.m. OK GNU C++17 TESTS 27 77 2457600 2400
43941940 pyBlob E Oct. 7, 2018, 11:52 a.m. OK GNU C++17 TESTS 27 77 2969600 2400
43860275 Jeel_Vaishnav E Oct. 5, 2018, 4:29 p.m. OK Java 8 TESTS 27 186 13824000 2400
46575687 donli E Dec. 4, 2018, 8:33 a.m. OK Java 8 TESTS 27 187 23449600 2400
43856546 Harpae E Oct. 5, 2018, 4:11 p.m. OK Java 8 TESTS 27 218 29184000 2400
61524337 beginner1010 E Sept. 29, 2019, 8:59 p.m. OK Java 8 TESTS 27 218 46182400 2400
43917332 apurvaj E Oct. 6, 2018, 7:40 p.m. OK Java 8 TESTS 27 280 45056000 2400
43871722 Aemon E Oct. 5, 2018, 9:11 p.m. OK Java 8 TESTS 27 295 51404800 2400
43897510 PrakharJain E Oct. 6, 2018, 11:24 a.m. OK Java 8 TESTS 27 342 53964800 2400
68068444 dalt E Jan. 2, 2020, 9:04 a.m. OK Java 8 TESTS 27 358 53555200 2400
46631430 donli E Dec. 5, 2018, 3:24 a.m. OK Java 8 TESTS 27 421 102604800 2400
51603703 7dan E March 21, 2019, 6:06 a.m. OK Java 8 TESTS 27 436 45465600 2400
62910221 yst_ E Oct. 19, 2019, 7:05 a.m. OK MS C++ TESTS 27 62 32460800 2400
57930030 vjudge2 E July 29, 2019, 8:24 a.m. OK MS C++ TESTS 27 78 16384000 2400
43856643 waItz7l9 E Oct. 5, 2018, 4:11 p.m. OK MS C++ TESTS 27 93 34099200 2400
46051409 deriski02 E Nov. 22, 2018, 7:43 a.m. OK MS C++ TESTS 27 108 41881600 2400
43984597 abtest100 E Oct. 8, 2018, 6:13 a.m. OK MS C++ TESTS 27 109 19660800 2400
45381149 vjudge1 E Nov. 6, 2018, 2:52 p.m. OK MS C++ TESTS 27 124 29696000 2400
44022141 vjudge2 E Oct. 9, 2018, 5:15 a.m. OK MS C++ TESTS 27 124 41676800 2400
57823760 vjudge1 E July 27, 2019, 1:39 a.m. OK MS C++ TESTS 27 186 125440000 2400
48036349 Dmitriy.Belichenko E Jan. 6, 2019, 3:47 p.m. OK PyPy 3 TESTS 27 280 15155200 2400
43921929 federicoemartinez E Oct. 7, 2018, 1:03 a.m. OK Python 2 TESTS 27 826 24883200 2400
43921886 federicoemartinez E Oct. 7, 2018, 12:59 a.m. OK Python 2 TESTS 27 842 24883200 2400
44943893 DhurBaal E Oct. 27, 2018, 9:08 a.m. OK Python 3 TESTS 27 717 106803200 2400
43856143 ikatakos E Oct. 5, 2018, 4:09 p.m. OK Python 3 TESTS 27 1044 106803200 2400
44952494 DhurBaal E Oct. 27, 2018, 12:46 p.m. OK Python 3 TESTS 27 1341 111001600 2400
44944187 DhurBaal E Oct. 27, 2018, 9:18 a.m. OK Python 3 TESTS 27 1387 111104000 2400
43942001 DragoonKiller E Oct. 7, 2018, 11:53 a.m. OK Rust TESTS 27 78 45670400 2400
43941549 DragoonKiller E Oct. 7, 2018, 11:41 a.m. OK Rust TESTS 27 78 99020800 2400

remove filters

Back to search problems