#include "parks.h"
#include <bits/stdc++.h>
using namespace std;
#define sp " "
#define endl "\n"
#define fileio() freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout)
#define pb push_back
#define pii pair<int, int>
#define fastio() cin.tie(0), ios_base::sync_with_stdio(0)
#define st first
#define nd second
#define ll long long
#define LL node * 2
#define RR node * 2 + 1
#define N 300005
const int modulo = 1e9 + 7;
const ll INF = 2e18 + 7;
int par[N], sz[N], TOT;
pii rev[N];
int find(int node){
if (par[node] == node) return node;
return par[node] = find(par[node]);
}
void uni(int a, int b){
a = find(a), b = find(b);
if (a == b) return;
TOT--;
if (sz[a] < sz[b]) swap(a, b);
par[b] = a;
sz[a] += b;
}
int construct_roads(vector<int> x, vector<int> y) {
if (x.size() == 1) {
build({}, {}, {}, {});
return 1;
}
map<pii ,int> ind;
int n = x.size();
vector<array<int, 3>> srt;
for (int i = 0; i < n; i++) srt.pb({x[i], y[i], i});
sort(srt.begin(), srt.end());
for (int i = 0; i < n; i++) x[i] = srt[i][0], y[i] = srt[i][1];
for (int i = 0; i < n; i++){
ind[{x[i], y[i]}] = i;
sz[i] = 1, par[i] = i;
}
vector<pii> dir = {{0, -2}, {0, 2}, {-2, 0}, {2, 0}};
vector<pii> edges, b1, b2;
map<pii, int> cnt;
map<pii, set<int>> rev2;
int cntr = 0;
for (int K = 0; K < 4; K++){
pii k = dir[K];
vector<int> todo(n, 0);
iota(todo.begin(), todo.end(), 0);
if (K <= 1) sort(todo.begin(), todo.end(), [&](int a, int b){
return y[a] < y[b];
});
for (int I = 0; I < n; I++){
int i = todo[I];
int a = x[i], b = y[i];
int c = a + k.st, d = b + k.nd;
if (ind.count({c, d}) && ind[{c, d}] > i){
int g = (a + c) / 2, h = (b + d) / 2;
pii f1, f2;
if (b == d){
f1 = {g, h + 1};
f2 = {g, h - 1};
}
else{
f1 = {g + 1, h};
f2 = {g - 1, h};
}
edges.pb({i, ind[{c, d}]});
b1.pb(f1);
b2.pb(f2);
rev2[f1].insert(cntr);
rev2[f2].insert(cntr);
cnt[f1]++;
cnt[f2]++;
cntr++;
}
}
}
queue<int> q;
for (int i = 0; i < cntr; i++){
if (cnt[b1[i]] == 1 || cnt[b2[i]] == 1) q.push(i);
}
vector<int> u, v, a, b;
set<int> undone;
for (int i = 0; i < cntr; i++) undone.insert(i);
TOT = n;
while(TOT > 1){
while(!q.empty()){
int top = q.front();
q.pop();
if (undone.count(top) == 0) continue;
pii todo = {-1, -1};
if (cnt[b1[top]] == 1) todo = b1[top];
else if (cnt[b2[top]] == 1) todo = b2[top];
if (todo.st == -1) continue;
a.pb(todo.st), b.pb(todo.nd);
vector<pii> V = {b1[top], b2[top]};
for (auto i : V){
cnt[i]--;
rev2[i].erase(top);
if (rev2[i].size()){
q.push(*rev2[i].begin());
}
}
u.pb(srt[edges[top].st][2]);
v.pb(srt[edges[top].nd][2]);
uni(edges[top].st, edges[top].nd);
undone.erase(top);
}
if (TOT == 1) break;
auto it = undone.begin();
while(it != undone.end()){
int i = *it;
if (find(edges[i].st) == find(edges[i].nd)) it = undone.erase(it);
else if (cnt[b1[i]] == 0 && cnt[b2[i]] == 0) it = undone.erase(it);
else break;
}
if (undone.empty()) break;
int tmp = *undone.begin();
cnt[b1[tmp]] = 1;
q.push(tmp);
}
if (TOT == 1){
build(u, v, a, b);
return 1;
}
return 0;
}
/*
static void check(bool cond, string message) {
if (!cond) {
printf("%s\n", message.c_str());
fclose(stdout);
exit(0);
}
}
static int n;
static bool build_called;
static int m;
static vector<int> _u, _v, _a, _b;
void build(vector<int> u, vector<int> v, vector<int> a, vector<int> b) {
check(!build_called, "build is called more than once");
build_called = true;
m = u.size();
check(int(v.size()) == m, "u.size() != v.size()");
check(int(a.size()) == m, "u.size() != a.size()");
check(int(b.size()) == m, "u.size() != b.size()");
_u = u;
_v = v;
_a = a;
_b = b;
}
int main() {
fileio();
assert(scanf("%d", &n) == 1);
vector<int> x(n), y(n);
for (int i = 0; i < n; i++) {
assert(scanf("%d%d", &x[i], &y[i]) == 2);
}
fclose(stdin);
build_called = false;
const int possible = construct_roads(x, y);
check(possible == 0 || possible == 1, "Invalid return value of construct_roads()");
if (possible == 1) {
check(build_called, "construct_roads() returned 1 without calling build()");
} else {
check(!build_called, "construct_roads() called build() but returned 0");
}
printf("%d\n", possible);
if (possible == 1) {
printf("%d\n", m);
for (int j = 0; j < m; j++) {
printf("%d %d %d %d\n", _u[j], _v[j], _a[j], _b[j]);
}
}
fclose(stdout);
return 0;
}*/
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
2396 KB |
Output is correct |
3 |
Correct |
1 ms |
2392 KB |
Output is correct |
4 |
Correct |
0 ms |
2396 KB |
Output is correct |
5 |
Correct |
1 ms |
2396 KB |
Output is correct |
6 |
Correct |
1 ms |
2396 KB |
Output is correct |
7 |
Correct |
1 ms |
2648 KB |
Output is correct |
8 |
Correct |
0 ms |
2396 KB |
Output is correct |
9 |
Correct |
332 ms |
64968 KB |
Output is correct |
10 |
Correct |
30 ms |
8272 KB |
Output is correct |
11 |
Correct |
148 ms |
34768 KB |
Output is correct |
12 |
Correct |
30 ms |
11036 KB |
Output is correct |
13 |
Correct |
102 ms |
28368 KB |
Output is correct |
14 |
Correct |
2 ms |
2904 KB |
Output is correct |
15 |
Correct |
4 ms |
3420 KB |
Output is correct |
16 |
Correct |
288 ms |
65000 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
2396 KB |
Output is correct |
3 |
Correct |
1 ms |
2392 KB |
Output is correct |
4 |
Correct |
0 ms |
2396 KB |
Output is correct |
5 |
Correct |
1 ms |
2396 KB |
Output is correct |
6 |
Correct |
1 ms |
2396 KB |
Output is correct |
7 |
Correct |
1 ms |
2648 KB |
Output is correct |
8 |
Correct |
0 ms |
2396 KB |
Output is correct |
9 |
Correct |
332 ms |
64968 KB |
Output is correct |
10 |
Correct |
30 ms |
8272 KB |
Output is correct |
11 |
Correct |
148 ms |
34768 KB |
Output is correct |
12 |
Correct |
30 ms |
11036 KB |
Output is correct |
13 |
Correct |
102 ms |
28368 KB |
Output is correct |
14 |
Correct |
2 ms |
2904 KB |
Output is correct |
15 |
Correct |
4 ms |
3420 KB |
Output is correct |
16 |
Correct |
288 ms |
65000 KB |
Output is correct |
17 |
Correct |
1 ms |
2396 KB |
Output is correct |
18 |
Correct |
0 ms |
2396 KB |
Output is correct |
19 |
Correct |
0 ms |
2396 KB |
Output is correct |
20 |
Correct |
1 ms |
2396 KB |
Output is correct |
21 |
Correct |
0 ms |
2396 KB |
Output is correct |
22 |
Correct |
0 ms |
2396 KB |
Output is correct |
23 |
Correct |
859 ms |
142228 KB |
Output is correct |
24 |
Correct |
0 ms |
2396 KB |
Output is correct |
25 |
Correct |
3 ms |
3084 KB |
Output is correct |
26 |
Correct |
7 ms |
4260 KB |
Output is correct |
27 |
Correct |
9 ms |
4700 KB |
Output is correct |
28 |
Correct |
291 ms |
51964 KB |
Output is correct |
29 |
Correct |
480 ms |
80608 KB |
Output is correct |
30 |
Correct |
649 ms |
109188 KB |
Output is correct |
31 |
Correct |
840 ms |
138428 KB |
Output is correct |
32 |
Correct |
1 ms |
2396 KB |
Output is correct |
33 |
Correct |
0 ms |
2396 KB |
Output is correct |
34 |
Correct |
0 ms |
2396 KB |
Output is correct |
35 |
Correct |
1 ms |
2396 KB |
Output is correct |
36 |
Correct |
1 ms |
2392 KB |
Output is correct |
37 |
Correct |
1 ms |
2396 KB |
Output is correct |
38 |
Correct |
0 ms |
2396 KB |
Output is correct |
39 |
Correct |
0 ms |
2396 KB |
Output is correct |
40 |
Correct |
1 ms |
2396 KB |
Output is correct |
41 |
Correct |
1 ms |
2396 KB |
Output is correct |
42 |
Correct |
0 ms |
2396 KB |
Output is correct |
43 |
Correct |
4 ms |
3420 KB |
Output is correct |
44 |
Correct |
5 ms |
3932 KB |
Output is correct |
45 |
Correct |
289 ms |
53628 KB |
Output is correct |
46 |
Correct |
461 ms |
80064 KB |
Output is correct |
47 |
Correct |
449 ms |
80644 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
2396 KB |
Output is correct |
3 |
Correct |
1 ms |
2392 KB |
Output is correct |
4 |
Correct |
0 ms |
2396 KB |
Output is correct |
5 |
Correct |
1 ms |
2396 KB |
Output is correct |
6 |
Correct |
1 ms |
2396 KB |
Output is correct |
7 |
Correct |
1 ms |
2648 KB |
Output is correct |
8 |
Correct |
0 ms |
2396 KB |
Output is correct |
9 |
Correct |
332 ms |
64968 KB |
Output is correct |
10 |
Correct |
30 ms |
8272 KB |
Output is correct |
11 |
Correct |
148 ms |
34768 KB |
Output is correct |
12 |
Correct |
30 ms |
11036 KB |
Output is correct |
13 |
Correct |
102 ms |
28368 KB |
Output is correct |
14 |
Correct |
2 ms |
2904 KB |
Output is correct |
15 |
Correct |
4 ms |
3420 KB |
Output is correct |
16 |
Correct |
288 ms |
65000 KB |
Output is correct |
17 |
Correct |
1 ms |
2396 KB |
Output is correct |
18 |
Correct |
0 ms |
2396 KB |
Output is correct |
19 |
Correct |
0 ms |
2396 KB |
Output is correct |
20 |
Correct |
1 ms |
2396 KB |
Output is correct |
21 |
Correct |
0 ms |
2396 KB |
Output is correct |
22 |
Correct |
0 ms |
2396 KB |
Output is correct |
23 |
Correct |
859 ms |
142228 KB |
Output is correct |
24 |
Correct |
0 ms |
2396 KB |
Output is correct |
25 |
Correct |
3 ms |
3084 KB |
Output is correct |
26 |
Correct |
7 ms |
4260 KB |
Output is correct |
27 |
Correct |
9 ms |
4700 KB |
Output is correct |
28 |
Correct |
291 ms |
51964 KB |
Output is correct |
29 |
Correct |
480 ms |
80608 KB |
Output is correct |
30 |
Correct |
649 ms |
109188 KB |
Output is correct |
31 |
Correct |
840 ms |
138428 KB |
Output is correct |
32 |
Correct |
1 ms |
2396 KB |
Output is correct |
33 |
Correct |
0 ms |
2396 KB |
Output is correct |
34 |
Correct |
0 ms |
2396 KB |
Output is correct |
35 |
Correct |
1 ms |
2396 KB |
Output is correct |
36 |
Correct |
1 ms |
2392 KB |
Output is correct |
37 |
Correct |
1 ms |
2396 KB |
Output is correct |
38 |
Correct |
0 ms |
2396 KB |
Output is correct |
39 |
Correct |
0 ms |
2396 KB |
Output is correct |
40 |
Correct |
1 ms |
2396 KB |
Output is correct |
41 |
Correct |
1 ms |
2396 KB |
Output is correct |
42 |
Correct |
0 ms |
2396 KB |
Output is correct |
43 |
Correct |
4 ms |
3420 KB |
Output is correct |
44 |
Correct |
5 ms |
3932 KB |
Output is correct |
45 |
Correct |
289 ms |
53628 KB |
Output is correct |
46 |
Correct |
461 ms |
80064 KB |
Output is correct |
47 |
Correct |
449 ms |
80644 KB |
Output is correct |
48 |
Correct |
1 ms |
2396 KB |
Output is correct |
49 |
Correct |
0 ms |
2396 KB |
Output is correct |
50 |
Correct |
0 ms |
2396 KB |
Output is correct |
51 |
Correct |
0 ms |
2396 KB |
Output is correct |
52 |
Correct |
1 ms |
2396 KB |
Output is correct |
53 |
Correct |
1 ms |
2392 KB |
Output is correct |
54 |
Correct |
0 ms |
2396 KB |
Output is correct |
55 |
Correct |
964 ms |
141712 KB |
Output is correct |
56 |
Correct |
1 ms |
2392 KB |
Output is correct |
57 |
Correct |
6 ms |
3416 KB |
Output is correct |
58 |
Correct |
18 ms |
6096 KB |
Output is correct |
59 |
Correct |
26 ms |
8472 KB |
Output is correct |
60 |
Correct |
433 ms |
67264 KB |
Output is correct |
61 |
Correct |
616 ms |
91612 KB |
Output is correct |
62 |
Correct |
771 ms |
113300 KB |
Output is correct |
63 |
Correct |
923 ms |
141752 KB |
Output is correct |
64 |
Correct |
0 ms |
2396 KB |
Output is correct |
65 |
Correct |
1 ms |
2396 KB |
Output is correct |
66 |
Correct |
0 ms |
2396 KB |
Output is correct |
67 |
Correct |
693 ms |
129544 KB |
Output is correct |
68 |
Correct |
751 ms |
129972 KB |
Output is correct |
69 |
Correct |
707 ms |
128964 KB |
Output is correct |
70 |
Correct |
8 ms |
4440 KB |
Output is correct |
71 |
Correct |
16 ms |
6232 KB |
Output is correct |
72 |
Correct |
298 ms |
53100 KB |
Output is correct |
73 |
Correct |
520 ms |
81724 KB |
Output is correct |
74 |
Correct |
703 ms |
108076 KB |
Output is correct |
75 |
Correct |
774 ms |
125120 KB |
Output is correct |
76 |
Correct |
710 ms |
129876 KB |
Output is correct |
77 |
Correct |
10 ms |
4952 KB |
Output is correct |
78 |
Correct |
19 ms |
7156 KB |
Output is correct |
79 |
Correct |
332 ms |
56876 KB |
Output is correct |
80 |
Correct |
529 ms |
88544 KB |
Output is correct |
81 |
Correct |
717 ms |
116420 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
2396 KB |
Output is correct |
3 |
Correct |
1 ms |
2392 KB |
Output is correct |
4 |
Correct |
0 ms |
2396 KB |
Output is correct |
5 |
Correct |
1 ms |
2396 KB |
Output is correct |
6 |
Correct |
1 ms |
2396 KB |
Output is correct |
7 |
Correct |
1 ms |
2648 KB |
Output is correct |
8 |
Correct |
0 ms |
2396 KB |
Output is correct |
9 |
Correct |
332 ms |
64968 KB |
Output is correct |
10 |
Correct |
30 ms |
8272 KB |
Output is correct |
11 |
Correct |
148 ms |
34768 KB |
Output is correct |
12 |
Correct |
30 ms |
11036 KB |
Output is correct |
13 |
Correct |
102 ms |
28368 KB |
Output is correct |
14 |
Correct |
2 ms |
2904 KB |
Output is correct |
15 |
Correct |
4 ms |
3420 KB |
Output is correct |
16 |
Correct |
288 ms |
65000 KB |
Output is correct |
17 |
Correct |
1 ms |
2396 KB |
Output is correct |
18 |
Correct |
0 ms |
2396 KB |
Output is correct |
19 |
Correct |
1 ms |
2392 KB |
Output is correct |
20 |
Correct |
563 ms |
95560 KB |
Output is correct |
21 |
Correct |
549 ms |
95504 KB |
Output is correct |
22 |
Correct |
545 ms |
95824 KB |
Output is correct |
23 |
Correct |
499 ms |
111816 KB |
Output is correct |
24 |
Correct |
174 ms |
21184 KB |
Output is correct |
25 |
Correct |
607 ms |
123824 KB |
Output is correct |
26 |
Correct |
867 ms |
123444 KB |
Output is correct |
27 |
Correct |
900 ms |
129600 KB |
Output is correct |
28 |
Correct |
885 ms |
129476 KB |
Output is correct |
29 |
Correct |
652 ms |
129476 KB |
Output is correct |
30 |
Correct |
670 ms |
129996 KB |
Output is correct |
31 |
Correct |
1 ms |
2392 KB |
Output is correct |
32 |
Correct |
42 ms |
9112 KB |
Output is correct |
33 |
Correct |
65 ms |
11656 KB |
Output is correct |
34 |
Correct |
590 ms |
94852 KB |
Output is correct |
35 |
Correct |
25 ms |
7200 KB |
Output is correct |
36 |
Correct |
167 ms |
26116 KB |
Output is correct |
37 |
Correct |
427 ms |
49908 KB |
Output is correct |
38 |
Correct |
374 ms |
41324 KB |
Output is correct |
39 |
Correct |
556 ms |
55992 KB |
Output is correct |
40 |
Correct |
744 ms |
75024 KB |
Output is correct |
41 |
Correct |
953 ms |
89676 KB |
Output is correct |
42 |
Correct |
1148 ms |
103400 KB |
Output is correct |
43 |
Correct |
1 ms |
2392 KB |
Output is correct |
44 |
Correct |
0 ms |
2396 KB |
Output is correct |
45 |
Correct |
0 ms |
2396 KB |
Output is correct |
46 |
Correct |
1 ms |
2396 KB |
Output is correct |
47 |
Correct |
0 ms |
2396 KB |
Output is correct |
48 |
Correct |
0 ms |
2396 KB |
Output is correct |
49 |
Correct |
1 ms |
2396 KB |
Output is correct |
50 |
Correct |
0 ms |
2396 KB |
Output is correct |
51 |
Correct |
0 ms |
2396 KB |
Output is correct |
52 |
Correct |
0 ms |
2396 KB |
Output is correct |
53 |
Correct |
0 ms |
2396 KB |
Output is correct |
54 |
Correct |
4 ms |
3672 KB |
Output is correct |
55 |
Correct |
5 ms |
3936 KB |
Output is correct |
56 |
Correct |
329 ms |
53580 KB |
Output is correct |
57 |
Correct |
425 ms |
80324 KB |
Output is correct |
58 |
Correct |
505 ms |
81348 KB |
Output is correct |
59 |
Correct |
1 ms |
2396 KB |
Output is correct |
60 |
Correct |
0 ms |
2396 KB |
Output is correct |
61 |
Correct |
0 ms |
2396 KB |
Output is correct |
62 |
Correct |
654 ms |
129984 KB |
Output is correct |
63 |
Correct |
683 ms |
129476 KB |
Output is correct |
64 |
Correct |
659 ms |
129096 KB |
Output is correct |
65 |
Correct |
8 ms |
4440 KB |
Output is correct |
66 |
Correct |
23 ms |
6236 KB |
Output is correct |
67 |
Correct |
312 ms |
53108 KB |
Output is correct |
68 |
Correct |
512 ms |
82116 KB |
Output is correct |
69 |
Correct |
695 ms |
108236 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
2396 KB |
Output is correct |
3 |
Correct |
1 ms |
2392 KB |
Output is correct |
4 |
Correct |
0 ms |
2396 KB |
Output is correct |
5 |
Correct |
1 ms |
2396 KB |
Output is correct |
6 |
Correct |
1 ms |
2396 KB |
Output is correct |
7 |
Correct |
1 ms |
2648 KB |
Output is correct |
8 |
Correct |
0 ms |
2396 KB |
Output is correct |
9 |
Correct |
332 ms |
64968 KB |
Output is correct |
10 |
Correct |
30 ms |
8272 KB |
Output is correct |
11 |
Correct |
148 ms |
34768 KB |
Output is correct |
12 |
Correct |
30 ms |
11036 KB |
Output is correct |
13 |
Correct |
102 ms |
28368 KB |
Output is correct |
14 |
Correct |
2 ms |
2904 KB |
Output is correct |
15 |
Correct |
4 ms |
3420 KB |
Output is correct |
16 |
Correct |
288 ms |
65000 KB |
Output is correct |
17 |
Correct |
653 ms |
129956 KB |
Output is correct |
18 |
Correct |
620 ms |
128192 KB |
Output is correct |
19 |
Correct |
599 ms |
94904 KB |
Output is correct |
20 |
Correct |
1150 ms |
117748 KB |
Output is correct |
21 |
Correct |
724 ms |
112676 KB |
Output is correct |
22 |
Correct |
0 ms |
2396 KB |
Output is correct |
23 |
Correct |
117 ms |
18416 KB |
Output is correct |
24 |
Correct |
64 ms |
12868 KB |
Output is correct |
25 |
Correct |
304 ms |
39880 KB |
Output is correct |
26 |
Correct |
514 ms |
67012 KB |
Output is correct |
27 |
Correct |
587 ms |
57976 KB |
Output is correct |
28 |
Correct |
776 ms |
73364 KB |
Output is correct |
29 |
Correct |
926 ms |
88040 KB |
Output is correct |
30 |
Correct |
1135 ms |
101532 KB |
Output is correct |
31 |
Correct |
1327 ms |
114848 KB |
Output is correct |
32 |
Correct |
739 ms |
125124 KB |
Output is correct |
33 |
Correct |
675 ms |
129688 KB |
Output is correct |
34 |
Correct |
15 ms |
4956 KB |
Output is correct |
35 |
Correct |
19 ms |
7240 KB |
Output is correct |
36 |
Correct |
351 ms |
56900 KB |
Output is correct |
37 |
Correct |
579 ms |
88516 KB |
Output is correct |
38 |
Correct |
749 ms |
116292 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
2396 KB |
Output is correct |
3 |
Correct |
1 ms |
2392 KB |
Output is correct |
4 |
Correct |
0 ms |
2396 KB |
Output is correct |
5 |
Correct |
1 ms |
2396 KB |
Output is correct |
6 |
Correct |
1 ms |
2396 KB |
Output is correct |
7 |
Correct |
1 ms |
2648 KB |
Output is correct |
8 |
Correct |
0 ms |
2396 KB |
Output is correct |
9 |
Correct |
332 ms |
64968 KB |
Output is correct |
10 |
Correct |
30 ms |
8272 KB |
Output is correct |
11 |
Correct |
148 ms |
34768 KB |
Output is correct |
12 |
Correct |
30 ms |
11036 KB |
Output is correct |
13 |
Correct |
102 ms |
28368 KB |
Output is correct |
14 |
Correct |
2 ms |
2904 KB |
Output is correct |
15 |
Correct |
4 ms |
3420 KB |
Output is correct |
16 |
Correct |
288 ms |
65000 KB |
Output is correct |
17 |
Correct |
1 ms |
2396 KB |
Output is correct |
18 |
Correct |
0 ms |
2396 KB |
Output is correct |
19 |
Correct |
0 ms |
2396 KB |
Output is correct |
20 |
Correct |
1 ms |
2396 KB |
Output is correct |
21 |
Correct |
0 ms |
2396 KB |
Output is correct |
22 |
Correct |
0 ms |
2396 KB |
Output is correct |
23 |
Correct |
859 ms |
142228 KB |
Output is correct |
24 |
Correct |
0 ms |
2396 KB |
Output is correct |
25 |
Correct |
3 ms |
3084 KB |
Output is correct |
26 |
Correct |
7 ms |
4260 KB |
Output is correct |
27 |
Correct |
9 ms |
4700 KB |
Output is correct |
28 |
Correct |
291 ms |
51964 KB |
Output is correct |
29 |
Correct |
480 ms |
80608 KB |
Output is correct |
30 |
Correct |
649 ms |
109188 KB |
Output is correct |
31 |
Correct |
840 ms |
138428 KB |
Output is correct |
32 |
Correct |
1 ms |
2396 KB |
Output is correct |
33 |
Correct |
0 ms |
2396 KB |
Output is correct |
34 |
Correct |
0 ms |
2396 KB |
Output is correct |
35 |
Correct |
1 ms |
2396 KB |
Output is correct |
36 |
Correct |
1 ms |
2392 KB |
Output is correct |
37 |
Correct |
1 ms |
2396 KB |
Output is correct |
38 |
Correct |
0 ms |
2396 KB |
Output is correct |
39 |
Correct |
0 ms |
2396 KB |
Output is correct |
40 |
Correct |
1 ms |
2396 KB |
Output is correct |
41 |
Correct |
1 ms |
2396 KB |
Output is correct |
42 |
Correct |
0 ms |
2396 KB |
Output is correct |
43 |
Correct |
4 ms |
3420 KB |
Output is correct |
44 |
Correct |
5 ms |
3932 KB |
Output is correct |
45 |
Correct |
289 ms |
53628 KB |
Output is correct |
46 |
Correct |
461 ms |
80064 KB |
Output is correct |
47 |
Correct |
449 ms |
80644 KB |
Output is correct |
48 |
Correct |
1 ms |
2396 KB |
Output is correct |
49 |
Correct |
0 ms |
2396 KB |
Output is correct |
50 |
Correct |
0 ms |
2396 KB |
Output is correct |
51 |
Correct |
0 ms |
2396 KB |
Output is correct |
52 |
Correct |
1 ms |
2396 KB |
Output is correct |
53 |
Correct |
1 ms |
2392 KB |
Output is correct |
54 |
Correct |
0 ms |
2396 KB |
Output is correct |
55 |
Correct |
964 ms |
141712 KB |
Output is correct |
56 |
Correct |
1 ms |
2392 KB |
Output is correct |
57 |
Correct |
6 ms |
3416 KB |
Output is correct |
58 |
Correct |
18 ms |
6096 KB |
Output is correct |
59 |
Correct |
26 ms |
8472 KB |
Output is correct |
60 |
Correct |
433 ms |
67264 KB |
Output is correct |
61 |
Correct |
616 ms |
91612 KB |
Output is correct |
62 |
Correct |
771 ms |
113300 KB |
Output is correct |
63 |
Correct |
923 ms |
141752 KB |
Output is correct |
64 |
Correct |
0 ms |
2396 KB |
Output is correct |
65 |
Correct |
1 ms |
2396 KB |
Output is correct |
66 |
Correct |
0 ms |
2396 KB |
Output is correct |
67 |
Correct |
693 ms |
129544 KB |
Output is correct |
68 |
Correct |
751 ms |
129972 KB |
Output is correct |
69 |
Correct |
707 ms |
128964 KB |
Output is correct |
70 |
Correct |
8 ms |
4440 KB |
Output is correct |
71 |
Correct |
16 ms |
6232 KB |
Output is correct |
72 |
Correct |
298 ms |
53100 KB |
Output is correct |
73 |
Correct |
520 ms |
81724 KB |
Output is correct |
74 |
Correct |
703 ms |
108076 KB |
Output is correct |
75 |
Correct |
774 ms |
125120 KB |
Output is correct |
76 |
Correct |
710 ms |
129876 KB |
Output is correct |
77 |
Correct |
10 ms |
4952 KB |
Output is correct |
78 |
Correct |
19 ms |
7156 KB |
Output is correct |
79 |
Correct |
332 ms |
56876 KB |
Output is correct |
80 |
Correct |
529 ms |
88544 KB |
Output is correct |
81 |
Correct |
717 ms |
116420 KB |
Output is correct |
82 |
Correct |
1 ms |
2396 KB |
Output is correct |
83 |
Correct |
0 ms |
2396 KB |
Output is correct |
84 |
Correct |
1 ms |
2392 KB |
Output is correct |
85 |
Correct |
563 ms |
95560 KB |
Output is correct |
86 |
Correct |
549 ms |
95504 KB |
Output is correct |
87 |
Correct |
545 ms |
95824 KB |
Output is correct |
88 |
Correct |
499 ms |
111816 KB |
Output is correct |
89 |
Correct |
174 ms |
21184 KB |
Output is correct |
90 |
Correct |
607 ms |
123824 KB |
Output is correct |
91 |
Correct |
867 ms |
123444 KB |
Output is correct |
92 |
Correct |
900 ms |
129600 KB |
Output is correct |
93 |
Correct |
885 ms |
129476 KB |
Output is correct |
94 |
Correct |
652 ms |
129476 KB |
Output is correct |
95 |
Correct |
670 ms |
129996 KB |
Output is correct |
96 |
Correct |
1 ms |
2392 KB |
Output is correct |
97 |
Correct |
42 ms |
9112 KB |
Output is correct |
98 |
Correct |
65 ms |
11656 KB |
Output is correct |
99 |
Correct |
590 ms |
94852 KB |
Output is correct |
100 |
Correct |
25 ms |
7200 KB |
Output is correct |
101 |
Correct |
167 ms |
26116 KB |
Output is correct |
102 |
Correct |
427 ms |
49908 KB |
Output is correct |
103 |
Correct |
374 ms |
41324 KB |
Output is correct |
104 |
Correct |
556 ms |
55992 KB |
Output is correct |
105 |
Correct |
744 ms |
75024 KB |
Output is correct |
106 |
Correct |
953 ms |
89676 KB |
Output is correct |
107 |
Correct |
1148 ms |
103400 KB |
Output is correct |
108 |
Correct |
1 ms |
2392 KB |
Output is correct |
109 |
Correct |
0 ms |
2396 KB |
Output is correct |
110 |
Correct |
0 ms |
2396 KB |
Output is correct |
111 |
Correct |
1 ms |
2396 KB |
Output is correct |
112 |
Correct |
0 ms |
2396 KB |
Output is correct |
113 |
Correct |
0 ms |
2396 KB |
Output is correct |
114 |
Correct |
1 ms |
2396 KB |
Output is correct |
115 |
Correct |
0 ms |
2396 KB |
Output is correct |
116 |
Correct |
0 ms |
2396 KB |
Output is correct |
117 |
Correct |
0 ms |
2396 KB |
Output is correct |
118 |
Correct |
0 ms |
2396 KB |
Output is correct |
119 |
Correct |
4 ms |
3672 KB |
Output is correct |
120 |
Correct |
5 ms |
3936 KB |
Output is correct |
121 |
Correct |
329 ms |
53580 KB |
Output is correct |
122 |
Correct |
425 ms |
80324 KB |
Output is correct |
123 |
Correct |
505 ms |
81348 KB |
Output is correct |
124 |
Correct |
1 ms |
2396 KB |
Output is correct |
125 |
Correct |
0 ms |
2396 KB |
Output is correct |
126 |
Correct |
0 ms |
2396 KB |
Output is correct |
127 |
Correct |
654 ms |
129984 KB |
Output is correct |
128 |
Correct |
683 ms |
129476 KB |
Output is correct |
129 |
Correct |
659 ms |
129096 KB |
Output is correct |
130 |
Correct |
8 ms |
4440 KB |
Output is correct |
131 |
Correct |
23 ms |
6236 KB |
Output is correct |
132 |
Correct |
312 ms |
53108 KB |
Output is correct |
133 |
Correct |
512 ms |
82116 KB |
Output is correct |
134 |
Correct |
695 ms |
108236 KB |
Output is correct |
135 |
Correct |
653 ms |
129956 KB |
Output is correct |
136 |
Correct |
620 ms |
128192 KB |
Output is correct |
137 |
Correct |
599 ms |
94904 KB |
Output is correct |
138 |
Correct |
1150 ms |
117748 KB |
Output is correct |
139 |
Correct |
724 ms |
112676 KB |
Output is correct |
140 |
Correct |
0 ms |
2396 KB |
Output is correct |
141 |
Correct |
117 ms |
18416 KB |
Output is correct |
142 |
Correct |
64 ms |
12868 KB |
Output is correct |
143 |
Correct |
304 ms |
39880 KB |
Output is correct |
144 |
Correct |
514 ms |
67012 KB |
Output is correct |
145 |
Correct |
587 ms |
57976 KB |
Output is correct |
146 |
Correct |
776 ms |
73364 KB |
Output is correct |
147 |
Correct |
926 ms |
88040 KB |
Output is correct |
148 |
Correct |
1135 ms |
101532 KB |
Output is correct |
149 |
Correct |
1327 ms |
114848 KB |
Output is correct |
150 |
Correct |
739 ms |
125124 KB |
Output is correct |
151 |
Correct |
675 ms |
129688 KB |
Output is correct |
152 |
Correct |
15 ms |
4956 KB |
Output is correct |
153 |
Correct |
19 ms |
7240 KB |
Output is correct |
154 |
Correct |
351 ms |
56900 KB |
Output is correct |
155 |
Correct |
579 ms |
88516 KB |
Output is correct |
156 |
Correct |
749 ms |
116292 KB |
Output is correct |
157 |
Correct |
0 ms |
2396 KB |
Output is correct |
158 |
Correct |
0 ms |
2396 KB |
Output is correct |
159 |
Correct |
1 ms |
2396 KB |
Output is correct |
160 |
Correct |
0 ms |
2396 KB |
Output is correct |
161 |
Correct |
1368 ms |
129688 KB |
Output is correct |
162 |
Correct |
579 ms |
95872 KB |
Output is correct |
163 |
Correct |
672 ms |
113040 KB |
Output is correct |
164 |
Correct |
651 ms |
107804 KB |
Output is correct |
165 |
Incorrect |
833 ms |
123532 KB |
Tree @(44441, 44443) appears more than once: for edges on positions 199962 and 200006 |
166 |
Halted |
0 ms |
0 KB |
- |