Teza Round 1 (Codeforces Round 1015, Div. 1 + Div. 2)

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
2084 Teza Round 1 (Codeforces Round 1015, Div. 1 + Div. 2) FINISHED False 10800 32541923 April 5, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 106 ) G2 Wish Upon a Satellite (Hard Version) PROGRAMMING data structures dp

This is the hard version of the problem. The difference between the versions is that in this version, (t \le 10^4), (n \le 5 \cdot 10^5) and the sum of (n) does not exceed (5 \cdot 10^5). You can hack only if you solved all versions of this problem. For a non-empty sequence (c) of length (k), define (f(c)) as follows: Turtle and Piggy are playing a game on a sequence. They are given the sequence (c_1, c_2, \ldots, c_k), and Turtle goes first. Turtle and Piggy alternate in turns (so, Turtle does the first turn, Piggy does the second, Turtle does the third, etc.). The game goes as follows: Let the current length of the sequence be (m). If (m = 1), the game ends. If the game does not end and it's Turtle's turn, then Turtle must choose an integer (i) such that (1 \le i \le m - 1), set (c_i) to (\min(c_i, c_{i + 1})), and remove (c_{i + 1}). If the game does not end and it's Piggy's turn, then Piggy must choose an integer (i) such that (1 \le i \le m - 1), set (c_i) to (\max(c_i, c_{i + 1})), and remove (c_{i + 1}). Let the current length of the sequence be (m). If (m = 1), the game ends. If the game does not end and it's Turtle's turn, then Turtle must choose an integer (i) such that (1 \le i \le m - 1), set (c_i) to (\min(c_i, c_{i + 1})), and remove (c_{i + 1}). If the game does not end and it's Piggy's turn, then Piggy must choose an integer (i) such that (1 \le i \le m - 1), set (c_i) to (\max(c_i, c_{i + 1})), and remove (c_{i + 1}). Turtle wants to maximize the value of (c_1) in the end, while Piggy wants to minimize the value of (c_1) in the end. (f(c)) is the value of (c_1) in the end if both players play optimally. For a permutation (p) of length (n)(^{\text{∗}}), Turtle defines the beauty of the permutation as (\sum\limits_{i = 1}^n \sum\limits_{j = i}^n f(p_i, p_{i + 1}, \ldots, p_j)) (i.e.

Tutorials

141155

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
314193825 lmh_qwq G2 April 6, 2025, 4:34 a.m. OK C++17 (GCC 7-32) TESTS 39 484 24064000
314167732 yuto1115 G2 April 5, 2025, 7:52 p.m. OK C++20 (GCC 13-64) TESTS 39 187 10342400
314167821 yuto1115 G2 April 5, 2025, 7:53 p.m. OK C++20 (GCC 13-64) TESTS 39 999 10342400
314160979 ecnerwala G2 April 5, 2025, 6:47 p.m. OK C++23 (GCC 14-64, msys2) TESTS 39 249 28569600
314142893 maroonrk G2 April 5, 2025, 4:55 p.m. OK C++23 (GCC 14-64, msys2) TESTS 39 358 80588800
314173756 maroonrk G2 April 5, 2025, 9:14 p.m. OK C++23 (GCC 14-64, msys2) TESTS 39 358 80793600
314148932 rqoi031 G2 April 5, 2025, 5:15 p.m. OK C++23 (GCC 14-64, msys2) TESTS 39 374 44032000
314186544 Sparkle_Twilight G2 April 6, 2025, 2:21 a.m. OK C++23 (GCC 14-64, msys2) TESTS 39 452 31948800
314186325 Kuroni G2 April 6, 2025, 2:17 a.m. OK C++23 (GCC 14-64, msys2) TESTS 39 452 31948800
314151130 Kevin114514 G2 April 5, 2025, 5:23 p.m. OK C++23 (GCC 14-64, msys2) TESTS 39 468 29900800
314159318 min_inf G2 April 5, 2025, 6:33 p.m. OK C++23 (GCC 14-64, msys2) TESTS 39 530 24064000
314188235 thanhson0411 G2 April 6, 2025, 2:55 a.m. OK C++23 (GCC 14-64, msys2) TESTS 39 937 62668800
314147799 LJC00118 G2 April 5, 2025, 5:11 p.m. OK C++23 (GCC 14-64, msys2) TESTS 39 3687 32153600
314198425 ahmedafeef G2 April 6, 2025, 5:34 a.m. OK GNU C11 TESTS 39 515 24166400

remove filters

Back to search problems