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 |
|---|---|---|---|---|---|---|
| 2029 | Refact.ai Match 1 (Codeforces Round 985) | FINISHED | False | 10800 | 45242723 | Nov. 9, 2024, 2:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 3906 ) | D | Cool Graph | PROGRAMMING | constructive algorithms data structures dfs and similar dsu graphs trees |
You are given an undirected graph with (n) vertices and (m) edges. You can perform the following operation at most (2\cdot \max(n,m)) times: Choose three distinct vertices (a), (b), and (c), then for each of the edges ((a,b)), ((b,c)), and ((c,a)), do the following: If the edge does not exist, add it. On the contrary, if it exists, remove it. If the edge does not exist, add it. On the contrary, if it exists, remove it. A graph is called cool if and only if one of the following holds: The graph has no edges, or The graph is a tree. You have to make the graph cool by performing the above operations. Note that you can use at most (2\cdot \max(n,m)) operations. It can be shown that there always exists at least one solution. Each test contains multiple test cases. The first line of input contains a single integer (t) ((1\le t\le 10^4)) — the number of test cases. The description of test cases follows. The first line of each test case contains two integers (n) and (m) ((3\le n\le 10^5), (0\le m\le \min\left(\frac{n(n-1)}{2},2\cdot 10^5\right))) — the number of vertices and the number of edges. Then (m) lines follow, the (i)-th line contains two integers (u_i) and (v_i) ((1\le u_i,v_i\le n)) — the two nodes that the (i)-th edge connects. It is guaranteed that the sum of (n) over all test cases does not exceed (10^5), and the sum of (m) over all test cases does not exceed (2\cdot 10^5). It is guaranteed that there are no self-loops or multiple-edges in the given graph. For each test case, in the first line output an integer (k) ((0\le k\le 2\cdot \max(n, m))) — the number of operations. Then output (k) lines, the (i)-th line containing three distinct integers (a), (b), and (c) ((1\le a,b,c\le n)) — the three integers you choose in the (i)-th operation. If there are multiple solutions, you can output any of them. In the first t |
| Refact.ai Match 1 (Codeforces Round 985) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 290775480 | og.kostya | D | Nov. 9, 2024, 6:54 p.m. | OK | C# 10 | TESTS | 25 | 437 | 49561600 | ||
| 290759434 | og.kostya | D | Nov. 9, 2024, 5:06 p.m. | OK | C# 10 | TESTS | 24 | 2999 | 47718400 | ||
| 290773414 | StellarSpecter | D | Nov. 9, 2024, 6:35 p.m. | OK | C++17 (GCC 7-32) | TESTS | 24 | 77 | 3276800 | ||
| 290761698 | CP_xam_lon | D | Nov. 9, 2024, 5:15 p.m. | OK | C++17 (GCC 7-32) | TESTS | 24 | 171 | 4812800 | ||
| 290748282 | KKrishnaA | D | Nov. 9, 2024, 4:28 p.m. | OK | C++17 (GCC 7-32) | TESTS | 24 | 171 | 22835200 | ||
| 290788754 | T404 | D | Nov. 9, 2024, 10:01 p.m. | OK | C++17 (GCC 7-32) | TESTS | 25 | 186 | 1843200 | ||
| 290754674 | bili_BD64 | D | Nov. 9, 2024, 4:47 p.m. | OK | C++17 (GCC 7-32) | TESTS | 24 | 187 | 307200 | ||
| 290779171 | sswcdak | D | Nov. 9, 2024, 7:33 p.m. | OK | C++17 (GCC 7-32) | TESTS | 25 | 187 | 5734400 | ||
| 290773087 | seven-mark | D | Nov. 9, 2024, 6:32 p.m. | OK | C++17 (GCC 7-32) | TESTS | 24 | 202 | 2252800 | ||
| 290747983 | flashmt | D | Nov. 9, 2024, 4:27 p.m. | OK | C++17 (GCC 7-32) | TESTS | 24 | 202 | 2662400 | ||
| 290757498 | ZYC1118 | D | Nov. 9, 2024, 4:58 p.m. | OK | C++17 (GCC 7-32) | TESTS | 24 | 202 | 48128000 | ||
| 290810759 | ychangseok | D | Nov. 10, 2024, 5:48 a.m. | OK | C++17 (GCC 7-32) | TESTS | 25 | 203 | 7884800 | ||
| 290773269 | StellarSpecter | D | Nov. 9, 2024, 6:34 p.m. | OK | C++20 (GCC 13-64) | TESTS | 24 | 77 | 4915200 | ||
| 290775350 | ZN-ACE | D | Nov. 9, 2024, 6:53 p.m. | OK | C++20 (GCC 13-64) | TESTS | 25 | 124 | 2867200 | ||
| 290774735 | ZN-ACE | D | Nov. 9, 2024, 6:47 p.m. | OK | C++20 (GCC 13-64) | TESTS | 25 | 125 | 2867200 | ||
| 290811215 | ywc... | D | Nov. 10, 2024, 5:52 a.m. | OK | C++20 (GCC 13-64) | TESTS | 25 | 140 | 2662400 | ||
| 290798134 | ShUO-_-- | D | Nov. 10, 2024, 2:42 a.m. | OK | C++20 (GCC 13-64) | TESTS | 25 | 140 | 3072000 | ||
| 290784875 | zgla755 | D | Nov. 9, 2024, 8:49 p.m. | OK | C++20 (GCC 13-64) | TESTS | 25 | 140 | 3072000 | ||
| 290774565 | ZN-ACE | D | Nov. 9, 2024, 6:46 p.m. | OK | C++20 (GCC 13-64) | TESTS | 25 | 140 | 3379200 | ||
| 290751143 | IcarusII | D | Nov. 9, 2024, 4:39 p.m. | OK | C++20 (GCC 13-64) | TESTS | 24 | 155 | 2867200 | ||
| 290750514 | yuvrajKharayat | D | Nov. 9, 2024, 4:37 p.m. | OK | C++20 (GCC 13-64) | TESTS | 24 | 155 | 8192000 | ||
| 290771228 | Oogway_ | D | Nov. 9, 2024, 6:18 p.m. | OK | C++20 (GCC 13-64) | TESTS | 24 | 156 | 2969600 | ||
| 290773427 | StellarSpecter | D | Nov. 9, 2024, 6:35 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 24 | 77 | 4812800 | ||
| 290798259 | huo_hua_ya | D | Nov. 10, 2024, 2:44 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 25 | 124 | 2560000 | ||
| 290758636 | _Hok | D | Nov. 9, 2024, 5:03 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 24 | 124 | 108646400 | ||
| 290792194 | Huangyf | D | Nov. 9, 2024, 11:50 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 25 | 140 | 2764800 | ||
| 290749985 | abhayg_07 | D | Nov. 9, 2024, 4:35 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 24 | 140 | 10752000 | ||
| 290805644 | LNian | D | Nov. 10, 2024, 4:46 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 25 | 155 | 2764800 | ||
| 290751088 | ItsLastDay | D | Nov. 9, 2024, 4:39 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 24 | 155 | 4198400 | ||
| 290749413 | woohyun_jng | D | Nov. 9, 2024, 4:33 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 24 | 155 | 13824000 | ||
| 290756100 | SilverTongue1729 | D | Nov. 9, 2024, 4:53 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 24 | 156 | 3072000 | ||
| 290753773 | Rinkawaii | D | Nov. 9, 2024, 4:44 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 24 | 156 | 4096000 | ||
| 290793347 | rainboy | D | Nov. 10, 2024, 12:37 a.m. | OK | GNU C11 | TESTS | 25 | 1249 | 17920000 | ||
| 290747833 | CliffordMortimer | D | Nov. 9, 2024, 4:27 p.m. | OK | GNU C11 | TESTS | 24 | 2139 | 14131200 | ||
| 290791457 | Maxi135798642 | D | Nov. 9, 2024, 11:20 p.m. | OK | Go | TESTS | 25 | 187 | 71782400 | ||
| 290771190 | DarLam | D | Nov. 9, 2024, 6:18 p.m. | OK | Java 21 | TESTS | 24 | 577 | 12595200 | ||
| 290758360 | Lilypad | D | Nov. 9, 2024, 5:02 p.m. | OK | Java 21 | TESTS | 24 | 1483 | 59801600 | ||
| 290747445 | SteveDuncan | D | Nov. 9, 2024, 4:25 p.m. | OK | Java 21 | TESTS | 24 | 1608 | 40345600 | ||
| 290753853 | dusty.and.rusty | D | Nov. 9, 2024, 4:44 p.m. | OK | Java 21 | TESTS | 24 | 2531 | 44339200 | ||
| 290801416 | yvbf | D | Nov. 10, 2024, 3:38 a.m. | OK | Java 8 | TESTS | 25 | 358 | 11468800 | ||
| 290763302 | leonlian | D | Nov. 9, 2024, 5:21 p.m. | OK | Java 8 | TESTS | 24 | 1140 | 45260800 | ||
| 290794575 | Yousef_Badr | D | Nov. 10, 2024, 1:15 a.m. | OK | Java 8 | TESTS | 25 | 1311 | 50176000 | ||
| 290780364 | dauletomarov1130 | D | Nov. 9, 2024, 7:47 p.m. | OK | Java 8 | TESTS | 25 | 1968 | 19660800 | ||
| 290765374 | yvbf | D | Nov. 9, 2024, 5:29 p.m. | OK | Java 8 | TESTS | 24 | 1999 | 58675200 | ||
| 290784561 | amelentev | D | Nov. 9, 2024, 8:45 p.m. | OK | Kotlin 1.9 | TESTS | 25 | 1983 | 52326400 | ||
| 290758748 | uday.codeforces | D | Nov. 9, 2024, 5:04 p.m. | OK | Kotlin 1.9 | TESTS | 24 | 2327 | 65228800 | ||
| 290747671 | hrutiky__ | D | Nov. 9, 2024, 4:26 p.m. | OK | Kotlin 1.9 | TESTS | 24 | 2562 | 71168000 | ||
| 290757136 | bnmanubharadwaj | D | Nov. 9, 2024, 4:57 p.m. | OK | Node.js | TESTS | 24 | 2421 | 141926400 | ||
| 290780977 | Amay12 | D | Nov. 9, 2024, 7:54 p.m. | OK | PyPy 3 | TESTS | 25 | 968 | 60518400 | ||
| 290764313 | paugh1612 | D | Nov. 9, 2024, 5:25 p.m. | OK | PyPy 3 | TESTS | 24 | 1514 | 32256000 | ||
| 290790331 | scyyyyyyyyyy | D | Nov. 9, 2024, 10:42 p.m. | OK | PyPy 3-64 | TESTS | 25 | 296 | 31641600 | ||
| 290777465 | AyuAnchor | D | Nov. 9, 2024, 7:15 p.m. | OK | PyPy 3-64 | TESTS | 25 | 437 | 55296000 | ||
| 290760833 | plevande | D | Nov. 9, 2024, 5:12 p.m. | OK | PyPy 3-64 | TESTS | 24 | 593 | 78131200 | ||
| 290786664 | xxx.ego | D | Nov. 9, 2024, 9:20 p.m. | OK | PyPy 3-64 | TESTS | 25 | 624 | 64204800 | ||
| 290780895 | Amay12 | D | Nov. 9, 2024, 7:53 p.m. | OK | PyPy 3-64 | TESTS | 25 | 796 | 91648000 | ||
| 290757758 | titia | D | Nov. 9, 2024, 5 p.m. | OK | PyPy 3-64 | TESTS | 24 | 827 | 72908800 | ||
| 290781111 | Amay12 | D | Nov. 9, 2024, 7:56 p.m. | OK | PyPy 3-64 | TESTS | 25 | 827 | 91750400 | ||
| 290780758 | Amay12 | D | Nov. 9, 2024, 7:52 p.m. | OK | PyPy 3-64 | TESTS | 25 | 906 | 91648000 | ||
| 290759094 | cixagafyeadfas | D | Nov. 9, 2024, 5:05 p.m. | OK | PyPy 3-64 | TESTS | 24 | 937 | 133222400 | ||
| 290746719 | katonyonko | D | Nov. 9, 2024, 4:23 p.m. | OK | PyPy 3-64 | TESTS | 24 | 953 | 104038400 | ||
| 290755767 | Ayakine | D | Nov. 9, 2024, 4:52 p.m. | OK | Python 3 | TESTS | 24 | 1812 | 105676800 | ||
| 290751146 | Codemaster404 | D | Nov. 9, 2024, 4:39 p.m. | OK | Ruby 3 | TESTS | 24 | 1562 | 113356800 | ||
| 290748480 | PaulPeterson | D | Nov. 9, 2024, 4:29 p.m. | OK | Rust 2021 | TESTS | 24 | 359 | 16793600 | ||
| 290774502 | Allergy527 | D | Nov. 9, 2024, 6:45 p.m. | OK | Rust 2021 | TESTS | 25 | 640 | 21708800 |
Back to search problems