Spectral::Cup 2026 Round 3 (Codeforces Round 1110, 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
2245 Spectral::Cup 2026 Round 3 (Codeforces Round 1110, Div. 1 + Div. 2) FINISHED False 9000 2387684 July 16, 2026, 2:45 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 121 ) G NPC Challenge PROGRAMMING divide and conquer interactive

This is an interactive problem. There is a hidden undirected tree consisting of (n) vertices. To find this tree, you may ask queries of the following form: Pick a sequence of distinct vertices (a_1, a_2, \ldots, a_k), where (k \ge 1). The interactor will process your sequence and return a subset of these vertices, denoted by (S). The set (S) is generated by the following process: Initially, (S) is an empty set. The interactor processes the vertices in the exact order they appear in your sequence, from (a_1) to (a_k). For each (a_i), if (a_i) does not share an edge with any vertex that is currently in (S), then (a_i) is added to (S). Otherwise, (a_i) is ignored. After processing all (k) vertices, the interactor returns the final set (S) to you. (S) is represented by a binary string (s) of length (k), where (s_i=1) if and only if (a_i \in S). Your task is to find all (n-1) edges of the hidden tree. To make the problem harder, the sum of (k) over all queries must not exceed (30 \cdot n). 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 an integer (n) ((2 \le n \le 10^3)), representing the number of vertices in the hidden tree. It is guaranteed that the sum of (n) over all test cases does not exceed (10^3). To make a query, output a line in the following format: (\mathtt{?}\;k\;a_1\;a_2\;\ldots\;a_k) ((1 \le k \le n), (1 \le a_i \le n), (a_i \ne a_j) for all (1 \le i \lt j \le k)) As a response to the query, you will receive a binary string of length (k), representing (S). To report the answer, first output (\mathtt{!}) on a single line. Then, output (n-1) lines, where the (i)-th line contains two integers (u_i) and (v_i), representing an

Tutorials

Spectral::Cup 2026 Round 3 (Codeforces Round 1110, 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
383028654 aslam_45 G July 16, 2026, 7:09 p.m. OK C++17 (GCC 7-32) TESTS 39 31 102400
383058244 sunyata258 G July 17, 2026, 3:07 a.m. OK C++17 (GCC 7-32) TESTS 39 46 102400
383020350 Hastorius G July 16, 2026, 5:55 p.m. OK C++17 (GCC 7-32) TESTS 39 62 102400
383011977 Brock77 G July 16, 2026, 5:05 p.m. OK C++17 (GCC 7-32) TESTS 39 62 102400
383010281 Um_nik G July 16, 2026, 4:59 p.m. OK C++17 (GCC 7-32) TESTS 39 62 1126400
383014073 oceeff G July 16, 2026, 5:12 p.m. OK C++17 (GCC 7-32) TESTS 39 62 2150400
383060236 akshatbhutra G July 17, 2026, 3:34 a.m. OK C++20 (GCC 13-64) TESTS 39 46 102400
383033758 Suwan G July 16, 2026, 7:59 p.m. OK C++20 (GCC 13-64) TESTS 39 46 102400
383014346 EnuTieTie G July 16, 2026, 5:13 p.m. OK C++20 (GCC 13-64) TESTS 39 46 102400
383009127 QZJ114514 G July 16, 2026, 4:55 p.m. OK C++20 (GCC 13-64) TESTS 39 46 102400
383007494 truongminhduc_beo G July 16, 2026, 4:49 p.m. OK C++20 (GCC 13-64) TESTS 39 46 102400
383066890 dumb_god G July 17, 2026, 5:01 a.m. OK C++20 (GCC 13-64) TESTS 39 62 102400
383021735 Amul2710 G July 16, 2026, 6:07 p.m. OK C++20 (GCC 13-64) TESTS 39 62 102400
383016522 dog_of_Nesraychan G July 16, 2026, 5:27 p.m. OK C++20 (GCC 13-64) TESTS 39 62 102400
383026999 ponjuice G July 16, 2026, 6:54 p.m. OK C++23 (GCC 14-64, msys2) TESTS 39 31 102400
383011744 idontwannadothisanymore G July 16, 2026, 5:04 p.m. OK C++23 (GCC 14-64, msys2) TESTS 39 46 0
383007523 hodza G July 16, 2026, 4:50 p.m. OK C++23 (GCC 14-64, msys2) TESTS 39 46 0
383067849 molongdadi G July 17, 2026, 5:14 a.m. OK C++23 (GCC 14-64, msys2) TESTS 39 46 102400
383047766 Edu175 G July 16, 2026, 11:33 p.m. OK C++23 (GCC 14-64, msys2) TESTS 39 46 102400
383047416 Edu175 G July 16, 2026, 11:24 p.m. OK C++23 (GCC 14-64, msys2) TESTS 39 46 102400
383023965 BurnedChicken G July 16, 2026, 6:25 p.m. OK C++23 (GCC 14-64, msys2) TESTS 39 46 102400
383017709 zlxFTH G July 16, 2026, 5:35 p.m. OK C++23 (GCC 14-64, msys2) TESTS 39 46 102400
383013984 tarachandjakhar G July 16, 2026, 5:12 p.m. OK C++23 (GCC 14-64, msys2) TESTS 39 46 102400
383013851 maspy G July 16, 2026, 5:11 p.m. OK C++23 (GCC 14-64, msys2) TESTS 39 46 102400
383011364 blueberryishere G July 16, 2026, 5:03 p.m. OK Java 21 TESTS 39 234 921600
383055894 edmondium2 G July 17, 2026, 2:30 a.m. OK Java 21 TESTS 39 421 1536000
383016519 d11maan G July 16, 2026, 5:27 p.m. OK Rust 2024 TESTS 39 46 0

remove filters

Back to search problems