Codeforces Round 1107 (Div. 3)

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
2241 Codeforces Round 1107 (Div. 3) FINISHED False 8100 3079510 June 30, 2026, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 4644 ) F A Bit Odd PROGRAMMING data structures games greedy math

Alice and Bob have got a binary(^{\text{∗}}) string (s) of length (n). They have decided to play a game on it, taking turns alternately, with Alice moving first. In each move, the player must select a subsequence (^{\text{†}}) which has an odd number of inversions(^{\text{‡}}) and delete it. The player who cannot make a move loses. Determine who wins the game, assuming both players play optimally. (^{\text{∗}})A binary string is a string that consists only of the characters (0) and (1). (^{\text{†}})A sequence (a) is a subsequence of a string (b) if (a) can be obtained from (b) by the deletion of several (possibly zero or all) characters. (^{\text{‡}})An inversion in a binary string (s) is a pair of indices ((i, j)) such that (i \lt j) and (s_i = 1) and (s_j = 0). The first line contains a single integer (t) ((1 \le t \le 10^4)) — the number of test cases. Description of each test case follows. The first line of each test case contains a single integer (n) ((1 \le n \le 2\cdot10^5)) — the length of the binary string (s). The second line of each test case contains a binary string (s) of length (n). It is guaranteed that each character of (s) is either (0) or (1). It is guaranteed that the sum of (n) over all the test cases does not exceed (2\cdot10^5). For each test case, print (Alice) if Alice wins the game and (Bob) otherwise. For the first test case, Alice can choose the entire string as it has an odd number of inversions. Now, Bob is left with an empty string, and he cannot make a move. Thus, Alice wins. For the second test case, Alice can choose the subsequence formed by the characters at indices (1), (2), and (4), i.e., (010). Bob is then left with the character at index (3), namely (0), which has (0) inve

Tutorials

