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 |
|---|---|---|---|---|---|---|
| 2061 | IAEPC Preliminary Contest (Codeforces Round 999, Div. 1 + Div. 2) | FINISHED | False | 10800 | 39021923 | Jan. 20, 2025, 2:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 120 ) | I | Kevin and Nivek | PROGRAMMING | divide and conquer dp |
Kevin and Nivek are competing for the title of "The Best Kevin". They aim to determine the winner through (n) matches. The (i)-th match can be one of two types: Type 1 : Kevin needs to spend (a_i) time to defeat Nivek and win the match. If Kevin doesn't spend (a_i) time on it, Nivek will win the match. Type 2 : The outcome of this match depends on their historical records. If Kevin's number of wins is greater than or equal to Nivek's up to this match, then Kevin wins. Otherwise, Nivek wins. Kevin wants to know the minimum amount of time he needs to spend to ensure he wins at least (k) matches. Output the answers for (k = 0, 1, \ldots, n). 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 a single integer (n) ((1 \le n \le 3 \cdot 10^5)) — the number of matches. The second line contains (n) integers (a_1, a_2, \ldots, a_n) ((-1 \leq a_i \leq 10^9)). If (a_i = -1), the (i)-th match is of Type 2 . Otherwise, the (i)-th match is of Type 1 , and (a_i) represents the amount of time Kevin needs to spend to win this match. It is guaranteed that the sum of (n) over all test cases does not exceed (3 \cdot 10^5). For each test case, output (n + 1) integers. The (i)-th integer represents the minimum amount of time to win at least (i-1) matches. In the first test case, all matches are of Type 2. Kevin can automatically win all matches. In the second test case, all matches are of Type 1. Kevin can choose matches in increasing order of (a_i). In the third test case: If Kevin spends (a_1) time on match (1), he can win matches (1, 2, 3, 4). If Kevin spends (a_5) time on match (5), he can win match (5). If Kevin spends (a_1) time on match (1) and (a_5) time on match (5), he can win all matches. |
| IAEPC Preliminary Contest (Codeforces Round 999, Div. 1 + Div. 2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 302149517 | AlgoRubik | I | Jan. 20, 2025, 9:36 p.m. | OK | C++20 (GCC 13-64) | TESTS | 36 | 1484 | 27340800 | ||
| 302163642 | rqoi032 | I | Jan. 21, 2025, 2:37 a.m. | OK | C++20 (GCC 13-64) | TESTS | 36 | 3421 | 13004800 | ||
| 302147464 | rainboy | I | Jan. 20, 2025, 8:57 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 36 | 1062 | 120320000 | ||
| 302144176 | Benq | I | Jan. 20, 2025, 8:11 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 36 | 1609 | 27033600 | ||
| 302160952 | Kevin114514 | I | Jan. 21, 2025, 1:56 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 36 | 1890 | 25088000 | ||
| 302142064 | Benq | I | Jan. 20, 2025, 7:47 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 36 | 1953 | 14233600 | ||
| 302142123 | Benq | I | Jan. 20, 2025, 7:48 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 36 | 2233 | 14131200 | ||
| 302141919 | Benq | I | Jan. 20, 2025, 7:46 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 36 | 2468 | 14028800 | ||
| 302124920 | Um_nik | I | Jan. 20, 2025, 5:23 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 36 | 2874 | 21708800 | ||
| 302147304 | rainboy | I | Jan. 20, 2025, 8:55 p.m. | OK | GNU C11 | TESTS | 36 | 2421 | 120320000 |
Back to search problems