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
( 4274 ) D Me When Median Problem PROGRAMMING binary search greedy

You are given two arrays of positive integers (a) and (b), both of length (n). You will perform the following operation exactly (n - 1) times: let (m) be the current length of (a) and (b), note that the lengths will always be equal. select an integer (i) ((1 \le i \lt m)): let (S) be the multiset (\{a_i, a_{i + 1}, b_i, b_{i + 1}\}) sort the elements of (S) such that (s_1 \le s_2 \le s_3 \le s_4). now replace (a_i, a_{i + 1}) with (s_2) and (b_i, b_{i + 1}) with (s_3). More formally, replace (a) with (a_1,a_2,\ldots,a_{i - 1},s_2,a_{i + 2},\ldots,a_m), and replace (b) with (b_1,b_2,\ldots,b_{i - 1},s_3,b_{i + 2},\ldots,b_m). let (S) be the multiset (\{a_i, a_{i + 1}, b_i, b_{i + 1}\}) sort the elements of (S) such that (s_1 \le s_2 \le s_3 \le s_4). now replace (a_i, a_{i + 1}) with (s_2) and (b_i, b_{i + 1}) with (s_3). More formally, replace (a) with (a_1,a_2,\ldots,a_{i - 1},s_2,a_{i + 2},\ldots,a_m), and replace (b) with (b_1,b_2,\ldots,b_{i - 1},s_3,b_{i + 2},\ldots,b_m). After performing all operations, there will be exactly (1) element remaining in both (a) and (b). Determine the maximum value of (\min(a_1, b_1)) attainable if you perform 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 2 \cdot n)). The third line of each testcase contains (n) integers (b_1,b_2,\ldots,b_{n}) ((1 \le b_i \le 2 \cdot n)). It is guaranteed that the sum of (n) over all test cases does not exceed (10^5). For each testcase, outp

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
375888184 winbow13 D May 24, 2026, 4:56 a.m. OK C++17 (GCC 7-32) TESTS 16 62 0
375859082 cry4u D May 23, 2026, 7:03 p.m. OK C++17 (GCC 7-32) TESTS 16 62 0
375848541 shubham2277 D May 23, 2026, 5:33 p.m. OK C++17 (GCC 7-32) TESTS 16 62 0
375846523 Shashwat-11 D May 23, 2026, 5:25 p.m. OK C++17 (GCC 7-32) TESTS 16 62 0
375831976 devansh_s D May 23, 2026, 4:21 p.m. OK C++17 (GCC 7-32) TESTS 16 62 0
375828843 seyam007 D May 23, 2026, 4:10 p.m. OK C++17 (GCC 7-32) TESTS 16 62 0
375860299 SliceOfCake1538 D May 23, 2026, 7:15 p.m. OK C++17 (GCC 7-32) TESTS 16 62 102400
375847758 miracledj100 D May 23, 2026, 5:30 p.m. OK C++17 (GCC 7-32) TESTS 16 62 102400
375847402 HASAN_49 D May 23, 2026, 5:29 p.m. OK C++17 (GCC 7-32) TESTS 16 62 102400
375846188 lavendertown3110 D May 23, 2026, 5:23 p.m. OK C++17 (GCC 7-32) TESTS 16 62 102400

remove filters

Back to search problems