Codeforces Round 1102 (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
2234 Codeforces Round 1102 (Div. 2) FINISHED False 8100 5844287 June 7, 2026, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 383 ) G Stripe, Token and Two Players PROGRAMMING data structures games

There is a stripe of (n + 1) cells, numbered from (1) to (n + 1). Initially, there is a token with power (1) on cell number (1), and the numbers (a_1, a_2, \ldots, a_n) are written on cells (1, 2, \ldots, n) respectively. Two players play a game. On each move, the player performs the following actions in order: Suppose the token is on cell number (i). The player may increase the power of the token by any integer from (0) to (a_i) inclusive. Then the player moves the token forward by any positive integer not exceeding the token's power, such that after this action the token does not leave the stripe. The player after whose move the token lands on cell (n + 1) wins. Who wins with optimal play? 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 one integer (n) ((1 \le n \le 10^5)) — the number of written numbers. The second line of each test case contains (n) integers (a_1, a_2, \ldots, a_n) ((0 \le a_i \le 10^9)) — the numbers written on the cells. It is guaranteed that the sum of (n) over all test cases does not exceed (10^5). For each test case, output one integer, (1) or (2) — the number of the player who wins with optimal play. (Player (1) makes the first move.) In the first test case, the power of the token remains equal to (1) throughout the game, so on every move the players must move exactly one cell forward. Thus, (3) moves will be made, and the last move will be made by player (1), so he will win in any case. In the second test case, player (2) has a winning strategy: on their very first move, increase the token's power as much as possible, and then jump to cell (4) and win. This is always possible, since at the start of the move the token will be on cell (2) or (3), and its power can

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
377702694 Vedant_Asati G June 7, 2026, 8:16 p.m. OK C++17 (GCC 7-32) TESTS 26 734 15155200
377720008 NANAM G June 8, 2026, 4:13 a.m. OK C++17 (GCC 7-32) TESTS 26 843 6656000
377722516 vidhayak__Ji G June 8, 2026, 4:56 a.m. OK C++17 (GCC 7-32) TESTS 26 921 6860800
377697538 tychoelling G June 7, 2026, 6:47 p.m. OK C++17 (GCC 7-32) TESTS 26 1031 6860800
377710532 nimom G June 7, 2026, 11:37 p.m. OK C++17 (GCC 7-32) TESTS 26 1031 10137600
377698228 crabbyXpiggy G June 7, 2026, 6:58 p.m. OK C++17 (GCC 7-32) TESTS 26 1125 13824000
377718830 iiiiioppp G June 8, 2026, 3:50 a.m. OK C++17 (GCC 7-32) TESTS 26 1296 5632000
377678450 sympop G June 7, 2026, 4:25 p.m. OK C++17 (GCC 7-32) TESTS 26 1906 14028800
377684168 shaw G June 7, 2026, 4:45 p.m. OK C++17 (GCC 7-32) TESTS 26 2187 35225600
377690923 ankushlamror6376 G June 7, 2026, 5:34 p.m. OK C++17 (GCC 7-32) TESTS 26 2828 14131200
377697593 orzz G June 7, 2026, 6:48 p.m. OK C++20 (GCC 13-64) TESTS 26 359 22937600
377691038 Zicrus G June 7, 2026, 5:35 p.m. OK C++20 (GCC 13-64) TESTS 26 390 28876800
377700125 _amod.yadav G June 7, 2026, 7:29 p.m. OK C++20 (GCC 13-64) TESTS 26 390 30310400
377685133 sbsb114 G June 7, 2026, 4:48 p.m. OK C++20 (GCC 13-64) TESTS 26 421 44339200
377674651 _lbw_ G June 7, 2026, 4:13 p.m. OK C++20 (GCC 13-64) TESTS 26 625 39526400
377671036 grinchy G June 7, 2026, 4:03 p.m. OK C++20 (GCC 13-64) TESTS 26 656 7372800
377714793 ramumali2002 G June 8, 2026, 2:16 a.m. OK C++20 (GCC 13-64) TESTS 26 859 8908800
377679005 Keshav_goyal G June 7, 2026, 4:27 p.m. OK C++20 (GCC 13-64) TESTS 26 921 9420800
377690651 4977 G June 7, 2026, 5:31 p.m. OK C++20 (GCC 13-64) TESTS 26 921 14336000
377715723 zhengly G June 8, 2026, 2:42 a.m. OK C++20 (GCC 13-64) TESTS 26 921 16179200
377676189 harurun4635 G June 7, 2026, 4:18 p.m. OK C++23 (GCC 14-64, msys2) TESTS 26 531 0
377685036 pts0003 G June 7, 2026, 4:48 p.m. OK C++23 (GCC 14-64, msys2) TESTS 26 562 16691200
377692856 SATSKY_2025target_LGM G June 7, 2026, 5:53 p.m. OK C++23 (GCC 14-64, msys2) TESTS 26 578 13926400
377695134 SATSKY_2025target_LGM G June 7, 2026, 6:18 p.m. OK C++23 (GCC 14-64, msys2) TESTS 26 593 13516800
377694208 SATSKY_2025target_LGM G June 7, 2026, 6:08 p.m. OK C++23 (GCC 14-64, msys2) TESTS 26 656 13516800
377690543 Kude G June 7, 2026, 5:30 p.m. OK C++23 (GCC 14-64, msys2) TESTS 26 671 3891200
377713894 employed G June 8, 2026, 1:48 a.m. OK C++23 (GCC 14-64, msys2) TESTS 26 671 29491200
377711558 Edu175 G June 8, 2026, 12:25 a.m. OK C++23 (GCC 14-64, msys2) TESTS 26 718 11980800
377723590 smac G June 8, 2026, 5:14 a.m. OK C++23 (GCC 14-64, msys2) TESTS 26 718 17408000
377720143 jtrh G June 8, 2026, 4:16 a.m. OK C++23 (GCC 14-64, msys2) TESTS 26 734 9216000
377701219 xooks_xooks_xooks G June 7, 2026, 7:48 p.m. OK Rust 2024 TESTS 26 640 7577600

remove filters

Back to search problems