Codeforces Round 530 (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
1099 Codeforces Round 530 (Div. 2) FINISHED False 9000 190473863 Jan. 5, 2019, 4:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 967 ) F Cookies PROGRAMMING binary search data structures dfs and similar dp games trees 2300

B"Mitya and Vasya are playing an interesting game. They have a rooted tree with n vertices, and the vertices are indexed from 1 to n . The root has index 1 . Every other vertex i ge 2 has its parent p_i , and vertex i is called a child of vertex p_i . There are some cookies in every vertex of the tree: there are x_i cookies in vertex i . It takes exactly t_i time for Mitya to eat one cookie in vertex i . There is also a chip, which is initially located in the root of the tree, and it takes l_i time to move the chip along the edge connecting vertex i with its parent. Mitya and Vasya take turns playing, Mitya goes first. Mitya can stop the game at any his turn. Once he stops the game, he moves the chip up to the root, eating some cookies along his way. Mitya can decide how many cookies he would like to eat in every vertex on his way. The total time spent on descend, ascend and eating cookies should not exceed T . Please note that in the end of the game the chip is always located in the root of the tree: Mitya can not leave the chip in any other vertex, even if he has already eaten enough cookies -- he must move the chip back to the root (and every move from vertex v to its parent takes l_v time). Find out what is the maximum number of cookies Mitya can eat, regardless of Vasya's actions. The first line contains two integers n and T -- the number of vertices in the tree and the time he has to accomplish his task ( 2 <= n <= 10^5 ; 1 <= T <= 10^{18} ). The second line contains n integers x_1 , x_2 , ..., x_n -- number of cookies located in the corresponding vertex ( 1 <= x_i <= 10^6 ). The third line contains n integers t_1 , t_2 , ..., t_n -- how much time it takes Mitya to eat one cookie in vertex i ( 1 <= t_i <= 10^6 ). Each of the following n - 1 lines describe the tree. For"...

Tutorials

