Codeforces Round 1044 (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
2133 Codeforces Round 1044 (Div. 2) FINISHED False 7200 20359523 Aug. 24, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 12716 ) C The Nether PROGRAMMING graphs interactive

This is an interactive problem. Having recently discovered The Nether, Steve has built a network of (n) nether portals, each at a different location in his world. Each portal is connected in one direction to some number (possibly zero) of other portals. To avoid getting lost, Steve has carefully built the network of portals so that there is no sequence of jumps through portals that will bring you from a location back to itself; formally, the network forms a directed acyclic graph. Steve refuses to tell you which portals are connected to which, but he will allow you to ask queries. In each query, you give Steve a set of locations (S = \{s_1, s_2, \ldots, s_k\}) and a starting location (x \in S). Steve will figure out the longest path starting at (x) that only passes through locations in (S) and tell you the number of locations in it. (If it is impossible to reach any other location in (S) from (x), Steve will reply with (1).) As you are looking to obtain the achievement "Hot Tourist Destinations", you want to find any path that visits as many locations as possible. Steve is feeling particularly generous and will give you (2 \cdot n) queries to find it. Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 1000)). The description of the test cases follows. The only line of each test case contains a single integer (n) ((2 \le n \le 500)) — the number of locations. It is guaranteed that the sum of (n^3) over all test cases does not exceed (500^3). The interaction for each test case begins with reading the integer (n). Then you can make up to (2 \cdot n) queries. To make a query, output a line in the following format: (?\,\,x\,\,k\,\,s_1\,s_2\,\ldots\,s_k) The jury will return the answer to the query. When you find a path with maximum length, output a single line in the following format: $$$!\,\,k\,\,v_1\,v_2\,\ldots\,v_

Tutorials

