Codeforces Round 756 (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
1611 Codeforces Round 756 (Div. 3) FINISHED False 8100 99329063 Nov. 25, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 6644 ) F ATM and Students PROGRAMMING binary search data structures two pointers 1700

B'Polycarp started working at a bank. He was assigned to monitor the ATM. The ATM initially contains s rubles. A queue of n students lined up to him. Each student wants to either withdraw a certain amount of money or deposit it into an account. If a_i is positive, then the student credits that amount of money via ATM. Otherwise, the student withdraws |a_i| rubles. In the beginning, the ATM is turned off and an arbitrary number of students are not served. At some point, Polycarp turns on the ATM, which has an initial amount of s rubles. Then, the remaining students start queueing at the ATM. If at some point in time there is less money in the ATM than the student wants to withdraw, then the student is not served and Polycarp turns off the ATM and does not turn it on anymore. More formally, the students that are served are forming a contiguous subsequence. Polycarp wants the ATM to serve the maximum number of students. Help him in this matter. Print the numbers of the first and last student, or determine that he will not be able to serve anyone. In other words, find such a longest continuous segment of students that, starting with the sum of s at the ATM, all these students will be served. ATM serves students consistently (i.e. one after another in the order of the queue). The first line of the input contains one integer t ( 1 <= t <= 10^4 ) -- the number of test cases. Each test case consists of two lines. The first one contains integers n and s ( 1 <= n <= 2 cdot10^5 ; 0 <= s <= 10^9 ) -- the length of the a array and the initial amount of rubles in the ATM. The second contains n integers a_1, a_2, ... , a_n ( -10^9 <= a_i <= 10^9 ) -- elements of the a array. Note that a_i can be zero. It is guaranteed that the sum of the values n over all test cases does not exceed 2 cdot10^5 . Print t lines, each line must contain the answer to'...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
136937187 cxqtd F Nov. 25, 2021, 6:16 p.m. OK GNU C11 TESTS 31 93 3174400 1700
137079993 XyzL F Nov. 27, 2021, 2:42 a.m. OK GNU C++14 TESTS 31 31 10035200 1700
136979986 XyzL F Nov. 26, 2021, 9:02 a.m. OK GNU C++14 TESTS 31 31 10035200 1700
136961006 lqhsmash F Nov. 26, 2021, 4:41 a.m. OK GNU C++14 TESTS 31 62 819200 1700
136958880 waiiting F Nov. 26, 2021, 3:55 a.m. OK GNU C++14 TESTS 31 62 819200 1700
136984511 zweix F Nov. 26, 2021, 10:03 a.m. OK GNU C++14 TESTS 31 62 819200 1700
136983160 ezlmr F Nov. 26, 2021, 9:43 a.m. OK GNU C++14 TESTS 31 62 819200 1700
137059221 mominur F Nov. 26, 2021, 5:13 p.m. OK GNU C++14 TESTS 31 62 1024000 1700
137027474 1884613kjh F Nov. 26, 2021, 12:43 p.m. OK GNU C++14 TESTS 31 62 1638400 1700
136978014 adarsh_sinhg F Nov. 26, 2021, 8:38 a.m. OK GNU C++14 TESTS 31 62 1638400 1700
136986179 akshatb622 F Nov. 26, 2021, 10:26 a.m. OK GNU C++14 TESTS 31 62 1638400 1700
136945815 Khedr_ F Nov. 25, 2021, 8:50 p.m. OK GNU C++17 TESTS 31 62 819200 1700
136942553 Farrius F Nov. 25, 2021, 7:40 p.m. OK GNU C++17 TESTS 31 62 819200 1700
137058268 JILIN. F Nov. 26, 2021, 5 p.m. OK GNU C++17 TESTS 31 62 819200 1700
136988752 demss101 F Nov. 26, 2021, 11:01 a.m. OK GNU C++17 TESTS 31 62 819200 1700
136957178 PaceMak1r F Nov. 26, 2021, 3:19 a.m. OK GNU C++17 TESTS 31 62 819200 1700
136954401 kxsk F Nov. 26, 2021, 2:14 a.m. OK GNU C++17 TESTS 31 62 819200 1700
136953424 xiaoyuefan F Nov. 26, 2021, 1:46 a.m. OK GNU C++17 TESTS 31 62 819200 1700
136951237 ccsu_Y_Y F Nov. 26, 2021, 12:30 a.m. OK GNU C++17 TESTS 31 62 819200 1700
136948692 hsnavarro F Nov. 25, 2021, 10:24 p.m. OK GNU C++17 TESTS 31 62 819200 1700
136944547 rspr F Nov. 25, 2021, 8:21 p.m. OK GNU C++17 TESTS 31 62 819200 1700
136977754 incogn1to F Nov. 26, 2021, 8:35 a.m. OK GNU C++17 (64) TESTS 31 46 819200 1700
136955378 Neal_lee F Nov. 26, 2021, 2:38 a.m. OK GNU C++17 (64) TESTS 31 46 819200 1700
136952620 forceac F Nov. 26, 2021, 1:20 a.m. OK GNU C++17 (64) TESTS 31 46 819200 1700
136952571 zwu2020030959 F Nov. 26, 2021, 1:19 a.m. OK GNU C++17 (64) TESTS 31 46 819200 1700
136941579 hara_1999 F Nov. 25, 2021, 7:23 p.m. OK GNU C++17 (64) TESTS 31 46 819200 1700
136982852 AkaMG F Nov. 26, 2021, 9:39 a.m. OK GNU C++17 (64) TESTS 31 46 1638400 1700
136978031 SouIman F Nov. 26, 2021, 8:38 a.m. OK GNU C++17 (64) TESTS 31 46 1638400 1700
137046353 Divya2018 F Nov. 26, 2021, 2:31 p.m. OK GNU C++17 (64) TESTS 31 46 1638400 1700
137021152 GreenTourist F Nov. 26, 2021, 12:23 p.m. OK GNU C++17 (64) TESTS 31 46 1638400 1700
136985738 aagamjain04 F Nov. 26, 2021, 10:20 a.m. OK GNU C++17 (64) TESTS 31 46 1638400 1700
136970807 I_francis F Nov. 26, 2021, 7:06 a.m. OK GNU C++20 (64) TESTS 31 46 819200 1700
136949092 axe98 F Nov. 25, 2021, 10:42 p.m. OK GNU C++20 (64) TESTS 31 46 819200 1700
137053112 zxzxzxd F Nov. 26, 2021, 3:49 p.m. OK GNU C++20 (64) TESTS 31 46 819200 1700
136976045 sakurahashu F Nov. 26, 2021, 8:16 a.m. OK GNU C++20 (64) TESTS 31 46 819200 1700
136967372 Aknksha F Nov. 26, 2021, 6:23 a.m. OK GNU C++20 (64) TESTS 31 46 819200 1700
137073506 vefg F Nov. 26, 2021, 10:17 p.m. OK GNU C++20 (64) TESTS 31 46 1638400 1700
137050162 proofer F Nov. 26, 2021, 3:11 p.m. OK GNU C++20 (64) TESTS 31 46 1638400 1700
137087650 mekch F Nov. 27, 2021, 5:09 a.m. OK GNU C++20 (64) TESTS 31 46 1638400 1700
137081270 aquamoon_zjx F Nov. 27, 2021, 3:11 a.m. OK GNU C++20 (64) TESTS 31 46 1638400 1700
137054309 ahmet23 F Nov. 26, 2021, 4:05 p.m. OK GNU C++20 (64) TESTS 31 46 1638400 1700
136950043 supermatthew F Nov. 25, 2021, 11:30 p.m. OK Java 11 TESTS 31 233 3993600 1700
137089718 solo07 F Nov. 27, 2021, 5:35 a.m. OK Java 11 TESTS 31 234 0 1700
136950037 supermatthew F Nov. 25, 2021, 11:30 p.m. OK Java 11 TESTS 31 249 3993600 1700
136985406 BiggEr. F Nov. 26, 2021, 10:15 a.m. OK Java 11 TESTS 31 249 4198400 1700
136937284 dkkv0000 F Nov. 25, 2021, 6:18 p.m. OK Java 11 TESTS 31 264 0 1700
137046525 MrOtter F Nov. 26, 2021, 2:33 p.m. OK Java 11 TESTS 31 264 3174400 1700
136964390 Avatar F Nov. 26, 2021, 5:40 a.m. OK Java 11 TESTS 31 280 4096000 1700
136961629 coderx_100 F Nov. 26, 2021, 4:52 a.m. OK Java 11 TESTS 31 280 4096000 1700
136939151 ssk4988 F Nov. 25, 2021, 6:44 p.m. OK Java 11 TESTS 31 280 4096000 1700
137077491 viplavkadam F Nov. 27, 2021, 1:33 a.m. OK Java 11 TESTS 31 452 0 1700
136937514 nitinrishab2000 F Nov. 25, 2021, 6:21 p.m. OK Java 8 TESTS 31 156 11366400 1700
137037326 vaibhav_1710 F Nov. 26, 2021, 1:12 p.m. OK Java 8 TESTS 31 156 11366400 1700
136941671 NerfThis F Nov. 25, 2021, 7:24 p.m. OK Java 8 TESTS 31 186 11161600 1700
136938654 brikri F Nov. 25, 2021, 6:37 p.m. OK Java 8 TESTS 31 186 11264000 1700
136935378 aditya_daredevil F Nov. 25, 2021, 5:53 p.m. OK Java 8 TESTS 31 187 11468800 1700
136971180 ytu_czl F Nov. 26, 2021, 7:11 a.m. OK Java 8 TESTS 31 405 0 1700
137078634 GoldenShadow F Nov. 27, 2021, 2:08 a.m. OK Java 8 TESTS 31 436 11878400 1700
136968855 BruteForcee F Nov. 26, 2021, 6:42 a.m. OK Kotlin 1.5 TESTS 31 249 3174400 1700
137058924 louyujie F Nov. 26, 2021, 5:09 p.m. OK MS C++ 2017 TESTS 31 202 819200 1700
136952289 mban259 F Nov. 26, 2021, 1:10 a.m. OK .NET Core C# TESTS 31 140 27238400 1700
137057333 NorbertG F Nov. 26, 2021, 4:46 p.m. OK .NET Core C# TESTS 31 1684 63488000 1700
137057420 NorbertG F Nov. 26, 2021, 4:48 p.m. OK .NET Core C# TESTS 31 1684 63488000 1700
136949570 TribalGolem F Nov. 25, 2021, 11:03 p.m. OK PyPy 2 TESTS 31 483 25395200 1700
136956025 hxu10 F Nov. 26, 2021, 2:53 a.m. OK PyPy 3 TESTS 31 202 26112000 1700
136954715 easedeath F Nov. 26, 2021, 2:22 a.m. OK PyPy 3 TESTS 31 202 85913600 1700
136942818 sushmanth.dampur8780 F Nov. 25, 2021, 7:45 p.m. OK PyPy 3 TESTS 31 280 18432000 1700
136973457 whatshisbucket F Nov. 26, 2021, 7:40 a.m. OK PyPy 3 TESTS 31 280 18636800 1700
136974105 whatshisbucket F Nov. 26, 2021, 7:49 a.m. OK PyPy 3 TESTS 31 327 19148800 1700
136974654 whatshisbucket F Nov. 26, 2021, 7:58 a.m. OK PyPy 3 TESTS 31 358 19148800 1700
136974478 whatshisbucket F Nov. 26, 2021, 7:55 a.m. OK PyPy 3 TESTS 31 358 19148800 1700
136974426 whatshisbucket F Nov. 26, 2021, 7:54 a.m. OK PyPy 3 TESTS 31 358 19148800 1700
137024635 Gomm F Nov. 26, 2021, 12:34 p.m. OK PyPy 3 TESTS 31 373 19046400 1700
136958031 wwwwzhh F Nov. 26, 2021, 3:37 a.m. OK PyPy 3 TESTS 31 373 21811200 1700
136942138 rivnam F Nov. 25, 2021, 7:32 p.m. OK PyPy 3-64 TESTS 31 140 30924800 1700
136981340 gourav2001k F Nov. 26, 2021, 9:19 a.m. OK PyPy 3-64 TESTS 31 155 31334400 1700
136954291 Nemisis2.O F Nov. 26, 2021, 2:12 a.m. OK PyPy 3-64 TESTS 31 156 30924800 1700
136977403 guineapig F Nov. 26, 2021, 8:31 a.m. OK PyPy 3-64 TESTS 31 264 31539200 1700
137055493 RANK1ZEN F Nov. 26, 2021, 4:20 p.m. OK PyPy 3-64 TESTS 31 280 32870400 1700
136995057 MIRE F Nov. 26, 2021, 11:22 a.m. OK PyPy 3-64 TESTS 31 327 30208000 1700
137030769 Gomm F Nov. 26, 2021, 12:53 p.m. OK PyPy 3-64 TESTS 31 343 29900800 1700
137005208 nicku123 F Nov. 26, 2021, 11:40 a.m. OK PyPy 3-64 TESTS 31 1262 135475200 1700
136975146 laplce F Nov. 26, 2021, 8:04 a.m. OK PyPy 3-64 TESTS 31 1341 43929600 1700
136937807 OLOGY F Nov. 25, 2021, 6:25 p.m. OK Python 2 TESTS 31 202 13312000 1700
136983938 hsh8086 F Nov. 26, 2021, 9:55 a.m. OK Python 3 TESTS 31 233 19046400 1700
137067008 hk1 F Nov. 26, 2021, 7:19 p.m. OK Python 3 TESTS 31 280 17203200 1700
136940438 at_x F Nov. 25, 2021, 7:04 p.m. OK Python 3 TESTS 31 280 17612800 1700
136965212 Bambam_Shivam F Nov. 26, 2021, 5:53 a.m. OK Python 3 TESTS 31 280 18124800 1700
136975644 whatshisbucket F Nov. 26, 2021, 8:11 a.m. OK Python 3 TESTS 31 358 17203200 1700
137025072 Gomm F Nov. 26, 2021, 12:36 p.m. OK Python 3 TESTS 31 358 17612800 1700
137030424 Gomm F Nov. 26, 2021, 12:52 p.m. OK Python 3 TESTS 31 373 17203200 1700
136975429 whatshisbucket F Nov. 26, 2021, 8:08 a.m. OK Python 3 TESTS 31 389 17612800 1700
136964122 juramoshkov F Nov. 26, 2021, 5:37 a.m. OK Python 3 TESTS 31 405 18636800 1700
137043694 lensabillion F Nov. 26, 2021, 2:06 p.m. OK Python 3 TESTS 31 623 17203200 1700
136973156 sansen F Nov. 26, 2021, 7:36 a.m. OK Rust TESTS 31 46 17408000 1700
137084079 kobae964 F Nov. 27, 2021, 4:11 a.m. OK Rust TESTS 31 77 13209600 1700
137087234 kobae964 F Nov. 27, 2021, 5:03 a.m. OK Rust TESTS 31 93 13209600 1700
136953439 bqn F Nov. 26, 2021, 1:47 a.m. OK Rust TESTS 31 264 11571200 1700

remove filters

Back to search problems