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 a set of size m with integer elements between 0 and 2^{n}-1 inclusive. Let's build an undirected graph on these integers in the following way: connect two integers x and y with an edge if and only if x & y = 0 . Here & is the bitwise AND operation. Count the number of connected components in that graph. In the first line of input there are two integers n and m ( 0 <= n <= 22 , 1 <= m <= 2^{n} ). In the second line there are m integers a_1, a_2, ldots, a_m ( 0 <= a_{i} < 2^{n} ) -- the elements of the set. All a_{i} are distinct. Print the number of connected components. Graph from first sample: Graph from second sample: "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
39671494 |
1668 |
C |
June 26, 2018, 9:34 a.m. |
OK |
FPC |
TESTS |
82 |
1356 |
99430400 |
|
2300 |
38760302 |
TsReaper |
C |
May 30, 2018, 5:20 a.m. |
OK |
GNU C |
TESTS |
82 |
1154 |
85196800 |
|
2300 |
39665637 |
ilnil |
C |
June 26, 2018, 4:55 a.m. |
OK |
GNU C++ |
TESTS |
82 |
514 |
126771200 |
|
2300 |
40084094 |
vjudge5 |
C |
July 8, 2018, 11:48 a.m. |
OK |
GNU C++ |
TESTS |
82 |
530 |
101683200 |
|
2300 |
40029116 |
luogu_bot3 |
C |
July 6, 2018, 11:58 a.m. |
OK |
GNU C++ |
TESTS |
82 |
561 |
84172800 |
|
2300 |
40047167 |
luogu_bot4 |
C |
July 7, 2018, 12:27 a.m. |
OK |
GNU C++ |
TESTS |
82 |
576 |
101683200 |
|
2300 |
40073141 |
luogu_bot3 |
C |
July 8, 2018, 1:43 a.m. |
OK |
GNU C++ |
TESTS |
82 |
608 |
101683200 |
|
2300 |
40073114 |
czqsdalao |
C |
July 8, 2018, 1:41 a.m. |
OK |
GNU C++ |
TESTS |
82 |
623 |
101683200 |
|
2300 |
38963046 |
vjudge4 |
C |
June 5, 2018, 8:05 a.m. |
OK |
GNU C++ |
TESTS |
82 |
623 |
105164800 |
|
2300 |
39413452 |
fksquare |
C |
June 19, 2018, 2:12 p.m. |
OK |
GNU C++ |
TESTS |
82 |
639 |
83865600 |
|
2300 |
38760706 |
qkoqhh |
C |
May 30, 2018, 5:38 a.m. |
OK |
GNU C++ |
TESTS |
82 |
655 |
110080000 |
|
2300 |
38758647 |
YES_RPG |
C |
May 30, 2018, 4:05 a.m. |
OK |
GNU C++ |
TESTS |
82 |
685 |
58880000 |
|
2300 |
40932047 |
ReaLNero1 |
C |
July 30, 2018, 1:32 a.m. |
OK |
GNU C++11 |
TESTS |
82 |
31 |
0 |
|
2300 |
38773832 |
wxkupup |
C |
May 30, 2018, 1:02 p.m. |
OK |
GNU C++11 |
TESTS |
82 |
31 |
3788800 |
|
2300 |
39088471 |
cuizhuyefei |
C |
June 10, 2018, 9:43 a.m. |
OK |
GNU C++11 |
TESTS |
82 |
451 |
45465600 |
|
2300 |
39088438 |
supy |
C |
June 10, 2018, 9:41 a.m. |
OK |
GNU C++11 |
TESTS |
82 |
451 |
45465600 |
|
2300 |
39462334 |
newbiegcz |
C |
June 21, 2018, 12:43 p.m. |
OK |
GNU C++11 |
TESTS |
82 |
483 |
96563200 |
|
2300 |
43551034 |
_Dispwnl |
C |
Sept. 29, 2018, 12:12 a.m. |
OK |
GNU C++11 |
TESTS |
82 |
514 |
16281600 |
|
2300 |
45233335 |
luogu_bot1 |
C |
Nov. 3, 2018, 8:08 a.m. |
OK |
GNU C++11 |
TESTS |
82 |
530 |
101683200 |
|
2300 |
48367246 |
luogu_bot5 |
C |
Jan. 13, 2019, 11:56 p.m. |
OK |
GNU C++11 |
TESTS |
82 |
560 |
101478400 |
|
2300 |
42198750 |
Nishikino_Curtis |
C |
Aug. 28, 2018, 7:46 a.m. |
OK |
GNU C++11 |
TESTS |
82 |
560 |
110182400 |
|
2300 |
62778635 |
HW_TXL |
C |
Oct. 17, 2019, 12:21 p.m. |
OK |
GNU C++11 |
TESTS |
82 |
561 |
101683200 |
|
2300 |
38743188 |
liouzhou_101 |
C |
May 29, 2018, 4:49 p.m. |
OK |
GNU C++14 |
TESTS |
82 |
654 |
80076800 |
|
2300 |
38932893 |
massimodong |
C |
June 4, 2018, 2:17 a.m. |
OK |
GNU C++14 |
TESTS |
82 |
701 |
88166400 |
|
2300 |
38963029 |
funer |
C |
June 5, 2018, 8:04 a.m. |
OK |
GNU C++14 |
TESTS |
82 |
811 |
105062400 |
|
2300 |
39350513 |
kopricky |
C |
June 18, 2018, 8:10 a.m. |
OK |
GNU C++14 |
TESTS |
82 |
842 |
33689600 |
|
2300 |
39349762 |
kopricky |
C |
June 18, 2018, 7:33 a.m. |
OK |
GNU C++14 |
TESTS |
82 |
842 |
33689600 |
|
2300 |
38767800 |
antguz |
C |
May 30, 2018, 9:50 a.m. |
OK |
GNU C++14 |
TESTS |
82 |
857 |
37990400 |
|
2300 |
39349908 |
kopricky |
C |
June 18, 2018, 7:40 a.m. |
OK |
GNU C++14 |
TESTS |
82 |
857 |
75673600 |
|
2300 |
39349889 |
kopricky |
C |
June 18, 2018, 7:39 a.m. |
OK |
GNU C++14 |
TESTS |
82 |
857 |
75673600 |
|
2300 |
39349876 |
kopricky |
C |
June 18, 2018, 7:38 a.m. |
OK |
GNU C++14 |
TESTS |
82 |
857 |
142848000 |
|
2300 |
39350246 |
kopricky |
C |
June 18, 2018, 7:56 a.m. |
OK |
GNU C++14 |
TESTS |
82 |
858 |
33689600 |
|
2300 |
39942783 |
LiChenKoh |
C |
July 4, 2018, 5:11 a.m. |
OK |
GNU C++17 |
TESTS |
82 |
764 |
51507200 |
|
2300 |
38735886 |
pashka |
C |
May 29, 2018, 4:15 p.m. |
OK |
GNU C++17 |
TESTS |
82 |
842 |
37990400 |
|
2300 |
59861278 |
Arianfk |
C |
Sept. 1, 2019, 3:24 p.m. |
OK |
GNU C++17 |
TESTS |
82 |
873 |
46284800 |
|
2300 |
39350520 |
kopricky |
C |
June 18, 2018, 8:10 a.m. |
OK |
GNU C++17 |
TESTS |
82 |
904 |
33689600 |
|
2300 |
39350452 |
kopricky |
C |
June 18, 2018, 8:07 a.m. |
OK |
GNU C++17 |
TESTS |
82 |
904 |
33689600 |
|
2300 |
67125757 |
Amireza |
C |
Dec. 17, 2019, 8:01 p.m. |
OK |
GNU C++17 |
TESTS |
82 |
904 |
128204800 |
|
2300 |
67138213 |
SuiT_Up |
C |
Dec. 18, 2019, 5:29 a.m. |
OK |
GNU C++17 |
TESTS |
82 |
919 |
129740800 |
|
2300 |
63246364 |
IIeJlMeHb |
C |
Oct. 23, 2019, 2:46 p.m. |
OK |
GNU C++17 |
TESTS |
82 |
935 |
183193600 |
|
2300 |
45434929 |
suibaka |
C |
Nov. 8, 2018, 7:18 a.m. |
OK |
GNU C++17 |
TESTS |
82 |
951 |
258048000 |
|
2300 |
61173020 |
Tejs |
C |
Sept. 23, 2019, 4:45 p.m. |
OK |
GNU C++17 |
TESTS |
82 |
966 |
180019200 |
|
2300 |
41300205 |
happybelly |
C |
Aug. 7, 2018, 9:35 a.m. |
OK |
Java 8 |
TESTS |
82 |
982 |
40652800 |
|
2300 |
39249236 |
unicorn20141 |
C |
June 14, 2018, 4:32 p.m. |
OK |
Java 8 |
TESTS |
82 |
1201 |
158515200 |
|
2300 |
38918504 |
fetetriste |
C |
June 3, 2018, 11:03 a.m. |
OK |
Java 8 |
TESTS |
82 |
1247 |
145715200 |
|
2300 |
38918471 |
fetetriste |
C |
June 3, 2018, 11:01 a.m. |
OK |
Java 8 |
TESTS |
82 |
1294 |
145612800 |
|
2300 |
40857422 |
iamavalon |
C |
July 27, 2018, 6:14 p.m. |
OK |
Java 8 |
TESTS |
82 |
1310 |
207974400 |
|
2300 |
38757514 |
Suzukaze |
C |
May 30, 2018, 3:10 a.m. |
OK |
Java 8 |
TESTS |
82 |
1325 |
187699200 |
|
2300 |
38746752 |
mmaxio |
C |
May 29, 2018, 5:10 p.m. |
OK |
Java 8 |
TESTS |
82 |
1466 |
123596800 |
|
2300 |
63947966 |
SecondThread |
C |
Oct. 31, 2019, 7:44 p.m. |
OK |
Java 8 |
TESTS |
82 |
1575 |
220160000 |
|
2300 |
61883274 |
TheSawan |
C |
Oct. 5, 2019, 1:49 a.m. |
OK |
Java 8 |
TESTS |
82 |
1684 |
106188800 |
|
2300 |
38799795 |
7dan |
C |
May 31, 2018, 11:31 a.m. |
OK |
Java 8 |
TESTS |
82 |
1746 |
169676800 |
|
2300 |
49040139 |
vjudge4 |
C |
Jan. 27, 2019, 6:07 a.m. |
OK |
MS C++ |
TESTS |
82 |
780 |
74547200 |
|
2300 |
48426820 |
vjudge3 |
C |
Jan. 15, 2019, 3:19 p.m. |
OK |
MS C++ |
TESTS |
82 |
842 |
60211200 |
|
2300 |
39062931 |
vjudge4 |
C |
June 9, 2018, 7:34 a.m. |
OK |
MS C++ |
TESTS |
82 |
1029 |
40857600 |
|
2300 |
38757027 |
Los_Angelos_Laycurse |
C |
May 30, 2018, 2:45 a.m. |
OK |
MS C++ |
TESTS |
82 |
1466 |
161484800 |
|
2300 |
38757014 |
Los_Angelos_Laycurse |
C |
May 30, 2018, 2:44 a.m. |
OK |
MS C++ |
TESTS |
82 |
1512 |
161382400 |
|
2300 |
54577010 |
pajenegod |
C |
May 25, 2019, 12:23 a.m. |
OK |
PyPy 2 |
TESTS |
82 |
1840 |
155750400 |
|
2300 |
54577136 |
pajenegod |
C |
May 25, 2019, 12:33 a.m. |
OK |
PyPy 2 |
TESTS |
82 |
2745 |
182784000 |
|
2300 |
60479087 |
meooow |
C |
Sept. 13, 2019, 9:35 a.m. |
OK |
PyPy 3 |
TESTS |
82 |
2277 |
179404800 |
|
2300 |
60478867 |
meooow |
C |
Sept. 13, 2019, 9:30 a.m. |
OK |
PyPy 3 |
TESTS |
82 |
3696 |
186163200 |
|
2300 |
60478611 |
meooow |
C |
Sept. 13, 2019, 9:24 a.m. |
OK |
PyPy 3 |
TESTS |
82 |
3821 |
186265600 |
|
2300 |
remove filters
Back to search problems