Codeforces Round 1044 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
335429305 Equinox_Ya C Aug. 25, 2025, 12:47 a.m. OK C# 13 TESTS 12 765 8908800
335396835 IAmYourPop C Aug. 24, 2025, 4:33 p.m. OK C# 13 TESTS 12 2858 9728000
335441480 BOLTCO C Aug. 25, 2025, 4:05 a.m. OK C++17 (GCC 7-32) TESTS 12 359 0
335410075 H4R5H1T-007 C Aug. 24, 2025, 6:37 p.m. OK C++17 (GCC 7-32) TESTS 12 359 0
335412590 VISHVJEET C Aug. 24, 2025, 7:01 p.m. OK C++17 (GCC 7-32) TESTS 12 375 102400
335395874 That1Nooblet C Aug. 24, 2025, 4:31 p.m. OK C++17 (GCC 7-32) TESTS 12 389 0
335394768 QT_IT C Aug. 24, 2025, 4:29 p.m. OK C++17 (GCC 7-32) TESTS 12 389 0
335412126 Deltavinay C Aug. 24, 2025, 6:56 p.m. OK C++17 (GCC 7-32) TESTS 12 390 0
335424159 Lakshya_Sachan C Aug. 24, 2025, 9:59 p.m. OK C++17 (GCC 7-32) TESTS 12 405 0
335422506 Sumit_369 C Aug. 24, 2025, 9:19 p.m. OK C++17 (GCC 7-32) TESTS 12 405 0
335421291 Jayadevgh C Aug. 24, 2025, 8:55 p.m. OK C++17 (GCC 7-32) TESTS 12 405 0
335424194 nniinnaa C Aug. 24, 2025, 10 p.m. OK C++17 (GCC 7-32) TESTS 12 405 102400
335420323 Btech_Griever C Aug. 24, 2025, 8:38 p.m. OK C++20 (GCC 13-64) TESTS 12 280 0
335418057 EeZotop C Aug. 24, 2025, 8:06 p.m. OK C++20 (GCC 13-64) TESTS 12 296 0
335439436 huhuixin66 C Aug. 25, 2025, 3:30 a.m. OK C++20 (GCC 13-64) TESTS 12 311 0
335396460 THATS_HOW_LIFE_WORKS C Aug. 24, 2025, 4:32 p.m. OK C++20 (GCC 13-64) TESTS 12 328 0
335446701 Mohd_531 C Aug. 25, 2025, 5:23 a.m. OK C++20 (GCC 13-64) TESTS 12 342 0
335440162 gasbug C Aug. 25, 2025, 3:42 a.m. OK C++20 (GCC 13-64) TESTS 12 343 102400
335431738 redzxx C Aug. 25, 2025, 1:45 a.m. OK C++20 (GCC 13-64) TESTS 12 358 0
335390973 harshithch23 C Aug. 24, 2025, 4:20 p.m. OK C++20 (GCC 13-64) TESTS 12 358 0
335437388 Azhar11 C Aug. 25, 2025, 3:07 a.m. OK C++20 (GCC 13-64) TESTS 12 359 0
335432086 wangzc2024 C Aug. 25, 2025, 1:52 a.m. OK C++20 (GCC 13-64) TESTS 12 359 0
335421707 nfghdftg C Aug. 24, 2025, 9:03 p.m. OK C++23 (GCC 14-64, msys2) TESTS 12 327 0
335414468 harshhcodess C Aug. 24, 2025, 7:20 p.m. OK C++23 (GCC 14-64, msys2) TESTS 12 327 0
335397217 gennadygupta C Aug. 24, 2025, 4:33 p.m. OK C++23 (GCC 14-64, msys2) TESTS 12 358 0
335394901 ppavankumarofficial C Aug. 24, 2025, 4:29 p.m. OK C++23 (GCC 14-64, msys2) TESTS 12 358 0
335390294 Himanshu.K C Aug. 24, 2025, 4:18 p.m. OK C++23 (GCC 14-64, msys2) TESTS 12 358 0
335429926 Hoang_Thien_De C Aug. 25, 2025, 1:05 a.m. OK C++23 (GCC 14-64, msys2) TESTS 12 358 102400
335396928 NeeleshK C Aug. 24, 2025, 4:33 p.m. OK C++23 (GCC 14-64, msys2) TESTS 12 358 102400
335442415 dear_sixi C Aug. 25, 2025, 4:21 a.m. OK C++23 (GCC 14-64, msys2) TESTS 12 359 0
335425280 NegativeFour C Aug. 24, 2025, 10:30 p.m. OK C++23 (GCC 14-64, msys2) TESTS 12 359 0
335414118 denischalov C Aug. 24, 2025, 7:16 p.m. OK C++23 (GCC 14-64, msys2) TESTS 12 359 0
335435154 LambdaIsAllUNeed C Aug. 25, 2025, 2:37 a.m. OK Haskell TESTS 12 1624 0
335441910 LordKRiS C Aug. 25, 2025, 4:12 a.m. OK Java 21 TESTS 12 1171 716800
335444648 iamabhi1373 C Aug. 25, 2025, 4:55 a.m. OK Java 21 TESTS 12 1202 716800
335441820 NpHardcore_05 C Aug. 25, 2025, 4:10 a.m. OK Java 21 TESTS 12 1202 1126400
335393198 rizzzii C Aug. 24, 2025, 4:25 p.m. OK Java 21 TESTS 12 1202 1228800
335388833 Infinityy08 C Aug. 24, 2025, 4:15 p.m. OK Java 21 TESTS 12 1421 1536000
335404533 raghavendravelpugonda8 C Aug. 24, 2025, 5:55 p.m. OK Java 21 TESTS 12 1530 921600
335440588 sagbis C Aug. 25, 2025, 3:49 a.m. OK Java 21 TESTS 12 1546 2150400
335404597 Nishant_sh C Aug. 24, 2025, 5:55 p.m. OK Java 21 TESTS 12 1561 3276800
335395414 sachin_214 C Aug. 24, 2025, 4:30 p.m. OK Java 21 TESTS 12 1577 2150400
335394214 the_unseen C Aug. 24, 2025, 4:27 p.m. OK Java 21 TESTS 12 1577 2457600
335445861 singha0391 C Aug. 25, 2025, 5:12 a.m. OK Java 8 TESTS 12 1281 0
335439180 Purav_Shah07 C Aug. 25, 2025, 3:26 a.m. OK Java 8 TESTS 12 1452 0
335410136 jatin310 C Aug. 24, 2025, 6:37 p.m. OK Java 8 TESTS 12 1530 0
335389275 tejas_5 C Aug. 24, 2025, 4:16 p.m. OK Java 8 TESTS 12 1561 0
335411184 nick_ninja C Aug. 24, 2025, 6:47 p.m. OK Java 8 TESTS 12 1593 0
335407394 dhruvil_8803 C Aug. 24, 2025, 6:15 p.m. OK Java 8 TESTS 12 1609 0
335407129 dhruvil_8803 C Aug. 24, 2025, 6:13 p.m. OK Java 8 TESTS 12 1749 307200
335393645 suri_rdy1004 C Aug. 24, 2025, 4:26 p.m. OK Kotlin 1.7 TESTS 12 2937 50688000
335420503 L-S-S C Aug. 24, 2025, 8:41 p.m. OK Kotlin 1.9 TESTS 12 905 409600
335423634 Mr.Yassin C Aug. 24, 2025, 9:47 p.m. OK Node.js TESTS 12 2311 4198400
335414149 Mr.Yassin C Aug. 24, 2025, 7:17 p.m. OK Node.js TESTS 12 2499 5427200
335425327 kac3pro C Aug. 24, 2025, 10:32 p.m. OK OCaml TESTS 12 890 921600
335424470 kac3pro C Aug. 24, 2025, 10:07 p.m. OK OCaml TESTS 12 967 819200
335389996 kaedeeeee C Aug. 24, 2025, 4:17 p.m. OK PyPy 3 TESTS 12 2124 9113600
335418459 gursimarsinghmiglani C Aug. 24, 2025, 8:11 p.m. OK PyPy 3 TESTS 12 2155 9625600
335420724 RonnieChen C Aug. 24, 2025, 8:45 p.m. OK PyPy 3 TESTS 12 2218 9625600
335392254 medbouchekoua3 C Aug. 24, 2025, 4:23 p.m. OK PyPy 3 TESTS 12 2468 9728000
335406998 haseeb_adnaan C Aug. 24, 2025, 6:12 p.m. OK PyPy 3 TESTS 12 2484 9728000
335397594 sathvik_67 C Aug. 24, 2025, 4:34 p.m. OK PyPy 3 TESTS 12 2937 10240000
335423651 gardengnome C Aug. 24, 2025, 9:47 p.m. OK PyPy 3-64 TESTS 12 1046 8601600
335419605 czjnbb C Aug. 24, 2025, 8:27 p.m. OK PyPy 3-64 TESTS 12 1046 9318400
335393617 karthikbolla_1 C Aug. 24, 2025, 4:26 p.m. OK PyPy 3-64 TESTS 12 1077 8499200
335431910 voterak C Aug. 25, 2025, 1:48 a.m. OK PyPy 3-64 TESTS 12 1078 8806400
335418085 kidus72 C Aug. 24, 2025, 8:06 p.m. OK PyPy 3-64 TESTS 12 1093 8704000
335418056 kylianm7 C Aug. 24, 2025, 8:06 p.m. OK PyPy 3-64 TESTS 12 1093 8704000
335441370 skyoceanland C Aug. 25, 2025, 4:03 a.m. OK PyPy 3-64 TESTS 12 1124 9011200
335397979 codingkarlijiye C Aug. 24, 2025, 4:34 p.m. OK PyPy 3-64 TESTS 12 1139 9011200
335448656 Ayushman_123 C Aug. 25, 2025, 5:49 a.m. OK PyPy 3-64 TESTS 12 1140 9932800
335393545 bhaskar_aa45 C Aug. 24, 2025, 4:26 p.m. OK PyPy 3-64 TESTS 12 1155 7475200
335392360 Xyanxia C Aug. 24, 2025, 4:23 p.m. OK Python 3 TESTS 12 906 307200
335443947 rish01 C Aug. 25, 2025, 4:44 a.m. OK Python 3 TESTS 12 937 307200
335393419 sabuj292 C Aug. 24, 2025, 4:26 p.m. OK Python 3 TESTS 12 1093 512000
335392789 suchith_83 C Aug. 24, 2025, 4:24 p.m. OK Python 3 TESTS 12 1124 409600
335439579 Zero.2 C Aug. 25, 2025, 3:33 a.m. OK Python 3 TESTS 12 1171 512000
335426766 LiuLiaoyi C Aug. 24, 2025, 11:21 p.m. OK Python 3 TESTS 12 1171 512000
335395825 Harikaran14 C Aug. 24, 2025, 4:31 p.m. OK Python 3 TESTS 12 1233 716800
335394449 dpaladiyaa C Aug. 24, 2025, 4:28 p.m. OK Python 3 TESTS 12 1234 614400
335389922 sayam241020 C Aug. 24, 2025, 4:17 p.m. OK Python 3 TESTS 12 1249 614400
335395138 0l1v3r C Aug. 24, 2025, 4:29 p.m. OK Python 3 TESTS 12 1312 512000
335443792 Ckiddo C Aug. 25, 2025, 4:42 a.m. OK Rust 2021 TESTS 12 640 0
335420640 pohzipohzi C Aug. 24, 2025, 8:43 p.m. OK Rust 2024 TESTS 12 796 0
335396509 pohzipohzi C Aug. 24, 2025, 4:32 p.m. OK Rust 2024 TESTS 12 812 0
335420786 pohzipohzi C Aug. 24, 2025, 8:46 p.m. OK Rust 2024 TESTS 12 827 0
335395074 neulfox C Aug. 24, 2025, 4:29 p.m. OK Rust 2024 TESTS 12 1156 102400

remove filters

Back to search problems