Codeforces Round 935 (Div. 3)

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
1945 Codeforces Round 935 (Div. 3) FINISHED False 8100 26344463 March 19, 2024, 8:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 767 ) G Cook and Porridge PROGRAMMING binary search constructive algorithms data structures implementation

B"Finally, lunchtime! n schoolchildren have lined up in a long queue at the cook's tent for porridge. The cook will be serving porridge for D minutes. The schoolchild standing in the i -th position in the queue has a priority of k_i and eats one portion of porridge in s_i minutes. At the beginning of each minute of the break, the cook serves the first schoolchild in the queue one portion of porridge, after which the schoolchild goes to eat their portion. If the i -th schoolchild is served a portion at the beginning of the x -th minute, then they will return to the queue at the end of the (x + s_i) -th minute. When the i -th schoolchild returns to the queue, the schoolchildren at the end of the queue whose priority is strictly lower than that of the i -th schoolchild must let them pass. Thus, they will stand in the queue behind the last schoolchild whose priority is not lower than their own. That is, behind the last schoolchild j with k_j ge k_i . If there is no such schoolchild in the queue, the i -th schoolchild will stand at the front of the queue. If several schoolchildren return at the same time, they will return to the queue in ascending order of their s_i . For example, if n = 3 , D = 3 , k = [2, 3, 2] , and s = [2, 1, 3] , the serving will occur as follows: Determine the minimum number of minutes after the start of the break that each schoolchild will receive porridge at least once, or report that this will not happen within D minutes. Each test consists of several test cases. The first line contains a single integer t ( 1 <= t <= 1000 ) -- the number of test cases. This is followed by a description of the test cases. The first line of each test case contains two integers n and D ( 1 <= n <= 2 cdot 10^5 , 1 <= D <= 3 cdot 10^5 ) -- the number of schoolchildren in the queue and the break time, respectively. The"...

Tutorials

127377

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
252385263 Sgdd G March 20, 2024, 3:06 a.m. OK C++14 (GCC 6-32) TESTS 42 124 23449600
252311175 inoader G March 19, 2024, 2:23 p.m. OK C++14 (GCC 6-32) TESTS 40 217 23040000
252382838 JJcjn G March 20, 2024, 2:26 a.m. OK C++17 (GCC 7-32) TESTS 40 109 27340800
252377526 fangz G March 20, 2024, 12:46 a.m. OK C++17 (GCC 7-32) TESTS 40 124 8704000
252379093 fangz G March 20, 2024, 1:17 a.m. OK C++17 (GCC 7-32) TESTS 40 139 9932800
252388213 hvyotivy G March 20, 2024, 3:53 a.m. OK C++17 (GCC 7-32) TESTS 43 140 9011200
252392497 MagicalGirl G March 20, 2024, 4:56 a.m. OK C++17 (GCC 7-32) TESTS 46 140 14233600
252385240 LEGENDRAB G March 20, 2024, 3:06 a.m. OK C++17 (GCC 7-32) TESTS 42 140 25497600
252308111 GusFring G March 19, 2024, 2:05 p.m. OK C++17 (GCC 7-32) TESTS 40 155 7987200
252381649 ustcyyw G March 20, 2024, 2:05 a.m. OK C++17 (GCC 7-32) TESTS 40 156 10137600
252312145 ustcyyw G March 19, 2024, 2:28 p.m. OK C++17 (GCC 7-32) TESTS 40 156 10137600
252324366 fentanyl G March 19, 2024, 3:38 p.m. OK C++17 (GCC 7-32) TESTS 40 156 12390400
252332194 Travelerrrr G March 19, 2024, 4:25 p.m. OK C++20 (GCC 13-64) TESTS 40 109 26931200
252323483 StarSilk G March 19, 2024, 3:34 p.m. OK C++20 (GCC 13-64) TESTS 40 171 27033600
252332831 22H51A6762-Manikanta G March 19, 2024, 4:29 p.m. OK C++20 (GCC 13-64) TESTS 40 249 128819200
252340898 dreamoon_love_AA G March 19, 2024, 5:25 p.m. OK C++20 (GCC 13-64) TESTS 40 436 40550400
252319536 Hemanidhi_18 G March 19, 2024, 3:11 p.m. OK Java 21 TESTS 40 498 11264000
252319132 mapleKing G March 19, 2024, 3:09 p.m. OK Java 21 TESTS 40 545 11980800
252316899 profchi G March 19, 2024, 2:56 p.m. OK Java 21 TESTS 40 857 62361600
252365784 dzhi G March 19, 2024, 9:16 p.m. OK Java 21 TESTS 40 967 71987200
252365519 dzhi G March 19, 2024, 9:13 p.m. OK Java 21 TESTS 40 982 71577600
252336325 OLOGY G March 19, 2024, 4:53 p.m. OK PyPy 2 TESTS 40 810 96972800
252335821 OLOGY G March 19, 2024, 4:49 p.m. OK PyPy 2 TESTS 40 826 96563200
252337219 OLOGY G March 19, 2024, 4:59 p.m. OK PyPy 2 TESTS 40 826 96768000
252322204 mikeac G March 19, 2024, 3:27 p.m. OK PyPy 3-64 TESTS 40 1387 57139200
252316984 robostac G March 19, 2024, 2:56 p.m. OK Rust 2021 TESTS 40 155 53862400

remove filters

Back to search problems