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 |
---|---|---|---|---|---|---|
1761 | Pinely Round 1 (Div. 1 + Div. 2) | FINISHED | False | 9000 | 68311463 | Nov. 20, 2022, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 1908 ) | E | Make It Connected | PROGRAMMING | constructive algorithms graphs greedy |
B"You are given a simple undirected graph consisting of n vertices. The graph doesn't contain self-loops, there is at most one edge between each pair of vertices. Your task is simple: make the graph connected. You can do the following operation any number of times (possibly zero): Find the minimum number of operations required to make the graph connected. Also, find any sequence of operations with the minimum length that makes the graph connected. Each test contains multiple test cases. The first line contains a single integer t ( 1 <= q t <= q 800 ) -- the number of test cases. The description of test cases follows. The first line of each test case contains a single integer n ( 2 <= q n <= q 4000 ) -- the number of vertices in the graph. Then n lines follow. The i -th row contains a binary string s_i of length n , where s_{i,j} is '1' if there is an edge between vertex i and j initially, otherwise s_{i,j} is '0'. It is guaranteed that s_{i,i} is always '0' and s_{i,j}=s_{j,i} for 1 <= q i,j <= q n . It is guaranteed that the sum of n over all test cases does not exceed 4000 . For each test case, in the first line, output an integer m -- the minimum number of operations required. If m is greater than zero, then print an extra line consisting of m integers -- the vertices chosen in the operations in your solution. If there are multiple solutions with the minimum number of operations, print any. In the first test case, the graph is connected at the beginning, so the answer is 0 . In the second test case, if we do the operation with vertex 1 , we will get the following graph represented by an adjacency matrix: begin{bmatrix} 0&1&1 1&0&1 1&1&0 end{bmatrix} It's obvious that the graph above is connected. In the third test case, if we do the operation with vertex 3 and 4 , we will get the following graph "... |
Pinely Round 1 (Div. 1 + Div. 2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
181838423 | Tdyx | E | Nov. 21, 2022, 3:58 a.m. | OK | C# 10 | TESTS | 38 | 405 | 37580800 | ||
181793819 | hos.lyric | E | Nov. 20, 2022, 4:29 p.m. | OK | D | TESTS | 33 | 451 | 23961600 | ||
181802145 | Gassa | E | Nov. 20, 2022, 5:04 p.m. | OK | D | TESTS | 33 | 764 | 24678400 | ||
181802230 | chro4896 | E | Nov. 20, 2022, 5:04 p.m. | OK | GNU C11 | TESTS | 33 | 202 | 16076800 | ||
181818297 | rainboy | E | Nov. 20, 2022, 8:01 p.m. | OK | GNU C11 | TESTS | 34 | 343 | 16076800 | ||
181828304 | hhhh531889330 | E | Nov. 20, 2022, 11:28 p.m. | OK | GNU C++14 | TESTS | 37 | 156 | 16281600 | ||
181791337 | Jisoo_Kim | E | Nov. 20, 2022, 4:18 p.m. | OK | GNU C++14 | TESTS | 33 | 171 | 102400 | ||
181785942 | Jimanbanashi | E | Nov. 20, 2022, 3:57 p.m. | OK | GNU C++14 | TESTS | 33 | 171 | 16486400 | ||
181833969 | April_lie | E | Nov. 21, 2022, 2:16 a.m. | OK | GNU C++14 | TESTS | 38 | 186 | 102400 | ||
181800593 | Sterswind | E | Nov. 20, 2022, 4:59 p.m. | OK | GNU C++14 | TESTS | 33 | 187 | 16384000 | ||
181791663 | zmj2008AKIOI | E | Nov. 20, 2022, 4:19 p.m. | OK | GNU C++14 | TESTS | 33 | 187 | 16896000 | ||
181828666 | Aleph-zero | E | Nov. 20, 2022, 11:39 p.m. | OK | GNU C++14 | TESTS | 37 | 187 | 64409600 | ||
181800592 | Recollector | E | Nov. 20, 2022, 4:59 p.m. | OK | GNU C++14 | TESTS | 33 | 202 | 16281600 | ||
181788262 | dlalswp25 | E | Nov. 20, 2022, 4:05 p.m. | OK | GNU C++14 | TESTS | 33 | 202 | 16588800 | ||
181792871 | cyh_toby | E | Nov. 20, 2022, 4:25 p.m. | OK | GNU C++14 | TESTS | 33 | 202 | 64512000 | ||
181809120 | kk19212 | E | Nov. 20, 2022, 6:18 p.m. | OK | GNU C++17 | TESTS | 34 | 140 | 17920000 | ||
181836090 | kk19212 | E | Nov. 21, 2022, 3:04 a.m. | OK | GNU C++17 | TESTS | 38 | 155 | 17920000 | ||
181789086 | JOHNKRAM | E | Nov. 20, 2022, 4:08 p.m. | OK | GNU C++17 | TESTS | 33 | 155 | 65638400 | ||
181785752 | chen_zexing | E | Nov. 20, 2022, 3:56 p.m. | OK | GNU C++17 | TESTS | 33 | 171 | 16486400 | ||
181797640 | MDMAMA | E | Nov. 20, 2022, 4:46 p.m. | OK | GNU C++17 | TESTS | 33 | 186 | 16588800 | ||
181796561 | meaningIess | E | Nov. 20, 2022, 4:41 p.m. | OK | GNU C++17 | TESTS | 33 | 186 | 16793600 | ||
181788013 | Ayanami_desu | E | Nov. 20, 2022, 4:04 p.m. | OK | GNU C++17 | TESTS | 33 | 186 | 24576000 | ||
181840336 | 403 | E | Nov. 21, 2022, 4:42 a.m. | OK | GNU C++17 | TESTS | 38 | 186 | 25804800 | ||
181805386 | Meeena | E | Nov. 20, 2022, 5:51 p.m. | OK | GNU C++17 | TESTS | 33 | 187 | 16384000 | ||
181785595 | RDDCCD | E | Nov. 20, 2022, 3:55 p.m. | OK | GNU C++17 | TESTS | 33 | 187 | 16486400 | ||
181800691 | PineapplesOnPizza | E | Nov. 20, 2022, 5 p.m. | OK | GNU C++17 (64) | TESTS | 33 | 186 | 66252800 | ||
181798841 | JYJin | E | Nov. 20, 2022, 4:52 p.m. | OK | GNU C++17 (64) | TESTS | 33 | 187 | 25600000 | ||
181827686 | LXl491214 | E | Nov. 20, 2022, 11:07 p.m. | OK | GNU C++17 (64) | TESTS | 37 | 202 | 16179200 | ||
181798745 | for_fun0 | E | Nov. 20, 2022, 4:51 p.m. | OK | GNU C++17 (64) | TESTS | 33 | 202 | 16486400 | ||
181833388 | frankly6 | E | Nov. 21, 2022, 2:01 a.m. | OK | GNU C++17 (64) | TESTS | 38 | 202 | 16691200 | ||
181791265 | yamunaku | E | Nov. 20, 2022, 4:18 p.m. | OK | GNU C++17 (64) | TESTS | 33 | 202 | 25804800 | ||
181797851 | kotatsugame | E | Nov. 20, 2022, 4:47 p.m. | OK | GNU C++17 (64) | TESTS | 33 | 202 | 26112000 | ||
181787669 | natsugiri | E | Nov. 20, 2022, 4:03 p.m. | OK | GNU C++17 (64) | TESTS | 33 | 202 | 33280000 | ||
181806167 | guitarhero_0221 | E | Nov. 20, 2022, 5:55 p.m. | OK | GNU C++17 (64) | TESTS | 34 | 217 | 18534400 | ||
181798981 | GRT_2018 | E | Nov. 20, 2022, 4:52 p.m. | OK | GNU C++17 (64) | TESTS | 33 | 217 | 65024000 | ||
181818382 | kaiboy | E | Nov. 20, 2022, 8:02 p.m. | OK | GNU C++20 (64) | TESTS | 34 | 93 | 16076800 | ||
181788136 | pornjoke | E | Nov. 20, 2022, 4:05 p.m. | OK | GNU C++20 (64) | TESTS | 33 | 93 | 17817600 | ||
181835385 | YYYLLL2021 | E | Nov. 21, 2022, 2:48 a.m. | OK | GNU C++20 (64) | TESTS | 38 | 108 | 409600 | ||
181811827 | apoorv_me | E | Nov. 20, 2022, 6:45 p.m. | OK | GNU C++20 (64) | TESTS | 34 | 108 | 22016000 | ||
181797913 | vipjml | E | Nov. 20, 2022, 4:48 p.m. | OK | GNU C++20 (64) | TESTS | 33 | 108 | 22016000 | ||
181806957 | huangxiaohua | E | Nov. 20, 2022, 6:01 p.m. | OK | GNU C++20 (64) | TESTS | 34 | 109 | 17817600 | ||
181785688 | Golovanov399 | E | Nov. 20, 2022, 3:56 p.m. | OK | GNU C++20 (64) | TESTS | 33 | 109 | 21913600 | ||
181843378 | jianguolinyun | E | Nov. 21, 2022, 5:44 a.m. | OK | GNU C++20 (64) | TESTS | 38 | 109 | 26316800 | ||
181798909 | zqyyy | E | Nov. 20, 2022, 4:52 p.m. | OK | GNU C++20 (64) | TESTS | 33 | 124 | 8601600 | ||
181811382 | cr7delcodeforces | E | Nov. 20, 2022, 6:40 p.m. | OK | GNU C++20 (64) | TESTS | 34 | 124 | 21811200 | ||
181800034 | insert_cool_handle | E | Nov. 20, 2022, 4:57 p.m. | OK | Java 11 | TESTS | 33 | 514 | 0 | ||
181836080 | shojin_pro | E | Nov. 21, 2022, 3:04 a.m. | OK | Java 11 | TESTS | 38 | 686 | 78233600 | ||
181799838 | LonggHuynh | E | Nov. 20, 2022, 4:56 p.m. | OK | Java 17 | TESTS | 33 | 561 | 20377600 | ||
181806542 | Dukkha | E | Nov. 20, 2022, 5:57 p.m. | OK | Java 17 | TESTS | 34 | 608 | 152678400 | ||
181788350 | eatmore | E | Nov. 20, 2022, 4:06 p.m. | OK | Java 17 | TESTS | 33 | 623 | 20377600 | ||
181794267 | AndreySiunov | E | Nov. 20, 2022, 4:31 p.m. | OK | Java 8 | TESTS | 33 | 342 | 32460800 | ||
181818849 | SecondThread | E | Nov. 20, 2022, 8:09 p.m. | OK | Java 8 | TESTS | 34 | 514 | 79155200 | ||
181818796 | SecondThread | E | Nov. 20, 2022, 8:08 p.m. | OK | Java 8 | TESTS | 34 | 514 | 79155200 | ||
181795487 | MagentaCobra | E | Nov. 20, 2022, 4:36 p.m. | OK | Java 8 | TESTS | 33 | 560 | 77107200 | ||
181800372 | fetetriste | E | Nov. 20, 2022, 4:58 p.m. | OK | Java 8 | TESTS | 33 | 717 | 55500800 | ||
181790254 | arvindf232 | E | Nov. 20, 2022, 4:13 p.m. | OK | Kotlin 1.6 | TESTS | 33 | 623 | 17920000 | ||
181785527 | PavelKunyavskiy | E | Nov. 20, 2022, 3:55 p.m. | OK | Kotlin 1.7 | TESTS | 33 | 982 | 110387200 | ||
181786738 | gnomina007 | E | Nov. 20, 2022, 3:59 p.m. | OK | MS C++ 2017 | TESTS | 33 | 311 | 33177600 | ||
181800663 | toam | E | Nov. 20, 2022, 4:59 p.m. | OK | PyPy 3-64 | TESTS | 33 | 327 | 23040000 | ||
181828514 | Yawn_Sean | E | Nov. 20, 2022, 11:35 p.m. | OK | PyPy 3-64 | TESTS | 37 | 639 | 56832000 | ||
181795509 | Maruzensky | E | Nov. 20, 2022, 4:36 p.m. | OK | PyPy 3-64 | TESTS | 33 | 639 | 168960000 | ||
181835354 | Little_Sheep_Yawn | E | Nov. 21, 2022, 2:47 a.m. | OK | PyPy 3-64 | TESTS | 38 | 670 | 53657600 | ||
181844358 | huangxw | E | Nov. 21, 2022, 6:02 a.m. | OK | PyPy 3-64 | TESTS | 38 | 889 | 312217600 | ||
181844227 | huangxw | E | Nov. 21, 2022, 6 a.m. | OK | PyPy 3-64 | TESTS | 38 | 920 | 312320000 | ||
181808896 | huangxw | E | Nov. 20, 2022, 6:16 p.m. | OK | PyPy 3-64 | TESTS | 34 | 935 | 311091200 | ||
181843903 | huangxw | E | Nov. 21, 2022, 5:54 a.m. | OK | PyPy 3-64 | TESTS | 38 | 966 | 312217600 | ||
181833697 | hvbird | E | Nov. 21, 2022, 2:08 a.m. | OK | PyPy 3-64 | TESTS | 38 | 982 | 25190400 | ||
181828450 | Yawn_Sean | E | Nov. 20, 2022, 11:33 p.m. | OK | PyPy 3-64 | TESTS | 37 | 998 | 56934400 | ||
181830706 | Spheniscine | E | Nov. 21, 2022, 12:45 a.m. | OK | Rust 2021 | TESTS | 38 | 124 | 204800 | ||
181785555 | sansen | E | Nov. 20, 2022, 3:55 p.m. | OK | Rust 2021 | TESTS | 33 | 171 | 34201600 |
Back to search problems