Codeforces Round 1123 (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
2267 Codeforces Round 1123 (Div. 2) FINISHED False 8100 833066 Sept. 25, 2026, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 3695 ) F1 XOR Transformations (Easy Version) PROGRAMMING bitmasks brute force implementation sortings

This is the easy version of the problem. The difference between the versions is that in this version, the constraints on (n) and (q) are smaller. You can make hacks only if you have solved all versions of this problem. For an array (b) consisting of (m) integers, define a transformation as follows: Write down the values (b_i\oplus b_j) for all (1\le i\lt j\le m), where (\oplus) denotes the bitwise XOR operation .. Take the (m) smallest among the written values. Replace the elements of the array with the taken (m) values. For example, consider the transformation of the array (6, 7, 8, 9, 15). We write down the values (1, 1, 6, 7, 8, 9, 14, 14, 15, 15). After the transformation , the array becomes (1, 1, 6, 7, 8) — the (5) smallest elements. You are given an array (a) consisting of (n) non-negative integers. Let (\max(a)) denote the maximum element of the array (a), and (\min(a)) — the minimum. Your task is to answer (q) queries, each of which gives you one integer (x). For each query, find the value of (\max(a) - \min(a)) after (x) transformations on the array. Note that the queries are independent, i.e. before each query, the array (a) is restored to its original state. Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 100)). The description of the test cases follows. The first line of each test case contains two integers (n) and (q) ((5\le n\le 2000, 1\le q\le 2000)) — the size of the array and the number of queries. The second line of each test case contains (n) integers (a_1, a_2, \ldots, a_n) ((0\le a_i\lt 2^{30})). The next (q) lines of each test case contain an integer (x) ((0\le x\lt 2^{30})). It is guaranteed that the sum of (n) and the sum of (q) over all test cases do not exceed (2000). For each test case, output (q) integers — the answe

Tutorials