Codeforces Round 1107 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
380844337 yuki_Ishijo F June 30, 2026, 7:15 p.m. OK C# 13 TESTS 16 78 1331200
380950520 kamisama02 F July 1, 2026, 6:35 p.m. OK C# 13 TESTS 16 78 1945600
380972264 phoenix0112 F July 2, 2026, 3:20 a.m. OK C++17 (GCC 7-32) TESTS 16 31 0
380956097 alien0_0. F July 1, 2026, 7:54 p.m. OK C++17 (GCC 7-32) TESTS 16 31 0
380952695 ryan__ F July 1, 2026, 7:03 p.m. OK C++17 (GCC 7-32) TESTS 16 31 0
380931553 crxry F July 1, 2026, 3:25 p.m. OK C++17 (GCC 7-32) TESTS 16 31 0
380924979 LNmeena F July 1, 2026, 2:27 p.m. OK C++17 (GCC 7-32) TESTS 16 31 0
380922687 lavish066 F July 1, 2026, 2:08 p.m. OK C++17 (GCC 7-32) TESTS 16 31 0
380892605 Aman_70 F July 1, 2026, 9:56 a.m. OK C++17 (GCC 7-32) TESTS 16 31 0
380891589 c_legg F July 1, 2026, 9:47 a.m. OK C++17 (GCC 7-32) TESTS 16 31 0
380890221 Kashyap_Saniyara_33 F July 1, 2026, 9:35 a.m. OK C++17 (GCC 7-32) TESTS 16 31 0
380884947 nerdev F July 1, 2026, 8:49 a.m. OK C++17 (GCC 7-32) TESTS 16 31 0
380920115 NOOBAM F July 1, 2026, 1:46 p.m. OK C++20 (GCC 13-64) TESTS 16 15 0
380972700 St.0.3 F July 2, 2026, 3:28 a.m. OK C++20 (GCC 13-64) TESTS 16 31 0
380969846 Jensen123 F July 2, 2026, 2:29 a.m. OK C++20 (GCC 13-64) TESTS 16 31 0
380960141 refrxn F July 1, 2026, 9:12 p.m. OK C++20 (GCC 13-64) TESTS 16 31 0
380949910 PROSENJIT_BISWAS F July 1, 2026, 6:28 p.m. OK C++20 (GCC 13-64) TESTS 16 31 0
380948526 divyansh_1729 F July 1, 2026, 6:16 p.m. OK C++20 (GCC 13-64) TESTS 16 31 0
380946827 winter238 F July 1, 2026, 5:59 p.m. OK C++20 (GCC 13-64) TESTS 16 31 0
380943812 PROSENJIT_BISWAS F July 1, 2026, 5:28 p.m. OK C++20 (GCC 13-64) TESTS 16 31 0
380935924 BUNNY3593 F July 1, 2026, 4:08 p.m. OK C++20 (GCC 13-64) TESTS 16 31 0
380933557 nazeeftham007 F July 1, 2026, 3:45 p.m. OK C++20 (GCC 13-64) TESTS 16 31 0
380982305 Saurab10 F July 2, 2026, 6:06 a.m. OK C++23 (GCC 14-64, msys2) TESTS 16 31 0
380980158 rushalverma F July 2, 2026, 5:37 a.m. OK C++23 (GCC 14-64, msys2) TESTS 16 31 0
380978961 akshatshaw85 F July 2, 2026, 5:20 a.m. OK C++23 (GCC 14-64, msys2) TESTS 16 31 0
380975421 key_anemoi F July 2, 2026, 4:17 a.m. OK C++23 (GCC 14-64, msys2) TESTS 16 31 0
380972598 dangthanhmay F July 2, 2026, 3:27 a.m. OK C++23 (GCC 14-64, msys2) TESTS 16 31 0
380968015 ParsaSRK F July 2, 2026, 1:40 a.m. OK C++23 (GCC 14-64, msys2) TESTS 16 31 0
380966146 Semyazi F July 2, 2026, 12:39 a.m. OK C++23 (GCC 14-64, msys2) TESTS 16 31 0
380966074 SF-Manman F July 2, 2026, 12:36 a.m. OK C++23 (GCC 14-64, msys2) TESTS 16 31 0
380965496 rbkd_cr F July 2, 2026, 12:14 a.m. OK C++23 (GCC 14-64, msys2) TESTS 16 31 0
380964820 IanPardo F July 1, 2026, 11:51 p.m. OK C++23 (GCC 14-64, msys2) TESTS 16 31 0
380943211 dp_gopher F July 1, 2026, 5:22 p.m. OK Go TESTS 16 46 1433600
380870367 mastacoda F July 1, 2026, 5:51 a.m. OK Java 21 TESTS 16 203 512000
380898951 Power_Rangers_ F July 1, 2026, 10:54 a.m. OK Java 21 TESTS 16 203 716800
380858293 mpksupercoder F July 1, 2026, 2:32 a.m. OK Java 21 TESTS 16 203 1740800
380979376 vishu00 F July 2, 2026, 5:26 a.m. OK Java 21 TESTS 16 218 1024000
380935685 gupta_harshal F July 1, 2026, 4:05 p.m. OK Java 21 TESTS 16 218 1331200
380883735 Azad_Singh F July 1, 2026, 8:38 a.m. OK Java 21 TESTS 16 234 716800
380870591 NpHardcore_05 F July 1, 2026, 5:54 a.m. OK Java 21 TESTS 16 234 819200
380969813 daniel.glabai F July 2, 2026, 2:28 a.m. OK Java 21 TESTS 16 250 716800
380843792 hg_2005 F June 30, 2026, 7:07 p.m. OK Java 21 TESTS 16 250 1945600
380880013 vkisgoat F July 1, 2026, 7:56 a.m. OK Java 21 TESTS 16 265 1331200
380942972 Rathod_789 F July 1, 2026, 5:19 p.m. OK Java 8 TESTS 16 109 0
380882211 arka_sync_dip F July 1, 2026, 8:22 a.m. OK Java 8 TESTS 16 187 0
380853977 Golovanov399 F June 30, 2026, 11:08 p.m. OK Kotlin 2.2 TESTS 16 265 1024000
380959611 SuryaPrakashMC F July 1, 2026, 9 p.m. OK PyPy 3 TESTS 16 234 139673600
380911948 Fajrin_Thuja F July 1, 2026, 12:41 p.m. OK PyPy 3 TESTS 16 250 8601600
380863449 hxu10 F July 1, 2026, 4:11 a.m. OK PyPy 3-64 TESTS 16 93 3686400
380952908 min_worked F July 1, 2026, 7:06 p.m. OK PyPy 3-64 TESTS 16 93 4403200
380897907 mirkocoric F July 1, 2026, 10:45 a.m. OK PyPy 3-64 TESTS 16 93 4608000
380895060 CHelle F July 1, 2026, 10:18 a.m. OK PyPy 3-64 TESTS 16 109 5017600
380862882 towersfreak2006 F July 1, 2026, 4:01 a.m. OK PyPy 3-64 TESTS 16 125 6041600
380982416 bhunesh005pawar F July 2, 2026, 6:08 a.m. OK PyPy 3-64 TESTS 16 125 12697600
380958347 titia F July 1, 2026, 8:34 p.m. OK PyPy 3-64 TESTS 16 125 23859200
380855711 masao F July 1, 2026, 1:30 a.m. OK PyPy 3-64 TESTS 16 140 21708800
380863471 darshrustagi F July 1, 2026, 4:11 a.m. OK PyPy 3-64 TESTS 16 156 7987200
380856458 fatalerror F July 1, 2026, 1:52 a.m. OK PyPy 3-64 TESTS 16 156 10035200
380858261 mpksupercoder F July 1, 2026, 2:31 a.m. OK Python 3 TESTS 16 78 716800
380922320 RUTHVIK0811 F July 1, 2026, 2:05 p.m. OK Python 3 TESTS 16 78 921600
380947241 kl2400030246 F July 1, 2026, 6:03 p.m. OK Python 3 TESTS 16 78 1740800
380844833 Mirpasha F June 30, 2026, 7:24 p.m. OK Python 3 TESTS 16 78 1843200
380981508 gooonn F July 2, 2026, 5:56 a.m. OK Python 3 TESTS 16 93 1536000
380973386 chmpro F July 2, 2026, 3:41 a.m. OK Python 3 TESTS 16 93 1536000
380843625 Midhilesh F June 30, 2026, 7:04 p.m. OK Python 3 TESTS 16 93 2252800
380964741 vuthoo F July 1, 2026, 11:47 p.m. OK Python 3 TESTS 16 93 3584000
380847223 Yolz F June 30, 2026, 8:03 p.m. OK Python 3 TESTS 16 109 716800
380845912 Yolz F June 30, 2026, 7:40 p.m. OK Python 3 TESTS 16 109 716800
380863223 Tantellam F July 1, 2026, 4:07 a.m. OK Rust 2024 TESTS 16 46 0

remove filters

Back to search problems