Spectral::Cup 2026 Round 1 (Codeforces Round 1094, 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
2222 Spectral::Cup 2026 Round 1 (Codeforces Round 1094, Div. 1 + Div. 2) FINISHED False 9000 1437864 April 25, 2026, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 7444 ) B Artistic Balance Tree PROGRAMMING greedy sortings

After learning about the Artistic Balance Tree, Lizhous encountered the following problem. You are given an array (a) consisting of (n) integers. You need to perform exactly (m) operations on (a) in order. Each operation consists of two steps. Specifically, in the (i)-th operation, you are given an integer (x_i), and you will: First, select a center index (u) and a non-negative length (y) such that the interval (u-y, u+y) lies entirely within (1, n) (i.e., (u - y \ge 1) and (u + y \le n)). For each (1\le i\le y), swap the elements (a_{u-i}) and (a_{u+i}). Then, mark the element at index (x_i). If this element is already marked, nothing happens. Note that the marks are on elements, not indices. That means if an element is swapped with some other element by future operations, the mark will stay on it. After performing all (m) operations, your task is to find the minimum possible sum of all elements that remain unmarked . 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 two integers (n) and (m) ((1 \le n, m \le 10^5)) — the length of (a) and the number of operations. The second line contains (n) integers (a_1, a_2, \ldots, a_n) ((-10^9 \le a_i \le 10^9)) — the elements of (a). The third line contains (m) integers (x_1, x_2, \ldots, x_m) ((1 \le x_i \le n)) — the indices to be marked in each operation. It is guaranteed that the sum of (n) over all test cases does not exceed (10^5). It is guaranteed that the sum of (m) over all test cases does not exceed (10^5). For each test case, output a single integer — the minimum possible sum of the unmarked elements after all operations. In the first test case, one optimal operation sequence is as follows: Choose center (u=4) and l

Tutorials

