Codeforces Round 426 (Div. 1)

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
833 Codeforces Round 426 (Div. 1) FINISHED False 7200 274980323 July 30, 2017, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 275 ) E Caramel Clouds PROGRAMMING data structures dp sortings 3100

It is well-known that the best decoration for a flower bed in Sweetland are vanilla muffins. Seedlings of this plant need sun to grow up. Slastyona has m seedlings, and the j -th seedling needs at least k j minutes of sunlight to grow up. Most of the time it's sunny in Sweetland, but sometimes some caramel clouds come, the i -th of which will appear at time moment (minute) l i and disappear at time moment r i . Of course, the clouds make shadows, and the seedlings can't grow when there is at least one cloud veiling the sun. Slastyona wants to grow up her muffins as fast as possible. She has exactly C candies, which is the main currency in Sweetland. One can dispel any cloud by paying c i candies. However, in order to comply with Sweetland's Department of Meteorology regulations, one can't dispel more than two clouds . Slastyona hasn't decided yet which of the m seedlings will be planted at the princess' garden, so she needs your help. For each seedling determine the earliest moment it can grow up if Slastyona won't break the law and won't spend more candies than she has. Note that each of the seedlings is considered independently. The seedlings start to grow at time moment 0 . The first line contains two integers n and C (0 ≤ n ≤ 3·10 5 , 0 ≤ C ≤ 10 9 ) – the number of caramel clouds and the number of candies Slastyona has. The next n lines contain three integers each: l i , r i , c i (0 ≤ l i < r i ≤ 10 9 , 0 ≤ c i ≤ 10 9 ) , describing one caramel cloud. The next line contains single integer m ( 1 ≤ m ≤ 3·10 5 ) – the number of seedlings. Each of the seedlings is described with one integer k j (1 ≤ k j ≤ 10 9 ) – the required number of sunny minutes. For each seedling print one integer – the minimum minute Slastyona can grow it up. Consider the first example. For each k it is optimal to dispel clouds 1 and 3 . Then the remaining cloud will give shadow on time segment 1..6 . So, intervals 0..1 and [6.. inf ) are sunny. In the second example for k = 1

Tutorials

Codeforces Round #426 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
40980401 ReaLNero1 E July 30, 2018, 5:31 p.m. OK GNU C++ TESTS 109 405 67379200 3100
29937706 laofudasuan E Aug. 31, 2017, 8:16 a.m. OK GNU C++ TESTS 109 436 67379200 3100
37051498 zjo_2001 E April 7, 2018, 1:25 p.m. OK GNU C++ TESTS 109 592 60108800 3100
39122307 vjudge5 E June 10, 2018, 1:30 p.m. OK GNU C++ TESTS 109 779 74649600 3100
39121910 vjudge1 E June 10, 2018, 1:19 p.m. OK GNU C++ TESTS 109 1091 77004800 3100
38821610 Worldwide_D E June 1, 2018, 7:55 a.m. OK GNU C++ TESTS 109 1434 80588800 3100
57873882 lopare E July 28, 2019, 3:55 a.m. OK GNU C++11 TESTS 109 467 36147200 3100
51410732 yltx E March 17, 2019, 11:57 a.m. OK GNU C++11 TESTS 109 483 36147200 3100
47845433 vjudge5 E Jan. 2, 2019, 2:23 p.m. OK GNU C++11 TESTS 109 498 94720000 3100
47800898 vjudge3 E Dec. 31, 2018, 10:39 p.m. OK GNU C++11 TESTS 109 498 94720000 3100
57769440 py_ultron E July 25, 2019, 11:11 p.m. OK GNU C++11 TESTS 109 499 36147200 3100
47800867 vjudge4 E Dec. 31, 2018, 10:38 p.m. OK GNU C++11 TESTS 109 499 94720000 3100
42966411 zhouyuyang E Sept. 17, 2018, 1:24 a.m. OK GNU C++11 TESTS 109 514 65024000 3100
62050305 vjudge3 E Oct. 7, 2019, 9:14 a.m. OK GNU C++11 TESTS 109 530 94720000 3100
39291513 goldgenius E June 16, 2018, 4 p.m. OK GNU C++11 TESTS 109 545 94720000 3100
56412488 _twilight E July 2, 2019, 1:37 a.m. OK GNU C++11 TESTS 109 576 39116800 3100
59572718 Scut82 E Aug. 27, 2019, 1:08 p.m. OK GNU C++14 TESTS 109 670 65740800 3100
29024167 dreamoon_love_AA E July 30, 2017, 6:37 p.m. OK GNU C++14 TESTS 109 670 92467200 3100
59571699 Scut82 E Aug. 27, 2019, 12:48 p.m. OK GNU C++14 TESTS 109 702 103424000 3100
29427985 Reyna E Aug. 13, 2017, 8:15 a.m. OK GNU C++14 TESTS 109 779 44236800 3100
50920673 zsyzsy E March 7, 2019, 9:02 a.m. OK GNU C++14 TESTS 109 904 36249600 3100
29341665 help_helpthrowaway E Aug. 11, 2017, 2:52 a.m. OK GNU C++14 TESTS 109 935 86937600 3100
29341017 helpthrowaway E Aug. 11, 2017, 1:52 a.m. OK GNU C++14 TESTS 109 935 86937600 3100
51782990 hychyc E March 24, 2019, 9:19 a.m. OK GNU C++14 TESTS 109 967 41062400 3100
29108173 Vercingetorix E Aug. 1, 2017, 5:42 p.m. OK GNU C++14 TESTS 109 967 72089600 3100
29252181 JoeyWheeler E Aug. 7, 2017, 3:24 a.m. OK GNU C++14 TESTS 109 967 86937600 3100
55614329 Shayan.P E June 16, 2019, 7:57 a.m. OK GNU C++17 TESTS 109 482 21299200 3100
57168026 Benq E July 17, 2019, 1:06 a.m. OK GNU C++17 TESTS 109 623 30822400 3100
61824065 vjudge5 E Oct. 4, 2019, 3:48 a.m. OK GNU C++17 TESTS 109 670 41062400 3100
46840882 ShichengXiao E Dec. 10, 2018, 7:29 a.m. OK GNU C++17 TESTS 109 904 42291200 3100
42194252 tkj E Aug. 28, 2018, 5:27 a.m. OK GNU C++17 TESTS 109 1107 64000000 3100
42879084 Als123 E Sept. 15, 2018, 5:04 a.m. OK GNU C++17 TESTS 109 1279 53145600 3100
55554180 Shayan.P E June 14, 2019, 8:59 a.m. OK GNU C++17 TESTS 109 2870 24985600 3100

remove filters

Back to search problems