157126

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
392063300 Nadimul_Hasan07 F1 Sept. 25, 2026, 4:28 p.m. OK C# 13 TESTS 27 140 8294400
392064996 bobikbarabobik F1 Sept. 25, 2026, 4:33 p.m. OK C# 13 TESTS 27 375 16486400
392070014 volhalink F1 Sept. 25, 2026, 4:48 p.m. OK C# 13 TESTS 27 453 35737600
392115166 shjh0815 F1 Sept. 26, 2026, 5:52 a.m. OK C++17 (GCC 7-32) TESTS 27 46 0
392066112 chen_weilian F1 Sept. 25, 2026, 4:37 p.m. OK C++17 (GCC 7-32) TESTS 27 46 0
392065218 Inacheve F1 Sept. 25, 2026, 4:34 p.m. OK C++17 (GCC 7-32) TESTS 27 46 0
392070843 MCHEYH F1 Sept. 25, 2026, 4:49 p.m. OK C++17 (GCC 7-32) TESTS 27 46 819200
392067090 aoteyingtian666 F1 Sept. 25, 2026, 4:40 p.m. OK C++17 (GCC 7-32) TESTS 27 46 1331200
392091079 10tin-nhat F1 Sept. 25, 2026, 9:10 p.m. OK C++17 (GCC 7-32) TESTS 27 46 1638400
392060516 Rabbit_White F1 Sept. 25, 2026, 4:21 p.m. OK C++17 (GCC 7-32) TESTS 27 46 1638400
392065530 98723465_D F1 Sept. 25, 2026, 4:35 p.m. OK C++17 (GCC 7-32) TESTS 27 46 8089600
392064823 hezex F1 Sept. 25, 2026, 4:33 p.m. OK C++17 (GCC 7-32) TESTS 27 46 8089600
392058173 karanoli F1 Sept. 25, 2026, 4:14 p.m. OK C++17 (GCC 7-32) TESTS 27 46 8089600
392087823 alternn F1 Sept. 25, 2026, 8:09 p.m. OK C++20 (GCC 13-64) TESTS 27 31 0
392089221 Sadvik_Meda F1 Sept. 25, 2026, 8:34 p.m. OK C++20 (GCC 13-64) TESTS 27 46 0
392083109 jabiryimam1 F1 Sept. 25, 2026, 6:57 p.m. OK C++20 (GCC 13-64) TESTS 27 46 0
392072090 pipo1961 F1 Sept. 25, 2026, 5:07 p.m. OK C++20 (GCC 13-64) TESTS 27 46 0
392062905 dosifey67 F1 Sept. 25, 2026, 4:27 p.m. OK C++20 (GCC 13-64) TESTS 27 46 0
392058973 krishvamja07 F1 Sept. 25, 2026, 4:16 p.m. OK C++20 (GCC 13-64) TESTS 27 46 0
392072121 Liqy F1 Sept. 25, 2026, 5:07 p.m. OK C++20 (GCC 13-64) TESTS 27 46 1536000
392080591 17326020824 F1 Sept. 25, 2026, 6:25 p.m. OK C++20 (GCC 13-64) TESTS 27 46 4096000
392070273 HSSGR F1 Sept. 25, 2026, 4:48 p.m. OK C++20 (GCC 13-64) TESTS 27 46 4096000
392069827 itzsohanrc F1 Sept. 25, 2026, 4:47 p.m. OK C++20 (GCC 13-64) TESTS 27 46 4096000
392102221 Mariim F1 Sept. 26, 2026, 2:26 a.m. OK C++23 (GCC 14-64, msys2) TESTS 27 31 0
392059552 2333zy F1 Sept. 25, 2026, 4:18 p.m. OK C++23 (GCC 14-64, msys2) TESTS 27 31 4198400
392079236 Arlan007 F1 Sept. 25, 2026, 6:10 p.m. OK C++23 (GCC 14-64, msys2) TESTS 27 31 181145600
392111693 yywyyyyy1w F1 Sept. 26, 2026, 5:21 a.m. OK C++23 (GCC 14-64, msys2) TESTS 27 46 0
392101999 Mariim F1 Sept. 26, 2026, 2:21 a.m. OK C++23 (GCC 14-64, msys2) TESTS 27 46 0
392099107 MUZAN F1 Sept. 26, 2026, 1:09 a.m. OK C++23 (GCC 14-64, msys2) TESTS 27 46 0
392085695 Lemuen F1 Sept. 25, 2026, 7:33 p.m. OK C++23 (GCC 14-64, msys2) TESTS 27 46 0
392082514 Sersp3 F1 Sept. 25, 2026, 6:49 p.m. OK C++23 (GCC 14-64, msys2) TESTS 27 46 0
392081500 burnout F1 Sept. 25, 2026, 6:36 p.m. OK C++23 (GCC 14-64, msys2) TESTS 27 46 0
392081427 volcano_2025 F1 Sept. 25, 2026, 6:35 p.m. OK C++23 (GCC 14-64, msys2) TESTS 27 46 0
392080274 ruban F1 Sept. 25, 2026, 6:22 p.m. OK FPC TESTS 27 2375 117862400
392108707 ruban F1 Sept. 26, 2026, 4:41 a.m. OK FPC TESTS 27 3031 139161600
392066841 Upsies F1 Sept. 25, 2026, 4:39 p.m. OK GNU C11 TESTS 27 3156 32870400
392077012 TripleM5da F1 Sept. 25, 2026, 5:48 p.m. OK Go TESTS 27 109 89907200
392076733 TripleM5da F1 Sept. 25, 2026, 5:46 p.m. OK Go TESTS 27 156 490496000
392065395 LBHui F1 Sept. 25, 2026, 4:35 p.m. OK Go TESTS 27 843 83763200
392068222 TripleM5da F1 Sept. 25, 2026, 4:43 p.m. OK Go TESTS 27 2250 37990400
392065801 Sarthak1712 F1 Sept. 25, 2026, 4:36 p.m. OK Java 21 TESTS 27 218 1024000
392059848 aaryannage.dev F1 Sept. 25, 2026, 4:19 p.m. OK Java 21 TESTS 27 234 7372800
392059780 sirwagya F1 Sept. 25, 2026, 4:18 p.m. OK Java 21 TESTS 27 250 1024000
392067695 Raj_coder F1 Sept. 25, 2026, 4:41 p.m. OK Java 21 TESTS 27 250 15462400
392060838 ASM3456 F1 Sept. 25, 2026, 4:21 p.m. OK Java 21 TESTS 27 265 8704000
392061372 WiNterBoy180204 F1 Sept. 25, 2026, 4:23 p.m. OK Java 21 TESTS 27 328 1126400
392058799 pcsolo F1 Sept. 25, 2026, 4:16 p.m. OK Java 21 TESTS 27 531 17305600
392066934 techbro815 F1 Sept. 25, 2026, 4:39 p.m. OK Java 21 TESTS 27 562 15872000
392061514 rockzz6465 F1 Sept. 25, 2026, 4:23 p.m. OK Java 21 TESTS 27 578 18944000
392104344 Sagar_TH_137 F1 Sept. 26, 2026, 3:19 a.m. OK Java 21 TESTS 27 593 819200
392058981 harsh.sharma.gs25 F1 Sept. 25, 2026, 4:16 p.m. OK Java 8 TESTS 27 140 0
392064107 KamilIskhakov F1 Sept. 25, 2026, 4:31 p.m. OK Java 8 TESTS 27 1046 8806400
392068451 Sergey.Bankevich F1 Sept. 25, 2026, 4:44 p.m. OK Kotlin 1.7 TESTS 27 2750 137113600
392066615 Shuzhi66 F1 Sept. 25, 2026, 4:38 p.m. OK Kotlin 2.2 TESTS 27 484 9625600
392065806 wlaud F1 Sept. 25, 2026, 4:36 p.m. OK Node.js TESTS 27 2078 237568000
392069628 Nagisa365 F1 Sept. 25, 2026, 4:47 p.m. OK PyPy 3 TESTS 27 1140 40550400
392069939 alexenkovova F1 Sept. 25, 2026, 4:48 p.m. OK PyPy 3-64 TESTS 27 234 13004800
392070288 Sai_Sindhush_P F1 Sept. 25, 2026, 4:48 p.m. OK PyPy 3-64 TESTS 27 265 8601600
392070936 yakub_sadllil F1 Sept. 25, 2026, 4:49 p.m. OK PyPy 3-64 TESTS 27 328 9011200
392063320 iamRishii F1 Sept. 25, 2026, 4:29 p.m. OK PyPy 3-64 TESTS 27 328 13619200
392066320 b39b39 F1 Sept. 25, 2026, 4:37 p.m. OK PyPy 3-64 TESTS 27 406 80076800
392057791 DarkShadowWinner F1 Sept. 25, 2026, 4:13 p.m. OK PyPy 3-64 TESTS 27 468 50585600
392061601 Haire F1 Sept. 25, 2026, 4:24 p.m. OK PyPy 3-64 TESTS 27 500 37171200
392058483 goshan_17 F1 Sept. 25, 2026, 4:15 p.m. OK PyPy 3-64 TESTS 27 562 9932800
392068630 biy F1 Sept. 25, 2026, 4:44 p.m. OK PyPy 3-64 TESTS 27 718 22118400
392059826 LightHouse1 F1 Sept. 25, 2026, 4:19 p.m. OK PyPy 3-64 TESTS 27 906 50483200
392064615 sh20raj F1 Sept. 25, 2026, 4:32 p.m. OK Python 3 TESTS 27 109 1843200
392058227 veeawaralli F1 Sept. 25, 2026, 4:14 p.m. OK Python 3 TESTS 27 109 3686400
392062177 MayurPatil F1 Sept. 25, 2026, 4:25 p.m. OK Python 3 TESTS 27 781 1228800
392067951 galiver2009 F1 Sept. 25, 2026, 4:42 p.m. OK Python 3 TESTS 27 828 409600
392060963 pbhutka F1 Sept. 25, 2026, 4:22 p.m. OK Python 3 TESTS 27 1156 98099200
392062012 Hemakrish999 F1 Sept. 25, 2026, 4:25 p.m. OK Python 3 TESTS 27 1218 100556800
392068197 vpiyush171 F1 Sept. 25, 2026, 4:43 p.m. OK Python 3 TESTS 27 1890 180326400
392116607 gooonn F1 Sept. 26, 2026, 6:03 a.m. OK Python 3 TESTS 27 2234 106700800
392089712 2k23.csds2312829 F1 Sept. 25, 2026, 8:43 p.m. OK Python 3 TESTS 27 2328 97075200
392070819 huurichardho2008 F1 Sept. 25, 2026, 4:49 p.m. OK Python 3 TESTS 27 2343 98816000
392072951 NNChen F1 Sept. 25, 2026, 5:12 p.m. OK Rust 2024 TESTS 27 62 12185600
392058162 amanchourasia F1 Sept. 25, 2026, 4:14 p.m. OK Rust 2024 TESTS 27 93 4198400

remove filters

Back to search problems