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 |
---|---|---|---|---|---|---|
1942 | CodeTON Round 8 (Div. 1 + Div. 2, Rated, Prizes!) | FINISHED | False | 10800 | 25370663 | March 30, 2024, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 111 ) | H | Farmer John's Favorite Intern | PROGRAMMING | data structures dp flows trees |
B"Ruby just won an internship position at Farmer John's farm by winning a coding competition! As the newly recruited intern, Ruby is tasked with maintaining Farmer John's peach tree, a tree consisting of n nodes rooted at node 1 . Each node initially contains a_i = 0 peaches, and there are two types of events that can happen: Ruby is also given an array b of length n . The peach tree is deemed healthy if a_i ge b_i for every node i . Ruby is asked to perform q operations of two types: For every prefix of operations, Ruby asks you to find if she can perform these operations in some order such that the resulting peach tree (at the end of these operations) is healthy. Note that Ruby can't perform a harvest event that makes any a_i negative. Every prefix is independent, meaning that for a given operation, Ruby may choose different nodes to perform events on for every prefix that contains that operation. The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. The first line of each test case contains two integers n and q ( 1 <= n, q <= 2 cdot 10^5 ) -- the size of the tree and the number of operations. The second line contains n - 1 integers p_2, p_3, ldots, p_n ( 1 <= p_i < i ) -- the parent of each node. The third line contains n integers b_1, b_2, ldots, b_n ( 0 <= b_i <= 10^6 ) -- the minimum number of peaches each node needs for the peach tree to be considered healthy. The next q lines describe the operations Ruby will perform. Each line contains three integers t , x , and v ( 1 <= t <= 2 , 1 <= x <= n , 1 <= v <= 10^6 ). If t = 1 , this denotes that Ruby must perform v growth events on node x . If t = 2 , this denotes that Ruby must perform v harvest events on node x . It is guaranteed that the sum of n does not"... |
CodeTON Round 8 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
254213388 | Amr_Khaled556 | H | March 30, 2024, 8:04 p.m. | OK | C++14 (GCC 6-32) | TESTS | 71 | 2979 | 415641600 | ||
254247530 | cmath11 | H | March 31, 2024, 5:30 a.m. | OK | C++17 (GCC 7-32) | TESTS | 71 | 1840 | 67174400 | ||
254204614 | hackstar | H | March 30, 2024, 6:40 p.m. | OK | C++17 (GCC 7-32) | TESTS | 71 | 2105 | 72499200 | ||
254211990 | Sparkle_Twilight | H | March 30, 2024, 7:49 p.m. | OK | C++17 (GCC 7-32) | TESTS | 71 | 3010 | 75673600 | ||
254210643 | aalsi_coder | H | March 30, 2024, 7:35 p.m. | OK | C++17 (GCC 7-32) | TESTS | 71 | 3010 | 75673600 | ||
254205027 | Souparnoo | H | March 30, 2024, 6:43 p.m. | OK | C++17 (GCC 7-32) | TESTS | 71 | 3104 | 396492800 | ||
254198277 | orzdevinwang | H | March 30, 2024, 5:34 p.m. | OK | C++17 (GCC 7-32) | TESTS | 71 | 3182 | 396492800 | ||
254188108 | Radewoosh | H | March 30, 2024, 5:03 p.m. | OK | C++17 (GCC 7-32) | TESTS | 71 | 4243 | 127385600 | ||
254190002 | cnnfls_csy | H | March 30, 2024, 5:09 p.m. | OK | C++20 (GCC 13-64) | TESTS | 71 | 560 | 273305600 | ||
254204728 | rainboy | H | March 30, 2024, 6:41 p.m. | OK | C++20 (GCC 13-64) | TESTS | 71 | 1060 | 80998400 | ||
254201777 | hos.lyric | H | March 30, 2024, 6:23 p.m. | OK | C++20 (GCC 13-64) | TESTS | 71 | 1123 | 175513600 | ||
254202464 | jiangly | H | March 30, 2024, 6:26 p.m. | OK | C++20 (GCC 13-64) | TESTS | 71 | 1216 | 77926400 | ||
254203368 | Benq | H | March 30, 2024, 6:32 p.m. | OK | C++20 (GCC 13-64) | TESTS | 71 | 1279 | 78643200 | ||
254223342 | Ormlis | H | March 30, 2024, 10:19 p.m. | OK | C++20 (GCC 13-64) | TESTS | 71 | 1513 | 89804800 | ||
254223417 | Ormlis | H | March 30, 2024, 10:20 p.m. | OK | C++20 (GCC 13-64) | TESTS | 71 | 1528 | 89804800 | ||
254201851 | ecnerwala | H | March 30, 2024, 6:23 p.m. | OK | C++20 (GCC 13-64) | TESTS | 71 | 4273 | 238899200 | ||
254202204 | rainboy | H | March 30, 2024, 6:25 p.m. | OK | GNU C11 | TESTS | 71 | 2417 | 67276800 |
Back to search problems