Codeforces Round 1028 (Div. 1)

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
2115 Codeforces Round 1028 (Div. 1) FINISHED False 7200 27703523 May 31, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 1050 ) D Gellyfish and Forget-Me-Not PROGRAMMING bitmasks games math

Gellyfish and Flower are playing a game. The game consists of two arrays of (n) integers (a_1,a_2,\ldots,a_n) and (b_1,b_2,\ldots,b_n), along with a binary string (c_1c_2\ldots c_n) of length (n). There is also an integer (x) which is initialized to (0). The game consists of (n) rounds. For (i = 1,2,\ldots,n), the round proceeds as follows: If (c_i = \mathtt{0}), Gellyfish will be the active player. Otherwise, if (c_i = \mathtt{1}), Flower will be the active player. The active player will perform exactly one of the following operations: Set (x:=x \oplus a_i). Set (x:=x \oplus b_i). Set (x:=x \oplus a_i). Set (x:=x \oplus b_i). Here, (\oplus) denotes the bitwise XOR operation . Gellyfish wants to minimize the final value of (x) after (n) rounds, while Flower wants to maximize it. Find the final value of (x) after all (n) rounds if both players play optimally. 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 \leq n \leq 10^5)) — the number of rounds of the game. The second line of each test case contains (n) integers (a_1, a_2, \ldots, a_n) ((0 \leq a_i < 2^{60})). The third line of each test case contains (n) integers (b_1, b_2, \ldots, b_n) ((0 \leq b_i < 2^{60})). The fourth line of each test case contains a binary string (c) of length (n). It is guaranteed that the sum of (n) over all test cases does not exceed (10^5). For each test case, output a single integer — the final value of (x) after all (n) rounds. In the first test case, there's only one round and Gellyfish is the active player of that round. Therefore, she will choose (a_1), and the final value of (x) is (0). In the second test case, Flower will be the ac

Tutorials

Codeforces Round 1028 (Div.1, Div.2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
322325469 Xerxes D May 31, 2025, 11:12 p.m. OK C++17 (GCC 7-32) TESTS 20 124 102400
322325511 Xerxes D May 31, 2025, 11:14 p.m. OK C++17 (GCC 7-32) TESTS 20 140 102400
322318917 arzhantsev64 D May 31, 2025, 8:37 p.m. OK C++17 (GCC 7-32) TESTS 20 140 102400
322299440 cescmentation_folch D May 31, 2025, 5:40 p.m. OK C++17 (GCC 7-32) TESTS 20 140 102400
322288206 fengqiyuka D May 31, 2025, 4:26 p.m. OK C++17 (GCC 7-32) TESTS 20 140 102400
322285561 radoslav11 D May 31, 2025, 4:21 p.m. OK C++17 (GCC 7-32) TESTS 20 140 102400
322264257 Um_nik D May 31, 2025, 3:49 p.m. OK C++17 (GCC 7-32) TESTS 20 156 921600
322300795 AiPd D May 31, 2025, 5:49 p.m. OK C++17 (GCC 7-32) TESTS 20 171 102400
322270426 Morphed D May 31, 2025, 3:58 p.m. OK C++17 (GCC 7-32) TESTS 20 171 1740800
322263093 Rosmontis D May 31, 2025, 3:48 p.m. OK C++17 (GCC 7-32) TESTS 20 171 2560000
322258885 shiomusubi496 D May 31, 2025, 3:42 p.m. OK C++20 (GCC 13-64) TESTS 20 77 716800
322273069 exgcd D May 31, 2025, 4:02 p.m. OK C++20 (GCC 13-64) TESTS 20 78 102400
322342303 rin204 D June 1, 2025, 4:58 a.m. OK C++20 (GCC 13-64) TESTS 21 93 102400
322326479 Dominater069 D May 31, 2025, 11:52 p.m. OK C++20 (GCC 13-64) TESTS 20 93 102400
322286418 Mitsubachi D May 31, 2025, 4:23 p.m. OK C++20 (GCC 13-64) TESTS 20 108 102400
322252360 tourist D May 31, 2025, 3:34 p.m. OK C++20 (GCC 13-64) TESTS 20 108 102400
322244341 kaichou243 D May 31, 2025, 3:25 p.m. OK C++20 (GCC 13-64) TESTS 20 108 102400
322323997 LuCpp D May 31, 2025, 10:25 p.m. OK C++20 (GCC 13-64) TESTS 20 109 102400
322318155 darkahmed D May 31, 2025, 8:25 p.m. OK C++20 (GCC 13-64) TESTS 20 109 102400
322314654 Xellos D May 31, 2025, 7:38 p.m. OK C++20 (GCC 13-64) TESTS 20 109 102400
322324225 maspy D May 31, 2025, 10:31 p.m. OK C++23 (GCC 14-64, msys2) TESTS 20 62 307200
322230158 yosupo D May 31, 2025, 3:10 p.m. OK C++23 (GCC 14-64, msys2) TESTS 20 77 102400
322256655 furry D May 31, 2025, 3:40 p.m. OK C++23 (GCC 14-64, msys2) TESTS 20 77 4915200
322309689 Mangooste D May 31, 2025, 6:48 p.m. OK C++23 (GCC 14-64, msys2) TESTS 20 92 102400
322278818 adamant D May 31, 2025, 4:11 p.m. OK C++23 (GCC 14-64, msys2) TESTS 20 92 15052800
322343201 thangdz2k7 D June 1, 2025, 5:10 a.m. OK C++23 (GCC 14-64, msys2) TESTS 21 93 102400
322286970 lexiyvv D May 31, 2025, 4:24 p.m. OK C++23 (GCC 14-64, msys2) TESTS 20 93 1638400
322280257 OIer_kzc D May 31, 2025, 4:13 p.m. OK C++23 (GCC 14-64, msys2) TESTS 20 93 4915200
322344138 akshaykhandelwal D June 1, 2025, 5:21 a.m. OK C++23 (GCC 14-64, msys2) TESTS 21 108 102400
322336495 Proofy D June 1, 2025, 3:39 a.m. OK C++23 (GCC 14-64, msys2) TESTS 20 108 102400
322272927 conqueror_of_tourist D May 31, 2025, 4:02 p.m. OK PyPy 3-64 TESTS 20 218 22937600
322280776 golomb D May 31, 2025, 4:14 p.m. OK PyPy 3-64 TESTS 20 296 24678400
322304882 dyppp D May 31, 2025, 6:12 p.m. OK PyPy 3-64 TESTS 20 311 25088000
322343948 sansen D June 1, 2025, 5:19 a.m. OK Rust 2021 TESTS 21 62 3891200

remove filters

Back to search problems