Spectral::Cup 2026 Round 1 (Codeforces Round 1094, 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
372516434 sasafied B April 25, 2026, 4:24 p.m. OK C# 10 TESTS 10 109 2969600
372508405 volhalink B April 25, 2026, 3:57 p.m. OK C# 13 TESTS 10 140 37171200
372511254 stronglion64 B April 25, 2026, 4:06 p.m. OK C# 13 TESTS 10 140 39219200
372566996 sanjay.kaushik B April 26, 2026, 4:17 a.m. OK C++17 (GCC 7-32) TESTS 10 62 0
372546333 Aman826 B April 25, 2026, 9:05 p.m. OK C++17 (GCC 7-32) TESTS 10 62 0
372534481 adarshagrahari0503 B April 25, 2026, 6:34 p.m. OK C++17 (GCC 7-32) TESTS 10 62 0
372520186 Shr1mp_ B April 25, 2026, 4:39 p.m. OK C++17 (GCC 7-32) TESTS 10 62 0
372561783 ch3ch2cho1 B April 26, 2026, 2:16 a.m. OK C++17 (GCC 7-32) TESTS 10 62 102400
372542922 Gononajontro_Biggani B April 25, 2026, 8:14 p.m. OK C++17 (GCC 7-32) TESTS 10 62 102400
372520098 zidcevub B April 25, 2026, 4:38 p.m. OK C++17 (GCC 7-32) TESTS 10 62 102400
372516916 saubhagya_keshav_singh B April 25, 2026, 4:26 p.m. OK C++17 (GCC 7-32) TESTS 10 62 102400
372508622 anku_kum B April 25, 2026, 3:57 p.m. OK C++17 (GCC 7-32) TESTS 10 62 102400
372518768 MilkLoong B April 25, 2026, 4:33 p.m. OK C++17 (GCC 7-32) TESTS 10 62 819200
372543604 yash-2007 B April 25, 2026, 8:24 p.m. OK C++20 (GCC 13-64) TESTS 10 46 0
372543676 Geothermal B April 25, 2026, 8:25 p.m. OK C++20 (GCC 13-64) TESTS 10 46 307200
372573991 pt_tp_3872 B April 26, 2026, 6:08 a.m. OK C++20 (GCC 13-64) TESTS 10 62 0
372573223 zhaoboxiang B April 26, 2026, 5:58 a.m. OK C++20 (GCC 13-64) TESTS 10 62 0
372572180 Freakboy B April 26, 2026, 5:44 a.m. OK C++20 (GCC 13-64) TESTS 10 62 0
372571807 LinAoBo B April 26, 2026, 5:39 a.m. OK C++20 (GCC 13-64) TESTS 10 62 0
372569024 YASHRAJ_0018 B April 26, 2026, 4:57 a.m. OK C++20 (GCC 13-64) TESTS 10 62 0
372568198 jorgevmg31 B April 26, 2026, 4:40 a.m. OK C++20 (GCC 13-64) TESTS 10 62 0
372568065 asunday B April 26, 2026, 4:38 a.m. OK C++20 (GCC 13-64) TESTS 10 62 0
372565917 q4m_t B April 26, 2026, 3:57 a.m. OK C++20 (GCC 13-64) TESTS 10 62 0
372568268 Huydz2k7 B April 26, 2026, 4:42 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
372547353 Ajay967 B April 25, 2026, 9:22 p.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
372532078 hexhunter06 B April 25, 2026, 6:13 p.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
372519044 surajkunwar110907 B April 25, 2026, 4:34 p.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
372560969 binglengmo B April 26, 2026, 1:51 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 204800
372570941 unhappylord B April 26, 2026, 5:27 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 62 0
372570220 notkim16 B April 26, 2026, 5:18 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 62 0
372569744 ahoooooolic B April 26, 2026, 5:10 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 62 0
372567391 CrJayden07 B April 26, 2026, 4:24 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 62 0
372567335 aaaasin B April 26, 2026, 4:23 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 62 0
372509280 Segmentati0nFault B April 25, 2026, 3:59 p.m. OK GNU C11 TESTS 10 62 1536000
372519740 Radhans_dad18 B April 25, 2026, 4:37 p.m. OK GNU C11 TESTS 10 78 1536000
372566126 changyu3256 B April 26, 2026, 4:01 a.m. OK GNU C11 TESTS 10 78 1638400
372565893 changyu3256 B April 26, 2026, 3:56 a.m. OK GNU C11 TESTS 10 78 1638400
372513539 changyu3256 B April 25, 2026, 4:14 p.m. OK GNU C11 TESTS 10 78 1638400
372509177 Desi_ghee B April 25, 2026, 3:59 p.m. OK GNU C11 TESTS 10 78 4403200
372509106 frag_ B April 25, 2026, 3:59 p.m. OK GNU C11 TESTS 10 93 1638400
372522540 kevin2003 B April 25, 2026, 4:48 p.m. OK Go TESTS 10 62 3788800
372507920 adityasinghtomar78 B April 25, 2026, 3:55 p.m. OK Go TESTS 10 140 4608000
372535920 shyamPrajapat B April 25, 2026, 6:49 p.m. OK Java 21 TESTS 10 234 614400
372523810 Zadymiarz4321 B April 25, 2026, 4:53 p.m. OK Java 21 TESTS 10 265 512000
372520602 angara.balaji1 B April 25, 2026, 4:40 p.m. OK Java 21 TESTS 10 265 716800
372510853 madhu.korada131 B April 25, 2026, 4:05 p.m. OK Java 21 TESTS 10 265 2252800
372510114 imperial_X B April 25, 2026, 4:02 p.m. OK Java 21 TESTS 10 281 204800
372515992 GooseOnTheLoose B April 25, 2026, 4:23 p.m. OK Java 21 TESTS 10 281 716800
372573570 Azad_Singh B April 26, 2026, 6:03 a.m. OK Java 21 TESTS 10 281 921600
372539525 madhu.korada131 B April 25, 2026, 7:29 p.m. OK Java 21 TESTS 10 281 1331200
372510308 bytebb B April 25, 2026, 4:03 p.m. OK Java 21 TESTS 10 281 1331200
372524365 billy_butcher69 B April 25, 2026, 4:55 p.m. OK Java 21 TESTS 10 296 1740800
372513609 hardgonnapass B April 25, 2026, 4:14 p.m. OK Java 8 TESTS 10 140 0
372508070 harsh_1806 B April 25, 2026, 3:56 p.m. OK Java 8 TESTS 10 156 0
372533889 Pranav_45 B April 25, 2026, 6:29 p.m. OK Java 8 TESTS 10 203 65433600
372507695 aparmitsrivastava1 B April 25, 2026, 3:54 p.m. OK Java 8 TESTS 10 296 716800
372535929 manavajk26 B April 25, 2026, 6:49 p.m. OK Java 8 TESTS 10 359 0
372509748 Abhishek_951 B April 25, 2026, 4:01 p.m. OK Java 8 TESTS 10 421 0
372512884 mayank_112 B April 25, 2026, 4:12 p.m. OK Java 8 TESTS 10 468 0
372511693 Techoo5 B April 25, 2026, 4:07 p.m. OK Java 8 TESTS 10 468 0
372513621 Emperatore B April 25, 2026, 4:14 p.m. OK Mono C# TESTS 10 109 28876800
372509838 bitplease_ B April 25, 2026, 4:01 p.m. OK Node.js TESTS 10 171 32768000
372565548 tackle_them B April 26, 2026, 3:50 a.m. OK Node.js TESTS 10 218 33075200
372507999 an0n7me B April 25, 2026, 3:55 p.m. OK OCaml TESTS 10 140 102400
372515286 Shotgun_pink B April 25, 2026, 4:20 p.m. OK PyPy 3 TESTS 10 515 12288000
372510147 EarthGo B April 25, 2026, 4:02 p.m. OK PyPy 3 TESTS 10 562 15257600
372532191 hugoback01 B April 25, 2026, 6:14 p.m. OK PyPy 3-64 TESTS 10 140 21299200
372537416 baistangz B April 25, 2026, 7:05 p.m. OK PyPy 3-64 TESTS 10 156 16691200
372544390 SeraNhym_K_huh B April 25, 2026, 8:36 p.m. OK PyPy 3-64 TESTS 10 156 19148800
372519821 Petrusenko B April 25, 2026, 4:37 p.m. OK PyPy 3-64 TESTS 10 156 20889600
372567511 explainer B April 26, 2026, 4:27 a.m. OK PyPy 3-64 TESTS 10 171 22425600
372571608 vinitgandhi B April 26, 2026, 5:36 a.m. OK PyPy 3-64 TESTS 10 171 23654400
372544706 MoltenMan6 B April 25, 2026, 8:41 p.m. OK PyPy 3-64 TESTS 10 187 16486400
372565670 siuhou B April 26, 2026, 3:52 a.m. OK PyPy 3-64 TESTS 10 187 16588800
372545960 Durgesh_Bot B April 25, 2026, 8:59 p.m. OK PyPy 3-64 TESTS 10 187 26521600
372511123 Prithvi_Dewangan B April 25, 2026, 4:06 p.m. OK PyPy 3-64 TESTS 10 203 22220800
372525031 varshithasira B April 25, 2026, 4:58 p.m. OK Python 3 TESTS 10 109 15052800
372511686 hanxingzi862 B April 25, 2026, 4:07 p.m. OK Python 3 TESTS 10 125 16281600
372519528 DarkWeB10 B April 25, 2026, 4:36 p.m. OK Python 3 TESTS 10 125 16384000
372522794 ivisan591 B April 25, 2026, 4:49 p.m. OK Python 3 TESTS 10 125 17408000
372511229 chbhuvan12 B April 25, 2026, 4:06 p.m. OK Python 3 TESTS 10 125 21196800
372570499 huynhkienkhai234 B April 26, 2026, 5:21 a.m. OK Python 3 TESTS 10 140 15155200
372507997 M0USE B April 25, 2026, 3:55 p.m. OK Python 3 TESTS 10 140 15974400
372515091 wickedv B April 25, 2026, 4:19 p.m. OK Python 3 TESTS 10 140 17408000
372510788 Hanyun B April 25, 2026, 4:04 p.m. OK Python 3 TESTS 10 140 23859200
372507744 Synthexia B April 25, 2026, 3:55 p.m. OK Python 3 TESTS 10 140 30208000
372516586 caffeine2ac B April 25, 2026, 4:25 p.m. OK Ruby 3 TESTS 10 484 2048000
372517667 SaucyFries69 B April 25, 2026, 4:29 p.m. OK Rust 2024 TESTS 10 46 204800
372524496 Cyros B April 25, 2026, 4:56 p.m. OK Scala TESTS 10 890 10035200

remove filters

Back to search problems