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
( 14863 ) B Absolute Cinema PROGRAMMING greedy math

You find yourself with two arrays of positive integers (a) and (b), both of length (n). You are to perform the following operation any number of times: select an integer (i) ((1 \le i \le n)) and swap (a_i) and (b_i). Determine the maximum value of (\max(a) + \sum^{n}_{i = 1}{b_i}) attainable if you perform the operations 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 testcase contains an integer (n) ((1 \le n \le 10^5)) — the length of the arrays (a) and (b). The second line of each testcase contains (n) integers (a_1,a_2,\ldots,a_{n}) ((1 \le a_i \le 10^9)). The third line of each testcase contains (n) integers (b_1,b_2,\ldots,b_{n}) ((1 \le b_i \le 10^9)). It is guaranteed that the sum of (n) over all test cases does not exceed (10^5). For each testcase, output the maximum value of (\max(a) + \sum^{n}_{i = 1}{b_i}) attainable. Test Case 3: No swaps are required, so the answer is (\max(1, 2, 3) + 4 + 5 + 6 = 3 + 15 = 18), it can be proven that this is optimal. Test Case 4: You can achieve the maximum by swapping indices (1), (3) and (4). So we get: (a = 1, 3, 5, 8) (b = 2, 4, 6, 7)

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
375833568 linyaoyang B May 23, 2026, 4:27 p.m. OK C++17 (GCC 7-32) TESTS 9 46 0
375831599 ArturSN B May 23, 2026, 4:20 p.m. OK C++17 (GCC 7-32) TESTS 9 46 0
375893216 Safyyyyyy B May 24, 2026, 6:05 a.m. OK C++17 (GCC 7-32) TESTS 9 62 0
375890348 Phantom_Black B May 24, 2026, 5:27 a.m. OK C++17 (GCC 7-32) TESTS 9 62 0
375889638 mohit_iitp02 B May 24, 2026, 5:17 a.m. OK C++17 (GCC 7-32) TESTS 9 62 0
375888125 clarkwayne B May 24, 2026, 4:55 a.m. OK C++17 (GCC 7-32) TESTS 9 62 0
375885808 vinayasri_08 B May 24, 2026, 4:14 a.m. OK C++17 (GCC 7-32) TESTS 9 62 0
375885269 prachishandilya B May 24, 2026, 4:05 a.m. OK C++17 (GCC 7-32) TESTS 9 62 0
375881573 elmeromerocaguamero B May 24, 2026, 2:43 a.m. OK C++17 (GCC 7-32) TESTS 9 62 0
375880962 A_K_0_7 B May 24, 2026, 2:29 a.m. OK C++17 (GCC 7-32) TESTS 9 62 0

remove filters

Back to search problems