Spectral::Cup 2026 Round 2 (Codeforces Round 1100, 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
2229 Spectral::Cup 2026 Round 2 (Codeforces Round 1100, Div. 1 + Div. 2) FINISHED False 10800 833086 May 23, 2026, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 13000 ) C1 We Be Flipping (Easy Version) PROGRAMMING constructive algorithms

This is the easy version of the problem. The difference between the versions is that in this version, you must minimise the sum. You can hack only if you solved all versions of this problem. You have an array (a) of length (n) which consists of non-zero (but possibly negative) integers. You will perform the following operation at most (n) times (possibly none): select an index (i) ((1 \le i \le n)) such that (a_i \gt 0) then for each (j) where (1 \le j \le i) do (a_j := -a_j). Output a valid sequence of operations of length at most (n) which (\color{red}{\text{minimises}}) the sum of (a) at the end. 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 testcase contains an integer (n) ((2 \le n \le 2 \cdot 10^5)) — the length of the array (a). The second line of each testcase contains (n) integers (a_1,a_2,\ldots,a_n) ((-10^9 \le a_i \le 10^9, a_i \ne 0)). It is guaranteed that the sum of (n) over all test cases does not exceed (2 \cdot 10^5). For each testcase, output a single integer (k) ((0 \le k \le n)) — the number of operations you will perform. Now output (k) integers (b_1,\ldots,b_k) where (b_i) is the index you perform the (i)th operation on. After performing the operations, the sum of (a) should be minimal. In the first testcase, the sum is already minimised. So no operations are required. In the second testcase, the operations are made as follows: (-1, -2, 3, -5, 4 \xrightarrow{i = 3} \color{red}{1, 2, -3}, -5, 4) (1, 2, -3, -5, 4 \xrightarrow{i = 5} \color{red}{-1, -2, 3, 5, -4}) (-1, -2, 3, 5, -4 \xrightarrow{i = 4} \color{red}{1, 2, -3, -5}, -4) (1, 2, -3, -5, -4 \xrightarrow{i = 2} \color{red}{-1, -2}, -3, -5, -4) This has a sum of (-15), which is the minimum possible

Tutorials

Spectral::Cup 2026 Round 2 (Codeforces Round 1100, 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
375832821 Misha001_10 C1 May 23, 2026, 4:24 p.m. OK C# 13 TESTS 9 93 28262400
375888403 Rhea_29 C1 May 24, 2026, 4:59 a.m. OK C++17 (GCC 7-32) TESTS 9 62 0
375877639 top_olo_g_y C1 May 24, 2026, 12:42 a.m. OK C++17 (GCC 7-32) TESTS 9 62 0
375876739 LovingHusband C1 May 24, 2026, 12:04 a.m. OK C++17 (GCC 7-32) TESTS 9 62 0
375846558 shivam.nathani.2007 C1 May 23, 2026, 5:25 p.m. OK C++17 (GCC 7-32) TESTS 9 62 0
375841845 himadri05 C1 May 23, 2026, 5:03 p.m. OK C++17 (GCC 7-32) TESTS 9 62 0
375840126 DuyK C1 May 23, 2026, 4:54 p.m. OK C++17 (GCC 7-32) TESTS 9 62 0
375832460 Phoenix_reion C1 May 23, 2026, 4:23 p.m. OK C++17 (GCC 7-32) TESTS 9 62 0
375830817 Sushma_Reddy_ C1 May 23, 2026, 4:17 p.m. OK C++17 (GCC 7-32) TESTS 9 62 0
375829029 er1c C1 May 23, 2026, 4:10 p.m. OK C++17 (GCC 7-32) TESTS 9 62 0
375867184 Khaled_Zalama C1 May 23, 2026, 8:27 p.m. OK C++17 (GCC 7-32) TESTS 9 62 102400

remove filters

Back to search problems