E

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
48302366 rainboy F Jan. 12, 2019, 5:39 p.m. OK GNU C11 TESTS 89 171 20172800 2300
63357060 luogu_bot2 F Oct. 25, 2019, 3:20 a.m. OK GNU C++11 TESTS 89 93 24985600 2300
52338690 p_b_p_b F April 5, 2019, 9:22 a.m. OK GNU C++11 TESTS 89 93 91443200 2300
48462644 wang9897 F Jan. 16, 2019, 3:30 p.m. OK GNU C++11 TESTS 89 93 178688000 2300
64191716 Rikuki F Nov. 4, 2019, 8:01 a.m. OK GNU C++11 TESTS 89 108 35840000 2300
52338604 luogu_bot4 F April 5, 2019, 9:20 a.m. OK GNU C++11 TESTS 89 108 91443200 2300
49675403 Sherek F Feb. 9, 2019, 7:24 p.m. OK GNU C++11 TESTS 89 124 21196800 2300
48094090 PauloMiranda98 F Jan. 8, 2019, 3:37 p.m. OK GNU C++11 TESTS 89 124 27648000 2300
48096179 PauloMiranda98 F Jan. 8, 2019, 4:59 p.m. OK GNU C++11 TESTS 89 124 27648000 2300
58076077 Frame233 F July 31, 2019, 12:25 p.m. OK GNU C++11 TESTS 89 124 31641600 2300
58076252 Frame233 F July 31, 2019, 12:29 p.m. OK GNU C++11 TESTS 89 124 31641600 2300
48711380 tokitsukaze F Jan. 22, 2019, 8:43 a.m. OK GNU C++14 TESTS 89 139 62771200 2300
61853522 malyna F Oct. 4, 2019, 1:25 p.m. OK GNU C++14 TESTS 89 155 16179200 2300
51295646 schtomi97 F March 14, 2019, 12:21 p.m. OK GNU C++14 TESTS 89 155 29388800 2300
48014460 n_dao107 F Jan. 5, 2019, 9:17 p.m. OK GNU C++14 TESTS 89 155 55500800 2300
48028319 aajisaka F Jan. 6, 2019, 10:38 a.m. OK GNU C++14 TESTS 89 156 27136000 2300
48701882 2018329621170 F Jan. 22, 2019, 3:16 a.m. OK GNU C++14 TESTS 89 156 280576000 2300
48487418 Jian_Ron F Jan. 17, 2019, 9:02 a.m. OK GNU C++14 TESTS 89 171 16076800 2300
55563831 I_love_Kuroni F June 14, 2019, 2:12 p.m. OK GNU C++14 TESTS 89 171 20275200 2300
50878328 alechuang98 F March 6, 2019, 7:45 a.m. OK GNU C++14 TESTS 89 171 22323200 2300
48282632 imathi F Jan. 12, 2019, 8:43 a.m. OK GNU C++14 TESTS 89 171 30208000 2300
55123471 Felerius F June 5, 2019, 11:47 a.m. OK GNU C++17 TESTS 89 124 14643200 2300
48038494 forget F Jan. 6, 2019, 5:21 p.m. OK GNU C++17 TESTS 89 124 32870400 2300
48654320 ReaLNero1 F Jan. 21, 2019, 1:28 a.m. OK GNU C++17 TESTS 89 124 32870400 2300
48390529 SBOne F Jan. 14, 2019, 3:06 p.m. OK GNU C++17 TESTS 89 139 15667200 2300
48033699 Egor.Lifar F Jan. 6, 2019, 2:05 p.m. OK GNU C++17 TESTS 89 140 15462400 2300
48663428 tataky F Jan. 21, 2019, 7 a.m. OK GNU C++17 TESTS 89 140 21299200 2300
48036251 Kuroni F Jan. 6, 2019, 3:43 p.m. OK GNU C++17 TESTS 89 155 16793600 2300
48015136 markotee F Jan. 5, 2019, 9:53 p.m. OK GNU C++17 TESTS 89 155 18022400 2300
48663911 tataky F Jan. 21, 2019, 7:13 a.m. OK GNU C++17 TESTS 89 155 20992000 2300
49875107 Zyrax F Feb. 13, 2019, 3:30 p.m. OK GNU C++17 TESTS 89 155 31744000 2300
48206980 2008061626 F Jan. 11, 2019, 9:31 a.m. OK Go TESTS 89 405 112435200 2300
48207193 2008061626 F Jan. 11, 2019, 9:37 a.m. OK Go TESTS 89 421 112332800 2300
51443907 icpc_loser F March 18, 2019, 11:35 a.m. OK Java 8 TESTS 89 233 55808000 2300
48181054 aman28rwt F Jan. 10, 2019, 12:31 p.m. OK Java 8 TESTS 89 280 46796800 2300
48180762 aman28rwt F Jan. 10, 2019, 12:22 p.m. OK Java 8 TESTS 89 280 46796800 2300
49221371 tsumit023 F Jan. 30, 2019, 7:21 p.m. OK Java 8 TESTS 89 280 52531200 2300
48013752 StayAwayFromBitches F Jan. 5, 2019, 8:50 p.m. OK Java 8 TESTS 89 280 53964800 2300
48034279 StayAwayFromBitches F Jan. 6, 2019, 2:26 p.m. OK Java 8 TESTS 89 280 54067200 2300
48203804 xodiac F Jan. 11, 2019, 7:26 a.m. OK Java 8 TESTS 89 311 70758400 2300
48095693 SpargelTarzan F Jan. 8, 2019, 4:41 p.m. OK Java 8 TESTS 89 343 53862400 2300
48541526 Deimos F Jan. 18, 2019, 4:59 p.m. OK Java 8 TESTS 89 358 104345600 2300
48083756 Kharouba F Jan. 8, 2019, 9:46 a.m. OK Java 8 TESTS 89 373 45056000 2300
48078409 DavitMarg F Jan. 8, 2019, 5:58 a.m. OK MS C++ TESTS 89 436 76595200 2300

remove filters

Back to search problems