Codeforces Global Round 31 (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
2180 Codeforces Global Round 31 (Div. 1 + Div. 2) FINISHED False 9000 10250722 Dec. 19, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 103 ) H2 Bug Is Feature (Conditional Version) PROGRAMMING games

This is the conditional version of the problem. The difference between the versions is that in this version, the "non-decreasing common difference" is present. You can hack only if you solved all versions of this problem. Note that neither version is necessarily easier than the other, and they can be solved independently. Bug and Feature are immersed in a game of Sequence. In this unique version of the Sequence game, a sequence begins with three positive integers (a < b < c \le x), forming an arithmetic progression (i.e., (b-a=c-b)). During each turn, a player can selectively increase one of (a), (b), or (c) by a positive integer. After the move, the numbers must retain their arithmetic progression, possibly with a new order, and a common difference not less than the previous one . Moreover, none of (a), (b), or (c) should exceed (x). Not content with the conventional Sequence game, Bug and Feature decide to engage in a (n) series of Sequence games simultaneously. For the (i)-th series, they are provided with five numbers (a_i < b_i < c_i \le l_i \le r_i). They will play a game with numbers (a_i < b_i < c_i \le x) for every integer (x) in the range (l_i, r_i) (resulting in a total of (\sum_{i=1}^n (r_i - l_i + 1)) games). Taking turns, they play all the games together, with Bug starting first and then Feature. In each turn, a player selects an unfinished game and makes a move in that game. The player who cannot make a move loses. Now, the question is: if both players play optimally, who will emerge victorious? Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 10^5)). The description of the test cases follows. The first line of each test case consists of a single integer (n) ((1 \le n \le 2 \cdot 10^5)) — the number of series of games that Bug and Feature wish to play. Each of the next (n) lines contains five integer

Tutorials

Codeforces Global Round 31

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
354230592 luoxueac H2 Dec. 19, 2025, 6:58 p.m. OK C++17 (GCC 7-32) TESTS 17 343 4198400
354252293 liujiaxi123456 H2 Dec. 20, 2025, 2:50 a.m. OK C++20 (GCC 13-64) TESTS 17 250 102400
354232657 Denisov H2 Dec. 19, 2025, 7:23 p.m. OK C++20 (GCC 13-64) TESTS 17 500 4096000

remove filters

Back to search problems