Codeforces Round 1079 (Div. 1)

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
2196 Codeforces Round 1079 (Div. 1) FINISHED False 10800 5585123 Feb. 11, 2026, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 3535 ) C1 Interactive Graph (Simple Version) PROGRAMMING combinatorics dfs and similar dp graphs interactive

This is the simple version of the problem. The difference between the versions is that in this version, you can ask no more than (32 \cdot (n + m)) questions, and (n \leq 15). You can hack only if you solved all versions of this problem. This is an interactive problem. The jury has thought of a directed acyclic graph without loops and multiple edges, which has (n) vertices and (m) edges. Your task is to determine which edges are in this graph. To do this, you can ask questions of the form: what does the (k)-th path look like in the lexicographically(^{\text{∗}}) sorted list of all paths in the graph. A path in the graph is a sequence of vertices (u_{1}, u_{2}, \dots, u_{l}), such that for any (i \lt l), there exists an edge ((u_{i}, u_{i + 1})) in the graph. Your task is to accomplish this by asking no more than (32 \cdot (n + m)) questions. (^{\text{∗}})A sequence (a) is lexicographically smaller than a sequence (b) if and only if one of the following holds: (a) is a prefix of (b), but (a \ne b); or in the first position where (a) and (b) differ, the sequence (a) has a smaller element than the corresponding element in (b). Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 10)). The description of the test cases follows. Each test case consists of a single line with an integer (n) ((1 \le n \le 15)) — the number of vertices in the graph. The jury guarantees that the given graph does not contain cycles or multiple edges. Note that (m) is unknown to you. The interaction for each test case begins with reading the integer (n). Then you can ask up to (32 \cdot (n + m)) questions. To ask a question, output a string in the format " ? k " (without quotes) ((1 \le k \le 2^{30})). After each question, read an integer (q) — the number of vertices in the (k)-th path. If (q = 0), then such a

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
362460840 -firefly- C1 Feb. 11, 2026, 3:29 p.m. OK C# 13 TESTS 29 93 13004800
362576473 binaryDream C1 Feb. 12, 2026, 5:29 a.m. OK C++17 (GCC 7-32) TESTS 29 31 102400
362571161 deefpried C1 Feb. 12, 2026, 4:21 a.m. OK C++17 (GCC 7-32) TESTS 29 31 102400
362548198 BlueMoon. C1 Feb. 11, 2026, 8:41 p.m. OK C++17 (GCC 7-32) TESTS 29 31 102400
362437215 potato167 C1 Feb. 11, 2026, 3 p.m. OK C++17 (GCC 7-32) TESTS 29 31 102400
362470937 unordered_map C1 Feb. 11, 2026, 3:44 p.m. OK C++17 (GCC 7-32) TESTS 29 31 3276800
362494110 clarinha C1 Feb. 11, 2026, 4:24 p.m. OK C++17 (GCC 7-32) TESTS 29 46 0
362575167 DonGosar C1 Feb. 12, 2026, 5:14 a.m. OK C++17 (GCC 7-32) TESTS 29 46 102400
362569838 AdiRish C1 Feb. 12, 2026, 4:04 a.m. OK C++17 (GCC 7-32) TESTS 29 46 102400
362566225 jiawenzhuo C1 Feb. 12, 2026, 3:14 a.m. OK C++17 (GCC 7-32) TESTS 29 46 102400
362520007 knightL C1 Feb. 11, 2026, 5:17 p.m. OK C++17 (GCC 7-32) TESTS 29 46 102400
362516789 cho57020 C1 Feb. 11, 2026, 5:11 p.m. OK C++20 (GCC 13-64) TESTS 29 31 102400
362502976 iluem100 C1 Feb. 11, 2026, 4:41 p.m. OK C++20 (GCC 13-64) TESTS 29 31 102400
362493173 anotherworld C1 Feb. 11, 2026, 4:22 p.m. OK C++20 (GCC 13-64) TESTS 29 31 102400
362484139 Kude C1 Feb. 11, 2026, 4:06 p.m. OK C++20 (GCC 13-64) TESTS 29 31 102400
362483680 KIRIJIJI C1 Feb. 11, 2026, 4:05 p.m. OK C++20 (GCC 13-64) TESTS 29 31 102400
362483402 Final_Track C1 Feb. 11, 2026, 4:04 p.m. OK C++20 (GCC 13-64) TESTS 29 31 102400
362478459 OdtreeKing C1 Feb. 11, 2026, 3:56 p.m. OK C++20 (GCC 13-64) TESTS 29 31 102400
362462088 pooty C1 Feb. 11, 2026, 3:31 p.m. OK C++20 (GCC 13-64) TESTS 29 31 102400
362438770 makrav C1 Feb. 11, 2026, 3:02 p.m. OK C++20 (GCC 13-64) TESTS 29 31 102400
362560133 WangSiyuan2025 C1 Feb. 12, 2026, 12:57 a.m. OK C++20 (GCC 13-64) TESTS 29 46 0
362501155 AlesL0 C1 Feb. 11, 2026, 4:38 p.m. OK C++23 (GCC 14-64, msys2) TESTS 29 31 0
362486110 Liang_SYEA C1 Feb. 11, 2026, 4:09 p.m. OK C++23 (GCC 14-64, msys2) TESTS 29 31 0
362458825 lzyrapx C1 Feb. 11, 2026, 3:27 p.m. OK C++23 (GCC 14-64, msys2) TESTS 29 31 0
362441448 StelIawinD C1 Feb. 11, 2026, 3:05 p.m. OK C++23 (GCC 14-64, msys2) TESTS 29 31 0
362570440 Ns6Juruo C1 Feb. 12, 2026, 4:10 a.m. OK C++23 (GCC 14-64, msys2) TESTS 29 31 102400
362567622 EduardoBrito C1 Feb. 12, 2026, 3:37 a.m. OK C++23 (GCC 14-64, msys2) TESTS 29 31 102400
362503988 momohara C1 Feb. 11, 2026, 4:43 p.m. OK C++23 (GCC 14-64, msys2) TESTS 29 31 102400
362503558 petamingks C1 Feb. 11, 2026, 4:43 p.m. OK C++23 (GCC 14-64, msys2) TESTS 29 31 102400
362479803 PMiguelez C1 Feb. 11, 2026, 3:58 p.m. OK C++23 (GCC 14-64, msys2) TESTS 29 31 102400
362471006 42i196 C1 Feb. 11, 2026, 3:44 p.m. OK C++23 (GCC 14-64, msys2) TESTS 29 31 102400
362439416 hos.lyric C1 Feb. 11, 2026, 3:03 p.m. OK D TESTS 29 46 0
362470859 Gassa C1 Feb. 11, 2026, 3:44 p.m. OK D TESTS 29 62 102400
362472495 pengin_2000 C1 Feb. 11, 2026, 3:47 p.m. OK GNU C11 TESTS 29 46 8396800
362472724 Ritwin C1 Feb. 11, 2026, 3:47 p.m. OK GNU C11 TESTS 29 78 8396800
362491795 iakovlev.zakhar C1 Feb. 11, 2026, 4:19 p.m. OK Java 21 TESTS 29 281 1331200
362506552 owenytz C1 Feb. 11, 2026, 4:49 p.m. OK Java 21 TESTS 29 312 1536000
362455023 gotexans C1 Feb. 11, 2026, 3:21 p.m. OK Java 8 TESTS 29 406 0
362451782 Tlatoani C1 Feb. 11, 2026, 3:17 p.m. OK Kotlin 2.2 TESTS 29 250 25907200
362522187 Ergodic137 C1 Feb. 11, 2026, 5:22 p.m. OK PyPy 3-64 TESTS 29 109 2150400
362528385 eepsilon C1 Feb. 11, 2026, 5:34 p.m. OK PyPy 3-64 TESTS 29 125 2867200
362466853 teekaytai C1 Feb. 11, 2026, 3:38 p.m. OK PyPy 3-64 TESTS 29 125 2969600
362487372 shade34 C1 Feb. 11, 2026, 4:11 p.m. OK PyPy 3-64 TESTS 29 125 4915200
362443620 literalchild C1 Feb. 11, 2026, 3:07 p.m. OK PyPy 3-64 TESTS 29 140 2969600
362488508 titia C1 Feb. 11, 2026, 4:13 p.m. OK PyPy 3-64 TESTS 29 140 3891200
362471401 Jank C1 Feb. 11, 2026, 3:45 p.m. OK PyPy 3-64 TESTS 29 156 3584000
362483114 SadMachine C1 Feb. 11, 2026, 4:04 p.m. OK PyPy 3-64 TESTS 29 156 5939200
362509078 ThatOnePythonUser C1 Feb. 11, 2026, 4:54 p.m. OK PyPy 3-64 TESTS 29 171 3379200
362478899 gs25010 C1 Feb. 11, 2026, 3:57 p.m. OK PyPy 3-64 TESTS 29 171 5017600
362557637 harsh.bajpaics C1 Feb. 11, 2026, 11:47 p.m. OK Python 3 TESTS 29 156 307200
362469269 Nikrien C1 Feb. 11, 2026, 3:42 p.m. OK Python 3 TESTS 29 171 409600
362461217 sansen C1 Feb. 11, 2026, 3:30 p.m. OK Rust 2021 TESTS 29 62 102400
362456528 Egor C1 Feb. 11, 2026, 3:23 p.m. OK Rust 2024 TESTS 29 31 11776000
362447908 Mon_ster C1 Feb. 11, 2026, 3:12 p.m. OK Rust 2024 TESTS 29 46 0
362486881 darkkcyan C1 Feb. 11, 2026, 4:10 p.m. OK Rust 2024 TESTS 29 46 11776000
362461606 DanielAnker C1 Feb. 11, 2026, 3:30 p.m. OK Rust 2024 TESTS 29 46 11776000

remove filters

Back to search problems