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 |
|---|---|---|---|---|---|---|
| 2110 | Codeforces Round 1026 (Div. 2) | FINISHED | False | 7200 | 28308323 | May 24, 2025, 2:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 2658 ) | E | Melody | PROGRAMMING | dfs and similar graphs |
In 2077, the robots that took over the world realized that human music wasn't that great, so they started composing their own. To write music, the robots have a special musical instrument capable of producing (n) different sounds. Each sound is characterized by its volume and pitch. A sequence of sounds is called music. Music is considered beautiful if any two consecutive sounds differ either only in volume or only in pitch. Music is considered boring if the volume or pitch of any three consecutive sounds is the same. You want to compose beautiful , non - boring music that contains each sound produced by your musical instrument exactly once. 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. In the first line of each test case, there is a number (n) ((1 \le n \le 2 \cdot 10^5)) — the number of sounds that the musical instrument can produce. Next, there are (n) lines, where the (i)-th line contains a pair of numbers (v_i, p_i) ((1 \le v_i,\space p_i \le 10^9)) — the volume and pitch of the (i)-th sound, respectively. It is guaranteed that among all (n) sounds, there are no duplicates, meaning for any (i \neq j), at least one of the conditions (v_i \neq v_j) or (p_i \neq p_j) holds. The sum of (n) across all test cases does not exceed (2 \cdot 10^5). For each test case, if it is possible to compose such music, output " YES ", and on the next line, output (n) numbers — the indices of the sounds in the order that forms beautiful non-boring music. Otherwise, output " NO ". You may output each letter in any case (lowercase or uppercase). For example, the strings " yEs ", " yes ", " Yes ", and " YES " will be accepted as a positive answer. In the first test case, the music ((239,239)-(239,179)-(179,179)-(179,239)) is suitable, contains all sounds, and all consecutive sounds differ either |
| Codeforces Round 1026 (Div. 2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 321161614 | TEoS | E | May 24, 2025, 7:16 p.m. | OK | C++17 (GCC 7-32) | TESTS | 44 | 265 | 16281600 | ||
| 321160805 | EatOrSleep | E | May 24, 2025, 7:07 p.m. | OK | C++17 (GCC 7-32) | TESTS | 44 | 327 | 16281600 | ||
| 321149416 | leela_0 | E | May 24, 2025, 5:32 p.m. | OK | C++17 (GCC 7-32) | TESTS | 44 | 343 | 22528000 | ||
| 321165321 | HuaZhaoBi | E | May 24, 2025, 7:58 p.m. | OK | C++17 (GCC 7-32) | TESTS | 44 | 343 | 25702400 | ||
| 321149242 | zhoubiao | E | May 24, 2025, 5:31 p.m. | OK | C++17 (GCC 7-32) | TESTS | 44 | 358 | 33996800 | ||
| 321197563 | 8Conan8 | E | May 25, 2025, 5:32 a.m. | OK | C++17 (GCC 7-32) | TESTS | 44 | 359 | 37990400 | ||
| 321161906 | Pooda | E | May 24, 2025, 7:19 p.m. | OK | C++17 (GCC 7-32) | TESTS | 44 | 389 | 27238400 | ||
| 321140014 | Ahmed_Ashraf_f | E | May 24, 2025, 4:28 p.m. | OK | C++17 (GCC 7-32) | TESTS | 44 | 390 | 20582400 | ||
| 321141243 | AiPd | E | May 24, 2025, 4:30 p.m. | OK | C++17 (GCC 7-32) | TESTS | 44 | 405 | 15769600 | ||
| 321140497 | aztecK1810 | E | May 24, 2025, 4:29 p.m. | OK | C++17 (GCC 7-32) | TESTS | 44 | 405 | 16281600 | ||
| 321150192 | beta99999 | E | May 24, 2025, 5:37 p.m. | OK | C++20 (GCC 13-64) | TESTS | 44 | 187 | 32460800 | ||
| 321149551 | beta99999 | E | May 24, 2025, 5:33 p.m. | OK | C++20 (GCC 13-64) | TESTS | 44 | 187 | 33587200 | ||
| 321190337 | nandhagk1729 | E | May 25, 2025, 3:59 a.m. | OK | C++20 (GCC 13-64) | TESTS | 44 | 249 | 50176000 | ||
| 321164112 | NotFound | E | May 24, 2025, 7:43 p.m. | OK | C++20 (GCC 13-64) | TESTS | 44 | 312 | 16384000 | ||
| 321162557 | HusseinFarhat | E | May 24, 2025, 7:26 p.m. | OK | C++20 (GCC 13-64) | TESTS | 44 | 312 | 26726400 | ||
| 321169942 | M7mdKady14 | E | May 24, 2025, 9:13 p.m. | OK | C++20 (GCC 13-64) | TESTS | 44 | 327 | 16793600 | ||
| 321150733 | NifeKKeen | E | May 24, 2025, 5:41 p.m. | OK | C++20 (GCC 13-64) | TESTS | 44 | 327 | 22732800 | ||
| 321166940 | The_Sambhav | E | May 24, 2025, 8:20 p.m. | OK | C++20 (GCC 13-64) | TESTS | 44 | 327 | 40857600 | ||
| 321173672 | lockedlock | E | May 24, 2025, 11:01 p.m. | OK | C++20 (GCC 13-64) | TESTS | 44 | 328 | 32256000 | ||
| 321154632 | cyNix06 | E | May 24, 2025, 6:10 p.m. | OK | C++20 (GCC 13-64) | TESTS | 44 | 342 | 19968000 | ||
| 321186321 | liugh | E | May 25, 2025, 2:52 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 44 | 264 | 29900800 | ||
| 321138329 | Anoth3r | E | May 24, 2025, 4:25 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 44 | 265 | 19046400 | ||
| 321171974 | Zegg_Bash | E | May 24, 2025, 10:03 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 44 | 311 | 26316800 | ||
| 321137953 | SiriYuri | E | May 24, 2025, 4:25 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 44 | 327 | 19558400 | ||
| 321144023 | Saideepaksana | E | May 24, 2025, 4:34 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 44 | 327 | 20889600 | ||
| 321159688 | A_G | E | May 24, 2025, 6:55 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 44 | 327 | 20992000 | ||
| 321141134 | volochai | E | May 24, 2025, 4:30 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 44 | 327 | 23449600 | ||
| 321169516 | bangan | E | May 24, 2025, 9:04 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 44 | 327 | 52633600 | ||
| 321142714 | DuongForeverAlone | E | May 24, 2025, 4:32 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 44 | 328 | 19148800 | ||
| 321142984 | hanifchdn | E | May 24, 2025, 4:33 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 44 | 328 | 22937600 | ||
| 321143294 | FXLY_awa | E | May 24, 2025, 4:33 p.m. | OK | Java 21 | TESTS | 44 | 983 | 115302400 | ||
| 321139793 | code_breaker_1 | E | May 24, 2025, 4:28 p.m. | OK | Java 21 | TESTS | 44 | 1233 | 87756800 | ||
| 321142964 | shubhyadav4838 | E | May 24, 2025, 4:33 p.m. | OK | Java 21 | TESTS | 44 | 1968 | 83148800 | ||
| 321139455 | mehul_agarwal | E | May 24, 2025, 4:27 p.m. | OK | Java 21 | TESTS | 44 | 1983 | 162304000 | ||
| 321153132 | MarcAS | E | May 24, 2025, 5:58 p.m. | OK | Java 8 | TESTS | 44 | 1984 | 81100800 | ||
| 321165311 | MarcAS | E | May 24, 2025, 7:58 p.m. | OK | Java 8 | TESTS | 44 | 1984 | 82124800 | ||
| 321151447 | jgs03177 | E | May 24, 2025, 5:46 p.m. | OK | PyPy 3-64 | TESTS | 44 | 765 | 92467200 | ||
| 321162103 | x3mka | E | May 24, 2025, 7:21 p.m. | OK | PyPy 3-64 | TESTS | 44 | 937 | 113356800 | ||
| 321183978 | rank007 | E | May 25, 2025, 2:03 a.m. | OK | PyPy 3-64 | TESTS | 44 | 1014 | 126566400 | ||
| 321140784 | VulcanForge | E | May 24, 2025, 4:29 p.m. | OK | PyPy 3-64 | TESTS | 44 | 1093 | 112742400 | ||
| 321147452 | Niazye | E | May 24, 2025, 5:21 p.m. | OK | PyPy 3-64 | TESTS | 44 | 1124 | 134553600 | ||
| 321197982 | _Cobalt_ | E | May 25, 2025, 5:36 a.m. | OK | PyPy 3-64 | TESTS | 44 | 1140 | 145305600 | ||
| 321190152 | shi_logic | E | May 25, 2025, 3:56 a.m. | OK | PyPy 3-64 | TESTS | 44 | 1311 | 118374400 | ||
| 321137938 | LoraLeggett | E | May 24, 2025, 4:25 p.m. | OK | PyPy 3-64 | TESTS | 44 | 1312 | 129945600 | ||
| 321142974 | ppmishra2411 | E | May 24, 2025, 4:33 p.m. | OK | PyPy 3-64 | TESTS | 44 | 1593 | 100864000 | ||
| 321166291 | hodor12 | E | May 24, 2025, 8:12 p.m. | OK | Rust 2021 | TESTS | 44 | 342 | 49459200 | ||
| 321138754 | ArthurVickrey | E | May 24, 2025, 4:26 p.m. | OK | Rust 2021 | TESTS | 44 | 421 | 64921600 |
Back to search problems