Codeforces Global Round 13

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
1491 Codeforces Global Round 13 FINISHED False 10800 117303899 Feb. 28, 2021, 1:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 7987 ) C Pekora and Trampoline PROGRAMMING brute force data structures dp graphs greedy implementation

B"There is a trampoline park with n trampolines in a line. The i -th of which has strength S_i . Pekora can jump on trampolines in multiple passes. She starts the pass by jumping on any trampoline of her choice. If at the moment Pekora jumps on trampoline i , the trampoline will launch her to position i + S_i , and S_i will become equal to max(S_i-1,1) . In other words, S_i will decrease by 1 , except of the case S_i=1 , when S_i will remain equal to 1 . If there is no trampoline in position i + S_i , then this pass is over. Otherwise, Pekora will continue the pass by jumping from the trampoline at position i + S_i by the same rule as above. Pekora can't stop jumping during the pass until she lands at the position larger than n (in which there is no trampoline). Poor Pekora! Pekora is a naughty rabbit and wants to ruin the trampoline park by reducing all S_i to 1 . What is the minimum number of passes she needs to reduce all S_i to 1 ? The first line contains a single integer t ( 1 <= t <= 500 ) -- the number of test cases. The first line of each test case contains a single integer n ( 1 <= q n <= q 5000 ) -- the number of trampolines. The second line of each test case contains n integers S_1, S_2, ... , S_n ( 1 <= S_i <= 10^9 ), where S_i is the strength of the i -th trampoline. It's guaranteed that the sum of n over all test cases doesn't exceed 5000 . For each test case, output a single integer -- the minimum number of passes Pekora needs to do to reduce all S_i to 1 . For the first test case, here is an optimal series of passes Pekora can take. (The bolded numbers are the positions that Pekora jumps into during these passes.) For the second test case, the optimal series of passes is show below. For the third test case, all S_i are already equal to 1 . "...

Tutorials

Codeforces Global Round 13 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
108763294 1473439561pp C March 1, 2021, 1:25 a.m. OK Clang++17 Diagnostics TESTS 61 187 0
108770081 HOJQVFNA C March 1, 2021, 5:03 a.m. OK GNU C++11 TESTS 61 15 102400
108770069 HOJQVFNA C March 1, 2021, 5:03 a.m. OK GNU C++11 TESTS 61 15 102400
108739216 myx12345 C Feb. 28, 2021, 4:19 p.m. OK GNU C++11 TESTS 59 15 102400
108764659 SSerxhs C March 1, 2021, 2:25 a.m. OK GNU C++11 TESTS 61 15 25088000
108763826 fishcathu. C March 1, 2021, 1:49 a.m. OK GNU C++11 TESTS 61 30 0
108743435 Leonard7 C Feb. 28, 2021, 4:33 p.m. OK GNU C++11 TESTS 59 30 102400
108739382 hnust_sunpangbo C Feb. 28, 2021, 4:20 p.m. OK GNU C++11 TESTS 59 30 512000
108769057 Comet_Honeymoon C March 1, 2021, 4:40 a.m. OK GNU C++11 TESTS 61 30 819200
108772904 Road_to_Candidate-master C March 1, 2021, 5:47 a.m. OK GNU C++11 TESTS 61 31 0
108773754 _xsl C March 1, 2021, 6 a.m. OK GNU C++11 TESTS 61 31 0
108752673 Arnyev C Feb. 28, 2021, 6:47 p.m. OK .NET Core C# TESTS 61 109 819200
108747041 Arnyev C Feb. 28, 2021, 5:28 p.m. OK .NET Core C# TESTS 59 171 921600

remove filters

Back to search problems