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 with n vertices numbered from 1 to n . Initially there are no edges. You are asked to perform some queries on the graph. Let last be the answer to the latest query of the second type, it is set to 0 before the first such query. Then the queries are the following: Good luck! The first line contains two integer numbers n and m ( 2 <= n, m <= 2 cdot 10^5 ) -- the number of vertices and the number of queries, respectively. Each of the following m lines contains a query of one of two aforementioned types. It is guaranteed that there is at least one query of the second type. Print a string, consisting of characters '0' and '1'. The i -th character should be the answer to the i -th query of the second type. Therefore the length of the string should be equal to the number of queries of the second type. The converted queries in the first example are: The converted queries in the second example are: "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
64280861 |
Dream-chasing_Juvenile |
F |
Nov. 5, 2019, 1:41 a.m. |
OK |
GNU C++11 |
TESTS |
50 |
311 |
66355200 |
|
2800 |
60193536 |
chenyewei_1234 |
F |
Sept. 6, 2019, 11:31 p.m. |
OK |
GNU C++11 |
TESTS |
50 |
311 |
68812800 |
|
2800 |
60389618 |
AutumnKite |
F |
Sept. 11, 2019, 12:49 p.m. |
OK |
GNU C++11 |
TESTS |
50 |
312 |
47513600 |
|
2800 |
60193563 |
chenyewei_1234 |
F |
Sept. 6, 2019, 11:33 p.m. |
OK |
GNU C++11 |
TESTS |
50 |
312 |
68812800 |
|
2800 |
63301074 |
p_b_p_b |
F |
Oct. 24, 2019, 2:18 p.m. |
OK |
GNU C++11 |
TESTS |
50 |
327 |
59904000 |
|
2800 |
61223374 |
x_faraway_x |
F |
Sept. 24, 2019, 2:31 p.m. |
OK |
GNU C++11 |
TESTS |
50 |
358 |
64307200 |
|
2800 |
61220288 |
x_faraway_x |
F |
Sept. 24, 2019, 1:46 p.m. |
OK |
GNU C++11 |
TESTS |
50 |
358 |
80179200 |
|
2800 |
61314599 |
xuxuxuxuxu |
F |
Sept. 26, 2019, 10:36 a.m. |
OK |
GNU C++11 |
TESTS |
50 |
358 |
93593600 |
|
2800 |
66690814 |
songpengyu |
F |
Dec. 12, 2019, 1:59 p.m. |
OK |
GNU C++11 |
TESTS |
50 |
373 |
40857600 |
|
2800 |
60378795 |
PinkRabbit |
F |
Sept. 11, 2019, 8:01 a.m. |
OK |
GNU C++11 |
TESTS |
50 |
374 |
34304000 |
|
2800 |
60378770 |
vjudge1 |
F |
Sept. 11, 2019, 8 a.m. |
OK |
GNU C++14 |
TESTS |
50 |
405 |
34406400 |
|
2800 |
60231609 |
krijgertje |
F |
Sept. 7, 2019, 4:40 p.m. |
OK |
GNU C++14 |
TESTS |
50 |
436 |
29696000 |
|
2800 |
60307337 |
ankurdua15 |
F |
Sept. 9, 2019, 2:24 p.m. |
OK |
GNU C++14 |
TESTS |
50 |
545 |
27443200 |
|
2800 |
60307305 |
ankurdua15 |
F |
Sept. 9, 2019, 2:23 p.m. |
OK |
GNU C++14 |
TESTS |
50 |
561 |
25600000 |
|
2800 |
60307570 |
ankurdua15 |
F |
Sept. 9, 2019, 2:29 p.m. |
OK |
GNU C++14 |
TESTS |
50 |
561 |
27340800 |
|
2800 |
60307223 |
ankurdua15 |
F |
Sept. 9, 2019, 2:21 p.m. |
OK |
GNU C++14 |
TESTS |
50 |
592 |
24678400 |
|
2800 |
60194071 |
beginend |
F |
Sept. 7, 2019, 12:01 a.m. |
OK |
GNU C++14 |
TESTS |
50 |
624 |
73318400 |
|
2800 |
60306696 |
ankurdua15 |
F |
Sept. 9, 2019, 2:09 p.m. |
OK |
GNU C++14 |
TESTS |
50 |
701 |
23244800 |
|
2800 |
60307184 |
ankurdua15 |
F |
Sept. 9, 2019, 2:21 p.m. |
OK |
GNU C++14 |
TESTS |
50 |
701 |
23347200 |
|
2800 |
60307125 |
ankurdua15 |
F |
Sept. 9, 2019, 2:20 p.m. |
OK |
GNU C++14 |
TESTS |
50 |
701 |
23552000 |
|
2800 |
60198137 |
nhho |
F |
Sept. 7, 2019, 3:21 a.m. |
OK |
GNU C++17 |
TESTS |
50 |
390 |
22323200 |
|
2800 |
60900547 |
tourist_plus_kan |
F |
Sept. 19, 2019, 9:08 p.m. |
OK |
GNU C++17 |
TESTS |
50 |
451 |
29696000 |
|
2800 |
60149841 |
Elegia |
F |
Sept. 6, 2019, 3:12 a.m. |
OK |
GNU C++17 |
TESTS |
50 |
482 |
218214400 |
|
2800 |
60198120 |
nhho |
F |
Sept. 7, 2019, 3:20 a.m. |
OK |
GNU C++17 |
TESTS |
50 |
498 |
22118400 |
|
2800 |
60251457 |
xz153531 |
F |
Sept. 8, 2019, 7:02 a.m. |
OK |
GNU C++17 |
TESTS |
50 |
529 |
72601600 |
|
2800 |
60371268 |
AuqaKyz |
F |
Sept. 11, 2019, 2:10 a.m. |
OK |
GNU C++17 |
TESTS |
50 |
530 |
82944000 |
|
2800 |
60145166 |
Ahmed2005 |
F |
Sept. 5, 2019, 11:10 p.m. |
OK |
GNU C++17 |
TESTS |
50 |
623 |
220160000 |
|
2800 |
62399058 |
codgician |
F |
Oct. 12, 2019, 6:40 a.m. |
OK |
GNU C++17 |
TESTS |
50 |
655 |
60006400 |
|
2800 |
69467936 |
vjudge4 |
F |
Jan. 24, 2020, 1:34 p.m. |
OK |
GNU C++17 |
TESTS |
50 |
670 |
73625600 |
|
2800 |
60390143 |
wzw19991105 |
F |
Sept. 11, 2019, 1 p.m. |
OK |
GNU C++17 |
TESTS |
50 |
670 |
108748800 |
|
2800 |
60863654 |
uwi |
F |
Sept. 19, 2019, 3:01 p.m. |
OK |
Java 8 |
TESTS |
50 |
950 |
132608000 |
|
2800 |
60266090 |
dalt |
F |
Sept. 8, 2019, 1:27 p.m. |
OK |
Java 8 |
TESTS |
50 |
1777 |
258867200 |
|
2800 |
remove filters
Back to search problems