// In the name of Allah
#include <bits/stdc++.h>
#include "parks.h"
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define endl '\n'
#define sep ' '
#define F first
#define S second
#define all(x) (x).begin(),(x).end()
#define len(x) ((ll) (x).size())
#define pb push_back
#define Mp make_pair
const int maxn = 1e6 + 4;
int n;
vector<pii> adj[maxn]; set<pii> E;
vector<pii> arr, arrx;
int val[maxn], D[maxn];
int mark[maxn], h[maxn];
vector<int> ux, vx, X1, Y1;
int GI(pii x) {
int j = lower_bound(all(arr), x) - arr.begin();
if (j < len(arr) && arr[j] == x) return j;
else return -1;
}
int GIx(pii x) {
int j = lower_bound(all(arrx), x) - arrx.begin();
if (j < len(arrx) && arrx[j] == x) return j;
else return -1;
}
bool ok(int x, int y) {
int j = GI(Mp(x, y));
return (j != -1);
}
void addE(int x1, int y1, int x2, int y2) {
int u = val[GI(Mp(x1, y1))], v = val[GI(Mp(x2, y2))];
if (u > v) swap(u, v);
E.insert(Mp(u, v));
D[u]++; D[v]++;
}
void delE(int x1, int y1, int x2, int y2) {
int u = val[GI(Mp(x1, y1))], v = val[GI(Mp(x2, y2))];
if (u > v) swap(u, v);
E.erase(Mp(u, v));
D[u]--; D[v]--;
}
void dfs(int v) {
mark[v] = 1;
for (auto f : adj[v]) {
int u = f.F;
if (!mark[u]) dfs(u);
}
}
void res_dfs(int v, int i = -1) {
mark[v] = 1;
for (auto f : adj[v]) {
int u = f.F, j = f.S;
if (!mark[u]) {
h[u] = h[v] + 1;
res_dfs(u, j);
X1[j] = arrx[u].F; Y1[j] = arrx[u].S;
}
else if (j != i && h[u] < h[v]) {
X1[j] = arrx[u].F; Y1[j] = arrx[u].S;
}
}
}
bool checkx() {
for (auto f : E) {
int u = f.F, v = f.S;
adj[u].pb(Mp(v, -1)); adj[v].pb(Mp(u, -1));
}
dfs(0);
for (int i = 0; i < n; i++) {
if (!mark[i]) return 0;
}
for (int i = 0; i < n; i++) {
mark[i] = 0; adj[i].clear();
}
return 1;
}
int construct_roads(vector<int> X, vector<int> Y) {
n = len(X);
for (int i = 0; i < n; i++) arr.pb(Mp(X[i], Y[i]));
sort(all(arr));
for (int i = 0; i < n; i++) {
int j = GI(Mp(X[i], Y[i]));
val[j] = i;
}
for (int i = 0; i < n; i++) {
if (ok(X[i], Y[i] + 2)) {
addE(X[i], Y[i], X[i], Y[i] + 2);
}
if (ok(X[i] + 2, Y[i]) && (!ok(X[i], Y[i] - 2) || !ok(X[i] + 2, Y[i] - 2))) {
addE(X[i], Y[i], X[i] + 2, Y[i]);
}
}
for (int i = 0; i < n; i++) {
if (D[i] == 4) {
if (ok(X[i] + 2, Y[i] + 2)) {
delE(X[i], Y[i], X[i] + 2, Y[i]);
addE(X[i], Y[i] + 2, X[i] + 2, Y[i] + 2);
}
else if (ok(X[i] - 2, Y[i] - 2)) {
delE(X[i], Y[i], X[i] - 2, Y[i]);
addE(X[i], Y[i] - 2, X[i] - 2, Y[i] - 2);
}
}
}
if (!checkx()) return 0;
for (auto f : E) {
int u = f.F, v = f.S; pii f1, f2;
int x = (X[u] + X[v]) / 2, y = (Y[u] + Y[v]) / 2;
if (X[u] == X[v]) {
f1 = Mp(x - 1, y); f2 = Mp(x + 1, y);
}
else {
f1 = Mp(x, y - 1); f2 = Mp(x, y + 1);
}
arrx.pb(f1); arrx.pb(f2);
}
sort(all(arrx)); arrx.resize(unique(all(arrx)) - arrx.begin());
for (auto f : E) {
int u = f.F, v = f.S; pii f1, f2;
int x = (X[u] + X[v]) / 2, y = (Y[u] + Y[v]) / 2;
if (X[u] == X[v]) {
f1 = Mp(x - 1, y); f2 = Mp(x + 1, y);
}
else {
f1 = Mp(x, y - 1); f2 = Mp(x, y + 1);
}
int u1 = GIx(f1), v1 = GIx(f2);
adj[u1].pb(Mp(v1, len(ux))); adj[v1].pb(Mp(u1, len(ux)));
ux.pb(u); vx.pb(v);
}
X1.resize(len(ux)); Y1.resize(len(ux));
for (int i = 0; i < len(arrx); i++) {
if (!mark[i]) res_dfs(i);
}
build(ux, vx, X1, Y1);
return 1;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
29272 KB |
Output is correct |
2 |
Correct |
4 ms |
31064 KB |
Output is correct |
3 |
Correct |
4 ms |
29020 KB |
Output is correct |
4 |
Correct |
4 ms |
31068 KB |
Output is correct |
5 |
Correct |
5 ms |
31068 KB |
Output is correct |
6 |
Correct |
4 ms |
31068 KB |
Output is correct |
7 |
Correct |
4 ms |
31200 KB |
Output is correct |
8 |
Correct |
5 ms |
31068 KB |
Output is correct |
9 |
Correct |
154 ms |
56888 KB |
Output is correct |
10 |
Correct |
13 ms |
33492 KB |
Output is correct |
11 |
Correct |
49 ms |
45724 KB |
Output is correct |
12 |
Correct |
16 ms |
34776 KB |
Output is correct |
13 |
Correct |
25 ms |
36560 KB |
Output is correct |
14 |
Correct |
5 ms |
31320 KB |
Output is correct |
15 |
Correct |
5 ms |
31428 KB |
Output is correct |
16 |
Correct |
158 ms |
55996 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
29272 KB |
Output is correct |
2 |
Correct |
4 ms |
31064 KB |
Output is correct |
3 |
Correct |
4 ms |
29020 KB |
Output is correct |
4 |
Correct |
4 ms |
31068 KB |
Output is correct |
5 |
Correct |
5 ms |
31068 KB |
Output is correct |
6 |
Correct |
4 ms |
31068 KB |
Output is correct |
7 |
Correct |
4 ms |
31200 KB |
Output is correct |
8 |
Correct |
5 ms |
31068 KB |
Output is correct |
9 |
Correct |
154 ms |
56888 KB |
Output is correct |
10 |
Correct |
13 ms |
33492 KB |
Output is correct |
11 |
Correct |
49 ms |
45724 KB |
Output is correct |
12 |
Correct |
16 ms |
34776 KB |
Output is correct |
13 |
Correct |
25 ms |
36560 KB |
Output is correct |
14 |
Correct |
5 ms |
31320 KB |
Output is correct |
15 |
Correct |
5 ms |
31428 KB |
Output is correct |
16 |
Correct |
158 ms |
55996 KB |
Output is correct |
17 |
Correct |
5 ms |
31068 KB |
Output is correct |
18 |
Correct |
5 ms |
31068 KB |
Output is correct |
19 |
Correct |
5 ms |
31068 KB |
Output is correct |
20 |
Correct |
4 ms |
31068 KB |
Output is correct |
21 |
Correct |
4 ms |
31068 KB |
Output is correct |
22 |
Correct |
5 ms |
31068 KB |
Output is correct |
23 |
Correct |
367 ms |
82836 KB |
Output is correct |
24 |
Correct |
5 ms |
31068 KB |
Output is correct |
25 |
Correct |
5 ms |
31464 KB |
Output is correct |
26 |
Correct |
6 ms |
31324 KB |
Output is correct |
27 |
Correct |
7 ms |
31576 KB |
Output is correct |
28 |
Correct |
125 ms |
50888 KB |
Output is correct |
29 |
Correct |
197 ms |
59020 KB |
Output is correct |
30 |
Correct |
267 ms |
70224 KB |
Output is correct |
31 |
Correct |
381 ms |
82204 KB |
Output is correct |
32 |
Correct |
5 ms |
31068 KB |
Output is correct |
33 |
Correct |
4 ms |
31068 KB |
Output is correct |
34 |
Correct |
4 ms |
31068 KB |
Output is correct |
35 |
Correct |
4 ms |
29016 KB |
Output is correct |
36 |
Correct |
4 ms |
28936 KB |
Output is correct |
37 |
Correct |
4 ms |
31068 KB |
Output is correct |
38 |
Correct |
4 ms |
31204 KB |
Output is correct |
39 |
Correct |
5 ms |
31068 KB |
Output is correct |
40 |
Correct |
5 ms |
31064 KB |
Output is correct |
41 |
Correct |
4 ms |
29020 KB |
Output is correct |
42 |
Correct |
5 ms |
31068 KB |
Output is correct |
43 |
Correct |
7 ms |
31324 KB |
Output is correct |
44 |
Correct |
8 ms |
31324 KB |
Output is correct |
45 |
Correct |
159 ms |
54868 KB |
Output is correct |
46 |
Correct |
259 ms |
67280 KB |
Output is correct |
47 |
Correct |
248 ms |
68048 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
29272 KB |
Output is correct |
2 |
Correct |
4 ms |
31064 KB |
Output is correct |
3 |
Correct |
4 ms |
29020 KB |
Output is correct |
4 |
Correct |
4 ms |
31068 KB |
Output is correct |
5 |
Correct |
5 ms |
31068 KB |
Output is correct |
6 |
Correct |
4 ms |
31068 KB |
Output is correct |
7 |
Correct |
4 ms |
31200 KB |
Output is correct |
8 |
Correct |
5 ms |
31068 KB |
Output is correct |
9 |
Correct |
154 ms |
56888 KB |
Output is correct |
10 |
Correct |
13 ms |
33492 KB |
Output is correct |
11 |
Correct |
49 ms |
45724 KB |
Output is correct |
12 |
Correct |
16 ms |
34776 KB |
Output is correct |
13 |
Correct |
25 ms |
36560 KB |
Output is correct |
14 |
Correct |
5 ms |
31320 KB |
Output is correct |
15 |
Correct |
5 ms |
31428 KB |
Output is correct |
16 |
Correct |
158 ms |
55996 KB |
Output is correct |
17 |
Correct |
5 ms |
31068 KB |
Output is correct |
18 |
Correct |
5 ms |
31068 KB |
Output is correct |
19 |
Correct |
5 ms |
31068 KB |
Output is correct |
20 |
Correct |
4 ms |
31068 KB |
Output is correct |
21 |
Correct |
4 ms |
31068 KB |
Output is correct |
22 |
Correct |
5 ms |
31068 KB |
Output is correct |
23 |
Correct |
367 ms |
82836 KB |
Output is correct |
24 |
Correct |
5 ms |
31068 KB |
Output is correct |
25 |
Correct |
5 ms |
31464 KB |
Output is correct |
26 |
Correct |
6 ms |
31324 KB |
Output is correct |
27 |
Correct |
7 ms |
31576 KB |
Output is correct |
28 |
Correct |
125 ms |
50888 KB |
Output is correct |
29 |
Correct |
197 ms |
59020 KB |
Output is correct |
30 |
Correct |
267 ms |
70224 KB |
Output is correct |
31 |
Correct |
381 ms |
82204 KB |
Output is correct |
32 |
Correct |
5 ms |
31068 KB |
Output is correct |
33 |
Correct |
4 ms |
31068 KB |
Output is correct |
34 |
Correct |
4 ms |
31068 KB |
Output is correct |
35 |
Correct |
4 ms |
29016 KB |
Output is correct |
36 |
Correct |
4 ms |
28936 KB |
Output is correct |
37 |
Correct |
4 ms |
31068 KB |
Output is correct |
38 |
Correct |
4 ms |
31204 KB |
Output is correct |
39 |
Correct |
5 ms |
31068 KB |
Output is correct |
40 |
Correct |
5 ms |
31064 KB |
Output is correct |
41 |
Correct |
4 ms |
29020 KB |
Output is correct |
42 |
Correct |
5 ms |
31068 KB |
Output is correct |
43 |
Correct |
7 ms |
31324 KB |
Output is correct |
44 |
Correct |
8 ms |
31324 KB |
Output is correct |
45 |
Correct |
159 ms |
54868 KB |
Output is correct |
46 |
Correct |
259 ms |
67280 KB |
Output is correct |
47 |
Correct |
248 ms |
68048 KB |
Output is correct |
48 |
Correct |
4 ms |
31064 KB |
Output is correct |
49 |
Correct |
5 ms |
31068 KB |
Output is correct |
50 |
Correct |
4 ms |
31140 KB |
Output is correct |
51 |
Correct |
4 ms |
31068 KB |
Output is correct |
52 |
Correct |
4 ms |
31068 KB |
Output is correct |
53 |
Correct |
5 ms |
31068 KB |
Output is correct |
54 |
Correct |
5 ms |
31184 KB |
Output is correct |
55 |
Correct |
379 ms |
80320 KB |
Output is correct |
56 |
Correct |
5 ms |
31064 KB |
Output is correct |
57 |
Correct |
7 ms |
31580 KB |
Output is correct |
58 |
Correct |
11 ms |
32492 KB |
Output is correct |
59 |
Correct |
14 ms |
32092 KB |
Output is correct |
60 |
Correct |
175 ms |
53460 KB |
Output is correct |
61 |
Correct |
226 ms |
63512 KB |
Output is correct |
62 |
Correct |
291 ms |
70456 KB |
Output is correct |
63 |
Correct |
378 ms |
79648 KB |
Output is correct |
64 |
Correct |
4 ms |
29020 KB |
Output is correct |
65 |
Correct |
4 ms |
31068 KB |
Output is correct |
66 |
Correct |
5 ms |
29020 KB |
Output is correct |
67 |
Correct |
368 ms |
84344 KB |
Output is correct |
68 |
Correct |
360 ms |
85284 KB |
Output is correct |
69 |
Correct |
355 ms |
85024 KB |
Output is correct |
70 |
Correct |
7 ms |
31576 KB |
Output is correct |
71 |
Correct |
10 ms |
31996 KB |
Output is correct |
72 |
Correct |
171 ms |
53976 KB |
Output is correct |
73 |
Correct |
267 ms |
68772 KB |
Output is correct |
74 |
Correct |
371 ms |
79636 KB |
Output is correct |
75 |
Correct |
435 ms |
87928 KB |
Output is correct |
76 |
Correct |
364 ms |
85788 KB |
Output is correct |
77 |
Correct |
8 ms |
31832 KB |
Output is correct |
78 |
Correct |
11 ms |
32092 KB |
Output is correct |
79 |
Correct |
175 ms |
55824 KB |
Output is correct |
80 |
Correct |
291 ms |
70052 KB |
Output is correct |
81 |
Correct |
404 ms |
83736 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
29272 KB |
Output is correct |
2 |
Correct |
4 ms |
31064 KB |
Output is correct |
3 |
Correct |
4 ms |
29020 KB |
Output is correct |
4 |
Correct |
4 ms |
31068 KB |
Output is correct |
5 |
Correct |
5 ms |
31068 KB |
Output is correct |
6 |
Correct |
4 ms |
31068 KB |
Output is correct |
7 |
Correct |
4 ms |
31200 KB |
Output is correct |
8 |
Correct |
5 ms |
31068 KB |
Output is correct |
9 |
Correct |
154 ms |
56888 KB |
Output is correct |
10 |
Correct |
13 ms |
33492 KB |
Output is correct |
11 |
Correct |
49 ms |
45724 KB |
Output is correct |
12 |
Correct |
16 ms |
34776 KB |
Output is correct |
13 |
Correct |
25 ms |
36560 KB |
Output is correct |
14 |
Correct |
5 ms |
31320 KB |
Output is correct |
15 |
Correct |
5 ms |
31428 KB |
Output is correct |
16 |
Correct |
158 ms |
55996 KB |
Output is correct |
17 |
Correct |
5 ms |
31068 KB |
Output is correct |
18 |
Correct |
5 ms |
31188 KB |
Output is correct |
19 |
Correct |
5 ms |
31064 KB |
Output is correct |
20 |
Correct |
355 ms |
93140 KB |
Output is correct |
21 |
Correct |
351 ms |
84848 KB |
Output is correct |
22 |
Correct |
344 ms |
84764 KB |
Output is correct |
23 |
Correct |
309 ms |
75520 KB |
Output is correct |
24 |
Correct |
91 ms |
37568 KB |
Output is correct |
25 |
Correct |
210 ms |
57632 KB |
Output is correct |
26 |
Correct |
196 ms |
57544 KB |
Output is correct |
27 |
Correct |
361 ms |
81944 KB |
Output is correct |
28 |
Correct |
365 ms |
82196 KB |
Output is correct |
29 |
Correct |
442 ms |
81428 KB |
Output is correct |
30 |
Correct |
383 ms |
81520 KB |
Output is correct |
31 |
Correct |
5 ms |
31068 KB |
Output is correct |
32 |
Correct |
25 ms |
34284 KB |
Output is correct |
33 |
Correct |
48 ms |
32912 KB |
Output is correct |
34 |
Correct |
356 ms |
93292 KB |
Output is correct |
35 |
Correct |
16 ms |
32344 KB |
Output is correct |
36 |
Correct |
51 ms |
36944 KB |
Output is correct |
37 |
Correct |
112 ms |
42884 KB |
Output is correct |
38 |
Correct |
136 ms |
50116 KB |
Output is correct |
39 |
Correct |
218 ms |
56292 KB |
Output is correct |
40 |
Correct |
257 ms |
65004 KB |
Output is correct |
41 |
Correct |
336 ms |
72128 KB |
Output is correct |
42 |
Correct |
364 ms |
79312 KB |
Output is correct |
43 |
Correct |
4 ms |
31068 KB |
Output is correct |
44 |
Correct |
4 ms |
31068 KB |
Output is correct |
45 |
Correct |
4 ms |
31068 KB |
Output is correct |
46 |
Correct |
4 ms |
29020 KB |
Output is correct |
47 |
Correct |
4 ms |
29020 KB |
Output is correct |
48 |
Correct |
4 ms |
31064 KB |
Output is correct |
49 |
Correct |
4 ms |
31068 KB |
Output is correct |
50 |
Correct |
4 ms |
31064 KB |
Output is correct |
51 |
Correct |
5 ms |
31064 KB |
Output is correct |
52 |
Correct |
4 ms |
29020 KB |
Output is correct |
53 |
Correct |
4 ms |
31040 KB |
Output is correct |
54 |
Correct |
5 ms |
31212 KB |
Output is correct |
55 |
Correct |
6 ms |
31320 KB |
Output is correct |
56 |
Correct |
163 ms |
54660 KB |
Output is correct |
57 |
Correct |
259 ms |
68556 KB |
Output is correct |
58 |
Correct |
252 ms |
68304 KB |
Output is correct |
59 |
Correct |
4 ms |
29016 KB |
Output is correct |
60 |
Correct |
5 ms |
31064 KB |
Output is correct |
61 |
Correct |
4 ms |
29020 KB |
Output is correct |
62 |
Correct |
397 ms |
85136 KB |
Output is correct |
63 |
Correct |
373 ms |
85020 KB |
Output is correct |
64 |
Correct |
387 ms |
85228 KB |
Output is correct |
65 |
Correct |
7 ms |
31576 KB |
Output is correct |
66 |
Correct |
11 ms |
31972 KB |
Output is correct |
67 |
Correct |
162 ms |
53924 KB |
Output is correct |
68 |
Correct |
261 ms |
68260 KB |
Output is correct |
69 |
Correct |
376 ms |
79832 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
29272 KB |
Output is correct |
2 |
Correct |
4 ms |
31064 KB |
Output is correct |
3 |
Correct |
4 ms |
29020 KB |
Output is correct |
4 |
Correct |
4 ms |
31068 KB |
Output is correct |
5 |
Correct |
5 ms |
31068 KB |
Output is correct |
6 |
Correct |
4 ms |
31068 KB |
Output is correct |
7 |
Correct |
4 ms |
31200 KB |
Output is correct |
8 |
Correct |
5 ms |
31068 KB |
Output is correct |
9 |
Correct |
154 ms |
56888 KB |
Output is correct |
10 |
Correct |
13 ms |
33492 KB |
Output is correct |
11 |
Correct |
49 ms |
45724 KB |
Output is correct |
12 |
Correct |
16 ms |
34776 KB |
Output is correct |
13 |
Correct |
25 ms |
36560 KB |
Output is correct |
14 |
Correct |
5 ms |
31320 KB |
Output is correct |
15 |
Correct |
5 ms |
31428 KB |
Output is correct |
16 |
Correct |
158 ms |
55996 KB |
Output is correct |
17 |
Correct |
375 ms |
86364 KB |
Output is correct |
18 |
Correct |
387 ms |
86296 KB |
Output is correct |
19 |
Correct |
362 ms |
92952 KB |
Output is correct |
20 |
Correct |
456 ms |
86976 KB |
Output is correct |
21 |
Correct |
374 ms |
76756 KB |
Output is correct |
22 |
Correct |
6 ms |
31068 KB |
Output is correct |
23 |
Correct |
53 ms |
38612 KB |
Output is correct |
24 |
Correct |
28 ms |
33624 KB |
Output is correct |
25 |
Correct |
86 ms |
40292 KB |
Output is correct |
26 |
Correct |
140 ms |
46848 KB |
Output is correct |
27 |
Correct |
191 ms |
57776 KB |
Output is correct |
28 |
Correct |
254 ms |
64352 KB |
Output is correct |
29 |
Correct |
325 ms |
73488 KB |
Output is correct |
30 |
Correct |
384 ms |
78560 KB |
Output is correct |
31 |
Correct |
466 ms |
86964 KB |
Output is correct |
32 |
Correct |
436 ms |
87836 KB |
Output is correct |
33 |
Correct |
362 ms |
86304 KB |
Output is correct |
34 |
Correct |
8 ms |
31580 KB |
Output is correct |
35 |
Correct |
11 ms |
32192 KB |
Output is correct |
36 |
Correct |
169 ms |
55812 KB |
Output is correct |
37 |
Correct |
297 ms |
71076 KB |
Output is correct |
38 |
Correct |
449 ms |
83888 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
29272 KB |
Output is correct |
2 |
Correct |
4 ms |
31064 KB |
Output is correct |
3 |
Correct |
4 ms |
29020 KB |
Output is correct |
4 |
Correct |
4 ms |
31068 KB |
Output is correct |
5 |
Correct |
5 ms |
31068 KB |
Output is correct |
6 |
Correct |
4 ms |
31068 KB |
Output is correct |
7 |
Correct |
4 ms |
31200 KB |
Output is correct |
8 |
Correct |
5 ms |
31068 KB |
Output is correct |
9 |
Correct |
154 ms |
56888 KB |
Output is correct |
10 |
Correct |
13 ms |
33492 KB |
Output is correct |
11 |
Correct |
49 ms |
45724 KB |
Output is correct |
12 |
Correct |
16 ms |
34776 KB |
Output is correct |
13 |
Correct |
25 ms |
36560 KB |
Output is correct |
14 |
Correct |
5 ms |
31320 KB |
Output is correct |
15 |
Correct |
5 ms |
31428 KB |
Output is correct |
16 |
Correct |
158 ms |
55996 KB |
Output is correct |
17 |
Correct |
5 ms |
31068 KB |
Output is correct |
18 |
Correct |
5 ms |
31068 KB |
Output is correct |
19 |
Correct |
5 ms |
31068 KB |
Output is correct |
20 |
Correct |
4 ms |
31068 KB |
Output is correct |
21 |
Correct |
4 ms |
31068 KB |
Output is correct |
22 |
Correct |
5 ms |
31068 KB |
Output is correct |
23 |
Correct |
367 ms |
82836 KB |
Output is correct |
24 |
Correct |
5 ms |
31068 KB |
Output is correct |
25 |
Correct |
5 ms |
31464 KB |
Output is correct |
26 |
Correct |
6 ms |
31324 KB |
Output is correct |
27 |
Correct |
7 ms |
31576 KB |
Output is correct |
28 |
Correct |
125 ms |
50888 KB |
Output is correct |
29 |
Correct |
197 ms |
59020 KB |
Output is correct |
30 |
Correct |
267 ms |
70224 KB |
Output is correct |
31 |
Correct |
381 ms |
82204 KB |
Output is correct |
32 |
Correct |
5 ms |
31068 KB |
Output is correct |
33 |
Correct |
4 ms |
31068 KB |
Output is correct |
34 |
Correct |
4 ms |
31068 KB |
Output is correct |
35 |
Correct |
4 ms |
29016 KB |
Output is correct |
36 |
Correct |
4 ms |
28936 KB |
Output is correct |
37 |
Correct |
4 ms |
31068 KB |
Output is correct |
38 |
Correct |
4 ms |
31204 KB |
Output is correct |
39 |
Correct |
5 ms |
31068 KB |
Output is correct |
40 |
Correct |
5 ms |
31064 KB |
Output is correct |
41 |
Correct |
4 ms |
29020 KB |
Output is correct |
42 |
Correct |
5 ms |
31068 KB |
Output is correct |
43 |
Correct |
7 ms |
31324 KB |
Output is correct |
44 |
Correct |
8 ms |
31324 KB |
Output is correct |
45 |
Correct |
159 ms |
54868 KB |
Output is correct |
46 |
Correct |
259 ms |
67280 KB |
Output is correct |
47 |
Correct |
248 ms |
68048 KB |
Output is correct |
48 |
Correct |
4 ms |
31064 KB |
Output is correct |
49 |
Correct |
5 ms |
31068 KB |
Output is correct |
50 |
Correct |
4 ms |
31140 KB |
Output is correct |
51 |
Correct |
4 ms |
31068 KB |
Output is correct |
52 |
Correct |
4 ms |
31068 KB |
Output is correct |
53 |
Correct |
5 ms |
31068 KB |
Output is correct |
54 |
Correct |
5 ms |
31184 KB |
Output is correct |
55 |
Correct |
379 ms |
80320 KB |
Output is correct |
56 |
Correct |
5 ms |
31064 KB |
Output is correct |
57 |
Correct |
7 ms |
31580 KB |
Output is correct |
58 |
Correct |
11 ms |
32492 KB |
Output is correct |
59 |
Correct |
14 ms |
32092 KB |
Output is correct |
60 |
Correct |
175 ms |
53460 KB |
Output is correct |
61 |
Correct |
226 ms |
63512 KB |
Output is correct |
62 |
Correct |
291 ms |
70456 KB |
Output is correct |
63 |
Correct |
378 ms |
79648 KB |
Output is correct |
64 |
Correct |
4 ms |
29020 KB |
Output is correct |
65 |
Correct |
4 ms |
31068 KB |
Output is correct |
66 |
Correct |
5 ms |
29020 KB |
Output is correct |
67 |
Correct |
368 ms |
84344 KB |
Output is correct |
68 |
Correct |
360 ms |
85284 KB |
Output is correct |
69 |
Correct |
355 ms |
85024 KB |
Output is correct |
70 |
Correct |
7 ms |
31576 KB |
Output is correct |
71 |
Correct |
10 ms |
31996 KB |
Output is correct |
72 |
Correct |
171 ms |
53976 KB |
Output is correct |
73 |
Correct |
267 ms |
68772 KB |
Output is correct |
74 |
Correct |
371 ms |
79636 KB |
Output is correct |
75 |
Correct |
435 ms |
87928 KB |
Output is correct |
76 |
Correct |
364 ms |
85788 KB |
Output is correct |
77 |
Correct |
8 ms |
31832 KB |
Output is correct |
78 |
Correct |
11 ms |
32092 KB |
Output is correct |
79 |
Correct |
175 ms |
55824 KB |
Output is correct |
80 |
Correct |
291 ms |
70052 KB |
Output is correct |
81 |
Correct |
404 ms |
83736 KB |
Output is correct |
82 |
Correct |
5 ms |
31068 KB |
Output is correct |
83 |
Correct |
5 ms |
31188 KB |
Output is correct |
84 |
Correct |
5 ms |
31064 KB |
Output is correct |
85 |
Correct |
355 ms |
93140 KB |
Output is correct |
86 |
Correct |
351 ms |
84848 KB |
Output is correct |
87 |
Correct |
344 ms |
84764 KB |
Output is correct |
88 |
Correct |
309 ms |
75520 KB |
Output is correct |
89 |
Correct |
91 ms |
37568 KB |
Output is correct |
90 |
Correct |
210 ms |
57632 KB |
Output is correct |
91 |
Correct |
196 ms |
57544 KB |
Output is correct |
92 |
Correct |
361 ms |
81944 KB |
Output is correct |
93 |
Correct |
365 ms |
82196 KB |
Output is correct |
94 |
Correct |
442 ms |
81428 KB |
Output is correct |
95 |
Correct |
383 ms |
81520 KB |
Output is correct |
96 |
Correct |
5 ms |
31068 KB |
Output is correct |
97 |
Correct |
25 ms |
34284 KB |
Output is correct |
98 |
Correct |
48 ms |
32912 KB |
Output is correct |
99 |
Correct |
356 ms |
93292 KB |
Output is correct |
100 |
Correct |
16 ms |
32344 KB |
Output is correct |
101 |
Correct |
51 ms |
36944 KB |
Output is correct |
102 |
Correct |
112 ms |
42884 KB |
Output is correct |
103 |
Correct |
136 ms |
50116 KB |
Output is correct |
104 |
Correct |
218 ms |
56292 KB |
Output is correct |
105 |
Correct |
257 ms |
65004 KB |
Output is correct |
106 |
Correct |
336 ms |
72128 KB |
Output is correct |
107 |
Correct |
364 ms |
79312 KB |
Output is correct |
108 |
Correct |
4 ms |
31068 KB |
Output is correct |
109 |
Correct |
4 ms |
31068 KB |
Output is correct |
110 |
Correct |
4 ms |
31068 KB |
Output is correct |
111 |
Correct |
4 ms |
29020 KB |
Output is correct |
112 |
Correct |
4 ms |
29020 KB |
Output is correct |
113 |
Correct |
4 ms |
31064 KB |
Output is correct |
114 |
Correct |
4 ms |
31068 KB |
Output is correct |
115 |
Correct |
4 ms |
31064 KB |
Output is correct |
116 |
Correct |
5 ms |
31064 KB |
Output is correct |
117 |
Correct |
4 ms |
29020 KB |
Output is correct |
118 |
Correct |
4 ms |
31040 KB |
Output is correct |
119 |
Correct |
5 ms |
31212 KB |
Output is correct |
120 |
Correct |
6 ms |
31320 KB |
Output is correct |
121 |
Correct |
163 ms |
54660 KB |
Output is correct |
122 |
Correct |
259 ms |
68556 KB |
Output is correct |
123 |
Correct |
252 ms |
68304 KB |
Output is correct |
124 |
Correct |
4 ms |
29016 KB |
Output is correct |
125 |
Correct |
5 ms |
31064 KB |
Output is correct |
126 |
Correct |
4 ms |
29020 KB |
Output is correct |
127 |
Correct |
397 ms |
85136 KB |
Output is correct |
128 |
Correct |
373 ms |
85020 KB |
Output is correct |
129 |
Correct |
387 ms |
85228 KB |
Output is correct |
130 |
Correct |
7 ms |
31576 KB |
Output is correct |
131 |
Correct |
11 ms |
31972 KB |
Output is correct |
132 |
Correct |
162 ms |
53924 KB |
Output is correct |
133 |
Correct |
261 ms |
68260 KB |
Output is correct |
134 |
Correct |
376 ms |
79832 KB |
Output is correct |
135 |
Correct |
375 ms |
86364 KB |
Output is correct |
136 |
Correct |
387 ms |
86296 KB |
Output is correct |
137 |
Correct |
362 ms |
92952 KB |
Output is correct |
138 |
Correct |
456 ms |
86976 KB |
Output is correct |
139 |
Correct |
374 ms |
76756 KB |
Output is correct |
140 |
Correct |
6 ms |
31068 KB |
Output is correct |
141 |
Correct |
53 ms |
38612 KB |
Output is correct |
142 |
Correct |
28 ms |
33624 KB |
Output is correct |
143 |
Correct |
86 ms |
40292 KB |
Output is correct |
144 |
Correct |
140 ms |
46848 KB |
Output is correct |
145 |
Correct |
191 ms |
57776 KB |
Output is correct |
146 |
Correct |
254 ms |
64352 KB |
Output is correct |
147 |
Correct |
325 ms |
73488 KB |
Output is correct |
148 |
Correct |
384 ms |
78560 KB |
Output is correct |
149 |
Correct |
466 ms |
86964 KB |
Output is correct |
150 |
Correct |
436 ms |
87836 KB |
Output is correct |
151 |
Correct |
362 ms |
86304 KB |
Output is correct |
152 |
Correct |
8 ms |
31580 KB |
Output is correct |
153 |
Correct |
11 ms |
32192 KB |
Output is correct |
154 |
Correct |
169 ms |
55812 KB |
Output is correct |
155 |
Correct |
297 ms |
71076 KB |
Output is correct |
156 |
Correct |
449 ms |
83888 KB |
Output is correct |
157 |
Correct |
6 ms |
31064 KB |
Output is correct |
158 |
Correct |
5 ms |
29020 KB |
Output is correct |
159 |
Correct |
6 ms |
31064 KB |
Output is correct |
160 |
Correct |
4 ms |
31064 KB |
Output is correct |
161 |
Correct |
408 ms |
77500 KB |
Output is correct |
162 |
Correct |
428 ms |
93112 KB |
Output is correct |
163 |
Correct |
401 ms |
90136 KB |
Output is correct |
164 |
Correct |
371 ms |
90504 KB |
Output is correct |
165 |
Correct |
392 ms |
81136 KB |
Output is correct |
166 |
Correct |
440 ms |
77872 KB |
Output is correct |
167 |
Incorrect |
75 ms |
43220 KB |
Tree @(185555, 21279) appears more than once: for edges on positions 33 and 1616 |
168 |
Halted |
0 ms |
0 KB |
- |