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.
Problems
B'You are given an undirected graph consisting of n vertices and edges. Instead of giving you the edges that exist in the graph, we give you m unordered pairs (x, xe2 x80 x89y) such that there is no edge between x and y, and if some pair of vertices is not listed in the input, then there is an edge between these vertices. You have to find the number of connected components in the graph and the size of each component. A connected component is a set of vertices X such that for every two vertices from this set there exists at least one path in the graph connecting these vertices, but adding any other vertex to X violates this rule. The first line contains two integers n and m (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89200000, ). Then m lines follow, each containing a pair of integers x and y (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89x, xe2 x80 x89y xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n, x xe2 x80 x89 xe2 x89 xa0 xe2 x80 x89y) denoting that there is no edge between x and y. Each pair is listed at most once; (x, xe2 x80 x89y) and (y, xe2 x80 x89x) are considered the same (so they are never listed in the same test). If some pair of vertices is not listed in the input, then there exists an edge between those vertices. Firstly print k -- the number of connected components in this graph. Then print k integers -- the sizes of components. You should output these integers in non-descending order. '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
34868854 |
Bunnycxk |
E |
Feb. 2, 2018, 4:42 p.m. |
OK |
FPC |
TESTS |
85 |
93 |
16793600 |
|
2100 |
36152828 |
rabbitcxk |
E |
March 10, 2018, 2:02 p.m. |
OK |
FPC |
TESTS |
84 |
108 |
16793600 |
|
2100 |
37035259 |
ilovenwd |
E |
April 7, 2018, 2:32 a.m. |
OK |
GNU C |
TESTS |
84 |
171 |
25804800 |
|
2100 |
37035793 |
ilovenwd |
E |
April 7, 2018, 3:17 a.m. |
OK |
GNU C |
TESTS |
84 |
187 |
25804800 |
|
2100 |
37045660 |
ilovenwd |
E |
April 7, 2018, 9:43 a.m. |
OK |
GNU C |
TESTS |
84 |
280 |
28160000 |
|
2100 |
35041325 |
lujiaju |
E |
Feb. 8, 2018, 2:28 a.m. |
OK |
GNU C++ |
TESTS |
84 |
31 |
10342400 |
|
2100 |
34915092 |
yypurpose12345 |
E |
Feb. 4, 2018, 5:53 a.m. |
OK |
GNU C++ |
TESTS |
84 |
31 |
39321600 |
|
2100 |
34914222 |
yasugongshang |
E |
Feb. 4, 2018, 5:04 a.m. |
OK |
GNU C++ |
TESTS |
84 |
46 |
11161600 |
|
2100 |
34914436 |
yasugongshang |
E |
Feb. 4, 2018, 5:18 a.m. |
OK |
GNU C++ |
TESTS |
84 |
46 |
11878400 |
|
2100 |
34914458 |
yasugongshang |
E |
Feb. 4, 2018, 5:20 a.m. |
OK |
GNU C++ |
TESTS |
84 |
46 |
11980800 |
|
2100 |
40978471 |
ReaLNero1 |
E |
July 30, 2018, 4:39 p.m. |
OK |
GNU C++ |
TESTS |
84 |
46 |
69324800 |
|
2100 |
34890455 |
luogu_bot5 |
E |
Feb. 3, 2018, 9:39 a.m. |
OK |
GNU C++ |
TESTS |
85 |
46 |
71372800 |
|
2100 |
34870530 |
yukuai26 |
E |
Feb. 2, 2018, 5:08 p.m. |
OK |
GNU C++ |
TESTS |
84 |
62 |
13312000 |
|
2100 |
35196680 |
Scut82 |
E |
Feb. 13, 2018, 10:43 a.m. |
OK |
GNU C++ |
TESTS |
84 |
62 |
16896000 |
|
2100 |
35108988 |
jzqjzq |
E |
Feb. 10, 2018, 1:41 a.m. |
OK |
GNU C++ |
TESTS |
84 |
62 |
43520000 |
|
2100 |
55400720 |
rainboy |
E |
June 10, 2019, 1:56 p.m. |
OK |
GNU C11 |
TESTS |
84 |
156 |
27443200 |
|
2100 |
55382857 |
rainboy |
E |
June 9, 2019, 10:46 p.m. |
OK |
GNU C11 |
TESTS |
84 |
171 |
27443200 |
|
2100 |
51972594 |
luogu_bot1 |
E |
March 29, 2019, 1:04 p.m. |
OK |
GNU C++11 |
TESTS |
84 |
46 |
7475200 |
|
2100 |
51972648 |
Fubuki |
E |
March 29, 2019, 1:06 p.m. |
OK |
GNU C++11 |
TESTS |
84 |
46 |
7475200 |
|
2100 |
56958703 |
MoQianXue |
E |
July 13, 2019, 5:45 a.m. |
OK |
GNU C++11 |
TESTS |
84 |
46 |
7475200 |
|
2100 |
51968580 |
time_interspace |
E |
March 29, 2019, 11:17 a.m. |
OK |
GNU C++11 |
TESTS |
84 |
46 |
7680000 |
|
2100 |
51961875 |
shaojianan |
E |
March 29, 2019, 7:22 a.m. |
OK |
GNU C++11 |
TESTS |
84 |
46 |
8089600 |
|
2100 |
66183611 |
vrsashly |
E |
Dec. 2, 2019, 1:41 p.m. |
OK |
GNU C++11 |
TESTS |
84 |
46 |
8089600 |
|
2100 |
52134217 |
yyyz04 |
E |
April 1, 2019, 12:28 a.m. |
OK |
GNU C++11 |
TESTS |
84 |
46 |
8294400 |
|
2100 |
48963081 |
star_magic_young |
E |
Jan. 26, 2019, 6:46 a.m. |
OK |
GNU C++11 |
TESTS |
84 |
46 |
8396800 |
|
2100 |
48957692 |
star_magic_young |
E |
Jan. 26, 2019, 5:20 a.m. |
OK |
GNU C++11 |
TESTS |
84 |
46 |
8396800 |
|
2100 |
43034355 |
luogu_bot1 |
E |
Sept. 18, 2018, 1:02 p.m. |
OK |
GNU C++11 |
TESTS |
84 |
46 |
8601600 |
|
2100 |
35090026 |
fanache99 |
E |
Feb. 9, 2018, 12:48 p.m. |
OK |
GNU C++14 |
TESTS |
84 |
46 |
13312000 |
|
2100 |
51963623 |
Nostalgically |
E |
March 29, 2019, 8:39 a.m. |
OK |
GNU C++14 |
TESTS |
84 |
46 |
13721600 |
|
2100 |
36060422 |
vjudge5 |
E |
March 8, 2018, 3:55 a.m. |
OK |
GNU C++14 |
TESTS |
84 |
46 |
13721600 |
|
2100 |
34934391 |
q234rty |
E |
Feb. 5, 2018, 5:30 a.m. |
OK |
GNU C++14 |
TESTS |
84 |
46 |
23961600 |
|
2100 |
36060424 |
562225807 |
E |
March 8, 2018, 3:55 a.m. |
OK |
GNU C++14 |
TESTS |
84 |
61 |
13721600 |
|
2100 |
52515209 |
jvjhfhg |
E |
April 9, 2019, 4:43 a.m. |
OK |
GNU C++14 |
TESTS |
84 |
77 |
9523200 |
|
2100 |
34875019 |
Linkus |
E |
Feb. 2, 2018, 7:50 p.m. |
OK |
GNU C++14 |
TESTS |
85 |
93 |
14643200 |
|
2100 |
61601284 |
lduxiewenguang |
E |
Oct. 1, 2019, 11:04 a.m. |
OK |
GNU C++14 |
TESTS |
84 |
93 |
33075200 |
|
2100 |
45900865 |
Hugh_Locke |
E |
Nov. 18, 2018, 4:37 a.m. |
OK |
GNU C++14 |
TESTS |
84 |
108 |
7065600 |
|
2100 |
55859421 |
vjudge5 |
E |
June 21, 2019, 8:47 a.m. |
OK |
GNU C++14 |
TESTS |
84 |
108 |
7884800 |
|
2100 |
35275415 |
LiChenKoh |
E |
Feb. 14, 2018, 8 p.m. |
OK |
GNU C++17 |
TESTS |
84 |
62 |
11264000 |
|
2100 |
68942760 |
Kirito |
E |
Jan. 16, 2020, 2:58 p.m. |
OK |
GNU C++17 |
TESTS |
84 |
77 |
13516800 |
|
2100 |
62187084 |
qinding |
E |
Oct. 9, 2019, 8:35 a.m. |
OK |
GNU C++17 |
TESTS |
84 |
93 |
30003200 |
|
2100 |
64455621 |
Henry_Huang |
E |
Nov. 7, 2019, 8:37 a.m. |
OK |
GNU C++17 |
TESTS |
84 |
108 |
32665600 |
|
2100 |
51074070 |
aaa2333333 |
E |
March 9, 2019, 8:47 a.m. |
OK |
GNU C++17 |
TESTS |
84 |
108 |
36659200 |
|
2100 |
42365582 |
vjudge4 |
E |
Sept. 2, 2018, 2:26 p.m. |
OK |
GNU C++17 |
TESTS |
84 |
109 |
7065600 |
|
2100 |
64469447 |
swust5120177231 |
E |
Nov. 7, 2019, 12:40 p.m. |
OK |
GNU C++17 |
TESTS |
84 |
109 |
7680000 |
|
2100 |
47026810 |
OMG_wc |
E |
Dec. 15, 2018, 7:25 a.m. |
OK |
GNU C++17 |
TESTS |
84 |
109 |
7680000 |
|
2100 |
63837157 |
betrue12 |
E |
Oct. 30, 2019, 2:41 p.m. |
OK |
GNU C++17 |
TESTS |
84 |
109 |
9318400 |
|
2100 |
48329140 |
AliShahali1382 |
E |
Jan. 13, 2019, 1:28 p.m. |
OK |
GNU C++17 |
TESTS |
84 |
109 |
9523200 |
|
2100 |
65587016 |
synapse |
E |
Nov. 23, 2019, 12:48 p.m. |
OK |
Go |
TESTS |
84 |
109 |
14233600 |
|
2100 |
65585397 |
synapse |
E |
Nov. 23, 2019, 12:16 p.m. |
OK |
Go |
TESTS |
84 |
342 |
9728000 |
|
2100 |
64459461 |
Garett |
E |
Nov. 7, 2019, 9:49 a.m. |
OK |
Java 11 |
TESTS |
84 |
264 |
5939200 |
|
2100 |
69604205 |
zhanyi_xiaolu |
E |
Jan. 27, 2020, 9:05 a.m. |
OK |
Java 11 |
TESTS |
84 |
1684 |
56115200 |
|
2100 |
64441734 |
In_The_Name_Of_Love |
E |
Nov. 7, 2019, 4:42 a.m. |
OK |
Java 8 |
TESTS |
84 |
171 |
102400 |
|
2100 |
34906092 |
uwi |
E |
Feb. 3, 2018, 7:09 p.m. |
OK |
Java 8 |
TESTS |
84 |
171 |
22835200 |
|
2100 |
35071411 |
In_The_Name_Of_Love |
E |
Feb. 8, 2018, 8:09 p.m. |
OK |
Java 8 |
TESTS |
84 |
186 |
22835200 |
|
2100 |
34986720 |
1moretry |
E |
Feb. 7, 2018, 3 a.m. |
OK |
Java 8 |
TESTS |
84 |
264 |
27545600 |
|
2100 |
34883528 |
chandan5284 |
E |
Feb. 3, 2018, 5:54 a.m. |
OK |
Java 8 |
TESTS |
85 |
327 |
53862400 |
|
2100 |
34883219 |
noob__coder |
E |
Feb. 3, 2018, 5:41 a.m. |
OK |
Java 8 |
TESTS |
85 |
358 |
45363200 |
|
2100 |
67636482 |
prem_cse |
E |
Dec. 26, 2019, 7:15 a.m. |
OK |
Java 8 |
TESTS |
84 |
374 |
38809600 |
|
2100 |
58780429 |
ajkdrag |
E |
Aug. 13, 2019, 7:14 p.m. |
OK |
Java 8 |
TESTS |
84 |
421 |
74956800 |
|
2100 |
55400719 |
Dukkha |
E |
June 10, 2019, 1:56 p.m. |
OK |
Java 8 |
TESTS |
84 |
436 |
61849600 |
|
2100 |
50258332 |
wadissimo |
E |
Feb. 20, 2019, 9:14 p.m. |
OK |
Java 8 |
TESTS |
84 |
451 |
36454400 |
|
2100 |
64611632 |
Spheniscine |
E |
Nov. 10, 2019, 2:03 a.m. |
OK |
Kotlin |
TESTS |
84 |
327 |
5324800 |
|
2100 |
64613231 |
Spheniscine |
E |
Nov. 10, 2019, 3:06 a.m. |
OK |
Kotlin |
TESTS |
84 |
342 |
5324800 |
|
2100 |
64612960 |
Spheniscine |
E |
Nov. 10, 2019, 2:57 a.m. |
OK |
Kotlin |
TESTS |
84 |
358 |
5529600 |
|
2100 |
48035715 |
bubnov |
E |
Jan. 6, 2019, 3:22 p.m. |
OK |
Kotlin |
TESTS |
84 |
779 |
126259200 |
|
2100 |
37749986 |
og.kostya |
E |
April 30, 2018, 2:10 p.m. |
OK |
Mono C# |
TESTS |
84 |
140 |
28672000 |
|
2100 |
34963983 |
tattosha_aptan |
E |
Feb. 6, 2018, 7:47 a.m. |
OK |
MS C# |
TESTS |
84 |
296 |
35737600 |
|
2100 |
34938226 |
fr0st |
E |
Feb. 5, 2018, 8:33 a.m. |
OK |
MS C# |
TESTS |
84 |
390 |
61644800 |
|
2100 |
35226000 |
vjudge1 |
E |
Feb. 14, 2018, 8:24 a.m. |
OK |
MS C++ |
TESTS |
84 |
93 |
11980800 |
|
2100 |
55849327 |
vjudge4 |
E |
June 21, 2019, 2:03 a.m. |
OK |
MS C++ |
TESTS |
84 |
93 |
33792000 |
|
2100 |
34868324 |
I_love_sad_crying_cats |
E |
Feb. 2, 2018, 4:34 p.m. |
OK |
MS C++ |
TESTS |
85 |
124 |
29696000 |
|
2100 |
42852972 |
npu2017302459 |
E |
Sept. 14, 2018, 7:11 a.m. |
OK |
MS C++ |
TESTS |
84 |
171 |
16281600 |
|
2100 |
42853019 |
npu2017302459 |
E |
Sept. 14, 2018, 7:13 a.m. |
OK |
MS C++ |
TESTS |
84 |
171 |
16281600 |
|
2100 |
42852753 |
npu2017302459 |
E |
Sept. 14, 2018, 7 a.m. |
OK |
MS C++ |
TESTS |
84 |
186 |
16281600 |
|
2100 |
42853005 |
npu2017302459 |
E |
Sept. 14, 2018, 7:12 a.m. |
OK |
MS C++ |
TESTS |
84 |
186 |
16281600 |
|
2100 |
42848996 |
npu2017302459 |
E |
Sept. 14, 2018, 3:33 a.m. |
OK |
MS C++ |
TESTS |
84 |
187 |
16281600 |
|
2100 |
58105882 |
vjudge1 |
E |
Aug. 1, 2019, 4:14 a.m. |
OK |
MS C++ |
TESTS |
84 |
217 |
18432000 |
|
2100 |
35037551 |
RCG |
E |
Feb. 7, 2018, 10:15 p.m. |
OK |
MS C++ |
TESTS |
84 |
296 |
52326400 |
|
2100 |
64688118 |
wh2005 |
E |
Nov. 11, 2019, 12:21 p.m. |
OK |
MS C++ 2017 |
TESTS |
84 |
124 |
10342400 |
|
2100 |
63690237 |
EDawn |
E |
Oct. 29, 2019, 2:02 a.m. |
OK |
MS C++ 2017 |
TESTS |
84 |
327 |
14643200 |
|
2100 |
65418790 |
NEvOl |
E |
Nov. 20, 2019, 8:06 a.m. |
OK |
MS C++ 2017 |
TESTS |
84 |
561 |
30105600 |
|
2100 |
64455041 |
MIG29 |
E |
Nov. 7, 2019, 8:27 a.m. |
OK |
MS C++ 2017 |
TESTS |
84 |
592 |
25804800 |
|
2100 |
54778468 |
pajenegod |
E |
May 28, 2019, 7:33 p.m. |
OK |
PyPy 2 |
TESTS |
84 |
264 |
23142400 |
|
2100 |
65575761 |
vjudge1 |
E |
Nov. 23, 2019, 9:19 a.m. |
OK |
PyPy 2 |
TESTS |
84 |
436 |
21401600 |
|
2100 |
35159204 |
iit2014101 |
E |
Feb. 11, 2018, 5:04 p.m. |
OK |
PyPy 2 |
TESTS |
84 |
982 |
79360000 |
|
2100 |
48952371 |
dtl8 |
E |
Jan. 26, 2019, 1:07 a.m. |
OK |
PyPy 2 |
TESTS |
84 |
1465 |
65740800 |
|
2100 |
48952451 |
dtl8 |
E |
Jan. 26, 2019, 1:16 a.m. |
OK |
PyPy 2 |
TESTS |
84 |
1496 |
65843200 |
|
2100 |
68987444 |
mitribunskiy |
E |
Jan. 17, 2020, 1:01 p.m. |
OK |
PyPy 3 |
TESTS |
84 |
623 |
38400000 |
|
2100 |
34866299 |
astrom.lars |
E |
Feb. 2, 2018, 4:26 p.m. |
OK |
PyPy 3 |
TESTS |
85 |
1794 |
40652800 |
|
2100 |
34871135 |
tom |
E |
Feb. 2, 2018, 5:22 p.m. |
OK |
PyPy 3 |
TESTS |
84 |
1824 |
38604800 |
|
2100 |
34874523 |
ldt116 |
E |
Feb. 2, 2018, 7:28 p.m. |
OK |
PyPy 3 |
TESTS |
85 |
1934 |
85606400 |
|
2100 |
34874396 |
ldt116 |
E |
Feb. 2, 2018, 7:23 p.m. |
OK |
PyPy 3 |
TESTS |
85 |
1949 |
86220800 |
|
2100 |
34874593 |
ldt116 |
E |
Feb. 2, 2018, 7:31 p.m. |
OK |
PyPy 3 |
TESTS |
85 |
1980 |
85811200 |
|
2100 |
46255741 |
wishcode |
E |
Nov. 26, 2018, 4:36 p.m. |
OK |
Python 3 |
TESTS |
84 |
951 |
52531200 |
|
2100 |
34880332 |
hahho |
E |
Feb. 3, 2018, 2:35 a.m. |
OK |
Python 3 |
TESTS |
85 |
1045 |
58060800 |
|
2100 |
35044318 |
Sameen |
E |
Feb. 8, 2018, 4:55 a.m. |
OK |
Python 3 |
TESTS |
84 |
1106 |
58060800 |
|
2100 |
34868070 |
hahho |
E |
Feb. 2, 2018, 4:33 p.m. |
OK |
Python 3 |
TESTS |
85 |
1122 |
57753600 |
|
2100 |
34874628 |
ldt116 |
E |
Feb. 2, 2018, 7:33 p.m. |
OK |
Python 3 |
TESTS |
85 |
1122 |
57958400 |
|
2100 |
64852856 |
sansen |
E |
Nov. 13, 2019, 8:34 p.m. |
OK |
Rust |
TESTS |
84 |
78 |
13926400 |
|
2100 |
remove filters
Back to search problems