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 |
|---|---|---|---|---|---|---|
| 2085 | Codeforces Round 1011 (Div. 2) | FINISHED | False | 7200 | 33751523 | March 22, 2025, 2:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 5241 ) | D | Serval and Kaitenzushi Buffet | PROGRAMMING | data structures graph matchings greedy |
Serval has just found a Kaitenzushi buffet restaurant. Kaitenzushi means that there is a conveyor belt in the restaurant, delivering plates of sushi in front of the customer, Serval. In this restaurant, each plate contains exactly (k) pieces of sushi and the (i)-th plate has a deliciousness (d_i). Serval will have a meal in this restaurant for (n) minutes, and within the (n) minutes, he must eat up all the pieces of sushi he took from the belt. Denote the counter for uneaten taken pieces of sushi as (r). Initially, (r=0). In the (i)-th minute ((1\leq i\leq n)), only the (i)-th plate of sushi will be delivered in front of Serval, and he can do one of the following: Take the (i)-th plate of sushi (whose deliciousness is (d_i)) from the belt, and (r) will be increased by (k); Eat one uneaten piece of sushi that he took from the belt before, and (r) will be decreased by (1). Note that you can do this only if (r>0); Or, do nothing, and (r) will remain unchanged. Note that after the (n) minutes, the value of (r) must be (0). Serval wants to maximize the sum of the deliciousnesses of all the plates he took. Help him find it out! Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 10^4)). The description of the test cases follows. The first line of each test case contains two integers (n) and (k) ((1\leq k<n\leq 2\cdot 10^5)) — the number of minutes of the meal and the number of sushi pieces in each plate. The second line contains (n) integers (d_1, d_2, \ldots, d_n) ((1\leq d_i\leq 10^9)) — the deliciousness of each plate. It is guaranteed that the sum of (n) over all test cases does not exceed (2\cdot 10^5). For each test case, print a single integer — the maximum possible sum of the deliciousnesses of all the plates Serval took. In the first test case, it can be shown that Serval can e |
| Codeforces Round #1011 (Div. 2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 311896227 | og.kostya | D | March 22, 2025, 5:03 p.m. | OK | C# 10 | TESTS | 23 | 140 | 16179200 | ||
| 311898301 | Anastasiya_Andreevna | D | March 22, 2025, 5:12 p.m. | OK | C# 10 | TESTS | 23 | 686 | 29184000 | ||
| 311945222 | incra | D | March 23, 2025, 2:05 a.m. | OK | C++17 (GCC 7-32) | TESTS | 23 | 93 | 0 | ||
| 311944635 | xiaozhao2002 | D | March 23, 2025, 1:54 a.m. | OK | C++17 (GCC 7-32) | TESTS | 23 | 93 | 0 | ||
| 311910954 | ilopez15 | D | March 22, 2025, 6:41 p.m. | OK | C++17 (GCC 7-32) | TESTS | 23 | 93 | 0 | ||
| 311910057 | piratZnachor | D | March 22, 2025, 6:33 p.m. | OK | C++17 (GCC 7-32) | TESTS | 23 | 93 | 0 | ||
| 311907819 | laluprasad7 | D | March 22, 2025, 6:15 p.m. | OK | C++17 (GCC 7-32) | TESTS | 23 | 93 | 0 | ||
| 311955221 | YEdh | D | March 23, 2025, 4:42 a.m. | OK | C++17 (GCC 7-32) | TESTS | 23 | 93 | 102400 | ||
| 311951514 | WjhisTyAhzh | D | March 23, 2025, 3:51 a.m. | OK | C++17 (GCC 7-32) | TESTS | 23 | 93 | 102400 | ||
| 311944795 | you-jin-plus | D | March 23, 2025, 1:57 a.m. | OK | C++17 (GCC 7-32) | TESTS | 23 | 93 | 102400 | ||
| 311918382 | DemberS06 | D | March 22, 2025, 7:49 p.m. | OK | C++17 (GCC 7-32) | TESTS | 23 | 93 | 102400 | ||
| 311911456 | mostafadelgouda | D | March 22, 2025, 6:45 p.m. | OK | C++17 (GCC 7-32) | TESTS | 23 | 93 | 102400 | ||
| 311947360 | zjjws | D | March 23, 2025, 2:43 a.m. | OK | C++20 (GCC 13-64) | TESTS | 23 | 62 | 921600 | ||
| 311953171 | www_bilibili_com | D | March 23, 2025, 4:15 a.m. | OK | C++20 (GCC 13-64) | TESTS | 23 | 62 | 2560000 | ||
| 311919432 | Shoeib | D | March 22, 2025, 8 p.m. | OK | C++20 (GCC 13-64) | TESTS | 23 | 77 | 0 | ||
| 311948715 | KINnaoinza | D | March 23, 2025, 3:06 a.m. | OK | C++20 (GCC 13-64) | TESTS | 23 | 77 | 102400 | ||
| 311957699 | lahoax | D | March 23, 2025, 5:11 a.m. | OK | C++20 (GCC 13-64) | TESTS | 23 | 78 | 102400 | ||
| 311956090 | Xxxxxxxh | D | March 23, 2025, 4:53 a.m. | OK | C++20 (GCC 13-64) | TESTS | 23 | 78 | 102400 | ||
| 311951854 | ryuuko_ | D | March 23, 2025, 3:56 a.m. | OK | C++20 (GCC 13-64) | TESTS | 23 | 78 | 102400 | ||
| 311933194 | bitmaster_ | D | March 22, 2025, 10:10 p.m. | OK | C++20 (GCC 13-64) | TESTS | 23 | 78 | 102400 | ||
| 311915450 | sjm150 | D | March 22, 2025, 7:21 p.m. | OK | C++20 (GCC 13-64) | TESTS | 23 | 78 | 102400 | ||
| 311910194 | LittleYoo | D | March 22, 2025, 6:34 p.m. | OK | C++20 (GCC 13-64) | TESTS | 23 | 78 | 102400 |
Back to search problems