#include "parks.h"
#ifdef NYAOWO
#include "grader.cpp"
#endif
#include <bits/stdc++.h>
#define For(i, a, b) for(int i = a; i <= b; i++)
#define Forr(i, a, b) for(int i = a; i >= b; i--)
#define F first
#define S second
#define sz(x) ((int)x.size())
#define all(x) x.begin(), x.end()
#define eb emplace_back
// #define int LL
using namespace std;
using i32 = int32_t;
using LL = long long;
using pii = pair<int, int>;
const int MAXN = 200'000;
const int MAXND = MAXN * 2;
struct SCC {
vector<int> adj[MAXND + 10];
vector<int> rev[MAXND + 10];
int vis[MAXND + 10];
vector<int> stk;
void link(int x, int y) {
adj[x].eb(y);
rev[y].eb(x);
}
void bilink(int x, int y) {
link(x, y);
link(y, x);
}
void dfs1(int n) {
if(vis[n] < 0) return;
vis[n] = -1;
for(auto &i:rev[n]) dfs1(i);
stk.eb(n);
}
void dfs2(int n, int tag) {
if(vis[n] != -1) return;
vis[n] = tag;
for(auto &i:adj[n]) dfs2(i, tag);
}
int build_scc(int n) {
memset(vis, 0, sizeof(vis));
For(i, 0, n - 1) dfs1(i);
int cur_scc = 0;
while(sz(stk)) {
dfs2(stk.back(), cur_scc);
while(sz(stk) && vis[stk.back()] != -1) stk.pop_back();
cur_scc++;
}
return cur_scc;
}
} ayaya;
struct DSU {
int p[MAXN + 10];
void init() {
memset(p, -1, sizeof(p));
}
int find(int n) {
if(p[n] < 0) return n;
return p[n] = find(p[n]);
}
bool uni(int a, int b) {
a = find(a); b = find(b);
if(a == b) return false;
p[b] = a;
return true;
}
} dsu;
vector<pii> pos[MAXN + 10];
int construct_roads(std::vector<int> X, std::vector<int> Y) {
if (sz(X) == 1) {
build({}, {}, {}, {});
return 1;
}
int n = sz(X);
map<pii, int> mp;
For(i, 0, n - 1) {
mp[pii(X[i], Y[i])] = i;
pos[X[i]].eb(Y[i], i);
}
auto find = [&](int x, int y) {
if(mp.count(pii(x, y))) return mp[pii(x, y)];
return -1;
};
dsu.init();
int cnt = 0;
map<pii, int> hor, ver;
vector<int> U(n - 1), V(n - 1), A(n - 1), B(n - 1);
for(int x = 2; x <= MAXN; x += 2) {
for(auto &it:pos[x]) {
int y, i;
tie(y, i) = it;
auto link = [&](int x2, int y2) {
int j = find(x2, y2);
if(j >= 0 && dsu.uni(i, j)) {
if(x2 == x) ver[pii(x, max(y, y2))] = cnt;
else hor[pii(min(x, x2), y)] = cnt;
U[cnt] = i;
V[cnt] = j;
cnt++;
}
};
link(x + 2, y);
link(x, y + 2);
}
}
// For(i, 0, n - 1) {
// int x = X[i], y = Y[i];
// auto link = [&](int x2, int y2) {
// int j = find(x2, y2);
// if(j >= 0 && dsu.uni(i, j)) {
// if(x2 == x) ver[pii(x, max(y, y2))] = cnt;
// else hor[pii(min(x, x2), y)] = cnt;
// U[cnt] = i;
// V[cnt] = j;
// cnt++;
// }
// };
// const int dx[4] = {0, 0, 2, -2};
// const int dy[4] = {2, -2, 0, 0};
// For(it, 0, 3) link(x + dx[it], y + dy[it]);
// }
if(cnt != n - 1) return 0;
for(auto &it:ver) {
pii p; int id;
tie(p, id) = it;
int x, y;
tie(x, y) = p;
if(hor.count(pii(x - 2, y))) {
int id2 = hor[pii(x - 2, y)];
ayaya.link(id, id2);
ayaya.link(id2 + n, id + n);
}
if(hor.count(pii(x - 2, y - 2))) {
int id2 = hor[pii(x - 2, y - 2)];
ayaya.link(id, id2 + n);
ayaya.link(id2, id + n);
}
if(hor.count(pii(x, y))) {
int id2 = hor[pii(x, y)];
ayaya.link(id + n, id2);
ayaya.link(id2 + n, id);
}
if(hor.count(pii(x, y - 2))) {
int id2 = hor[pii(x, y - 2)];
ayaya.link(id + n, id2 + n);
ayaya.link(id2, id);
}
if(ver.count(pii(x + 2, y))) {
int id2 = ver[pii(x + 2, y)];
ayaya.link(id + n, id2 + n);
ayaya.link(id2, id);
}
}
for(auto &it:hor) {
pii p; int id;
tie(p, id) = it;
int x, y;
tie(x, y) = p;
if(hor.count(pii(x, y - 2))) {
int id2 = hor[pii(x, y - 2)];
ayaya.link(id + n, id2 + n);
ayaya.link(id2, id);
}
}
ayaya.build_scc(n * 2);
for(auto &it:ver) {
pii p; int id;
tie(p, id) = it;
int x, y;
tie(x, y) = p;
int s1 = ayaya.vis[id];
int s2 = ayaya.vis[id + n];
if(s1 == s2) return 0;
if(s1 < s2) {
A[id] = x - 1;
B[id] = y - 1;
} else {
A[id] = x + 1;
B[id] = y - 1;
}
}
for(auto &it:hor) {
pii p; int id;
tie(p, id) = it;
int x, y;
tie(x, y) = p;
int s1 = ayaya.vis[id];
int s2 = ayaya.vis[id + n];
if(s1 == s2) return 0;
if(s1 < s2) {
A[id] = x + 1;
B[id] = y + 1;
} else {
A[id] = x + 1;
B[id] = y - 1;
}
}
build(U, V, A, B);
return 1;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
10 ms |
23720 KB |
Output is correct |
2 |
Correct |
13 ms |
26068 KB |
Output is correct |
3 |
Correct |
12 ms |
24532 KB |
Output is correct |
4 |
Correct |
12 ms |
26072 KB |
Output is correct |
5 |
Correct |
12 ms |
26016 KB |
Output is correct |
6 |
Correct |
12 ms |
24484 KB |
Output is correct |
7 |
Correct |
12 ms |
24532 KB |
Output is correct |
8 |
Correct |
12 ms |
24532 KB |
Output is correct |
9 |
Correct |
179 ms |
47724 KB |
Output is correct |
10 |
Correct |
25 ms |
28220 KB |
Output is correct |
11 |
Correct |
77 ms |
37716 KB |
Output is correct |
12 |
Correct |
27 ms |
29452 KB |
Output is correct |
13 |
Correct |
44 ms |
31828 KB |
Output is correct |
14 |
Correct |
12 ms |
24724 KB |
Output is correct |
15 |
Correct |
13 ms |
24788 KB |
Output is correct |
16 |
Correct |
229 ms |
47720 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
10 ms |
23720 KB |
Output is correct |
2 |
Correct |
13 ms |
26068 KB |
Output is correct |
3 |
Correct |
12 ms |
24532 KB |
Output is correct |
4 |
Correct |
12 ms |
26072 KB |
Output is correct |
5 |
Correct |
12 ms |
26016 KB |
Output is correct |
6 |
Correct |
12 ms |
24484 KB |
Output is correct |
7 |
Correct |
12 ms |
24532 KB |
Output is correct |
8 |
Correct |
12 ms |
24532 KB |
Output is correct |
9 |
Correct |
179 ms |
47724 KB |
Output is correct |
10 |
Correct |
25 ms |
28220 KB |
Output is correct |
11 |
Correct |
77 ms |
37716 KB |
Output is correct |
12 |
Correct |
27 ms |
29452 KB |
Output is correct |
13 |
Correct |
44 ms |
31828 KB |
Output is correct |
14 |
Correct |
12 ms |
24724 KB |
Output is correct |
15 |
Correct |
13 ms |
24788 KB |
Output is correct |
16 |
Correct |
229 ms |
47720 KB |
Output is correct |
17 |
Correct |
13 ms |
26064 KB |
Output is correct |
18 |
Correct |
14 ms |
26068 KB |
Output is correct |
19 |
Correct |
12 ms |
26044 KB |
Output is correct |
20 |
Correct |
14 ms |
26068 KB |
Output is correct |
21 |
Correct |
11 ms |
24532 KB |
Output is correct |
22 |
Correct |
12 ms |
26112 KB |
Output is correct |
23 |
Correct |
740 ms |
86840 KB |
Output is correct |
24 |
Correct |
15 ms |
26128 KB |
Output is correct |
25 |
Correct |
19 ms |
26440 KB |
Output is correct |
26 |
Correct |
15 ms |
24996 KB |
Output is correct |
27 |
Correct |
15 ms |
25232 KB |
Output is correct |
28 |
Correct |
218 ms |
50868 KB |
Output is correct |
29 |
Correct |
407 ms |
63008 KB |
Output is correct |
30 |
Correct |
639 ms |
75652 KB |
Output is correct |
31 |
Correct |
718 ms |
88116 KB |
Output is correct |
32 |
Correct |
13 ms |
26068 KB |
Output is correct |
33 |
Correct |
13 ms |
26096 KB |
Output is correct |
34 |
Correct |
13 ms |
26028 KB |
Output is correct |
35 |
Correct |
13 ms |
24532 KB |
Output is correct |
36 |
Correct |
12 ms |
24512 KB |
Output is correct |
37 |
Correct |
17 ms |
26068 KB |
Output is correct |
38 |
Correct |
18 ms |
26068 KB |
Output is correct |
39 |
Correct |
13 ms |
26068 KB |
Output is correct |
40 |
Correct |
13 ms |
26068 KB |
Output is correct |
41 |
Correct |
16 ms |
24452 KB |
Output is correct |
42 |
Correct |
16 ms |
26104 KB |
Output is correct |
43 |
Correct |
14 ms |
24788 KB |
Output is correct |
44 |
Correct |
19 ms |
24996 KB |
Output is correct |
45 |
Correct |
336 ms |
54172 KB |
Output is correct |
46 |
Correct |
412 ms |
66912 KB |
Output is correct |
47 |
Correct |
418 ms |
66860 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
10 ms |
23720 KB |
Output is correct |
2 |
Correct |
13 ms |
26068 KB |
Output is correct |
3 |
Correct |
12 ms |
24532 KB |
Output is correct |
4 |
Correct |
12 ms |
26072 KB |
Output is correct |
5 |
Correct |
12 ms |
26016 KB |
Output is correct |
6 |
Correct |
12 ms |
24484 KB |
Output is correct |
7 |
Correct |
12 ms |
24532 KB |
Output is correct |
8 |
Correct |
12 ms |
24532 KB |
Output is correct |
9 |
Correct |
179 ms |
47724 KB |
Output is correct |
10 |
Correct |
25 ms |
28220 KB |
Output is correct |
11 |
Correct |
77 ms |
37716 KB |
Output is correct |
12 |
Correct |
27 ms |
29452 KB |
Output is correct |
13 |
Correct |
44 ms |
31828 KB |
Output is correct |
14 |
Correct |
12 ms |
24724 KB |
Output is correct |
15 |
Correct |
13 ms |
24788 KB |
Output is correct |
16 |
Correct |
229 ms |
47720 KB |
Output is correct |
17 |
Correct |
13 ms |
26064 KB |
Output is correct |
18 |
Correct |
14 ms |
26068 KB |
Output is correct |
19 |
Correct |
12 ms |
26044 KB |
Output is correct |
20 |
Correct |
14 ms |
26068 KB |
Output is correct |
21 |
Correct |
11 ms |
24532 KB |
Output is correct |
22 |
Correct |
12 ms |
26112 KB |
Output is correct |
23 |
Correct |
740 ms |
86840 KB |
Output is correct |
24 |
Correct |
15 ms |
26128 KB |
Output is correct |
25 |
Correct |
19 ms |
26440 KB |
Output is correct |
26 |
Correct |
15 ms |
24996 KB |
Output is correct |
27 |
Correct |
15 ms |
25232 KB |
Output is correct |
28 |
Correct |
218 ms |
50868 KB |
Output is correct |
29 |
Correct |
407 ms |
63008 KB |
Output is correct |
30 |
Correct |
639 ms |
75652 KB |
Output is correct |
31 |
Correct |
718 ms |
88116 KB |
Output is correct |
32 |
Correct |
13 ms |
26068 KB |
Output is correct |
33 |
Correct |
13 ms |
26096 KB |
Output is correct |
34 |
Correct |
13 ms |
26028 KB |
Output is correct |
35 |
Correct |
13 ms |
24532 KB |
Output is correct |
36 |
Correct |
12 ms |
24512 KB |
Output is correct |
37 |
Correct |
17 ms |
26068 KB |
Output is correct |
38 |
Correct |
18 ms |
26068 KB |
Output is correct |
39 |
Correct |
13 ms |
26068 KB |
Output is correct |
40 |
Correct |
13 ms |
26068 KB |
Output is correct |
41 |
Correct |
16 ms |
24452 KB |
Output is correct |
42 |
Correct |
16 ms |
26104 KB |
Output is correct |
43 |
Correct |
14 ms |
24788 KB |
Output is correct |
44 |
Correct |
19 ms |
24996 KB |
Output is correct |
45 |
Correct |
336 ms |
54172 KB |
Output is correct |
46 |
Correct |
412 ms |
66912 KB |
Output is correct |
47 |
Correct |
418 ms |
66860 KB |
Output is correct |
48 |
Correct |
15 ms |
26100 KB |
Output is correct |
49 |
Correct |
13 ms |
26068 KB |
Output is correct |
50 |
Correct |
15 ms |
26068 KB |
Output is correct |
51 |
Correct |
14 ms |
26040 KB |
Output is correct |
52 |
Correct |
16 ms |
26112 KB |
Output is correct |
53 |
Correct |
13 ms |
26068 KB |
Output is correct |
54 |
Correct |
16 ms |
26068 KB |
Output is correct |
55 |
Correct |
785 ms |
89420 KB |
Output is correct |
56 |
Correct |
13 ms |
26068 KB |
Output is correct |
57 |
Correct |
15 ms |
26708 KB |
Output is correct |
58 |
Correct |
22 ms |
28084 KB |
Output is correct |
59 |
Correct |
22 ms |
26240 KB |
Output is correct |
60 |
Correct |
256 ms |
57752 KB |
Output is correct |
61 |
Correct |
377 ms |
68664 KB |
Output is correct |
62 |
Correct |
522 ms |
77768 KB |
Output is correct |
63 |
Correct |
717 ms |
89216 KB |
Output is correct |
64 |
Correct |
13 ms |
24532 KB |
Output is correct |
65 |
Correct |
13 ms |
26068 KB |
Output is correct |
66 |
Correct |
11 ms |
24520 KB |
Output is correct |
67 |
Correct |
397 ms |
66808 KB |
Output is correct |
68 |
Correct |
396 ms |
66740 KB |
Output is correct |
69 |
Correct |
471 ms |
66596 KB |
Output is correct |
70 |
Correct |
15 ms |
25172 KB |
Output is correct |
71 |
Correct |
23 ms |
25864 KB |
Output is correct |
72 |
Correct |
262 ms |
54812 KB |
Output is correct |
73 |
Correct |
437 ms |
69208 KB |
Output is correct |
74 |
Correct |
647 ms |
83608 KB |
Output is correct |
75 |
Correct |
595 ms |
81780 KB |
Output is correct |
76 |
Correct |
396 ms |
66776 KB |
Output is correct |
77 |
Correct |
16 ms |
25300 KB |
Output is correct |
78 |
Correct |
24 ms |
25940 KB |
Output is correct |
79 |
Correct |
281 ms |
55044 KB |
Output is correct |
80 |
Correct |
461 ms |
69480 KB |
Output is correct |
81 |
Correct |
723 ms |
83892 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
10 ms |
23720 KB |
Output is correct |
2 |
Correct |
13 ms |
26068 KB |
Output is correct |
3 |
Correct |
12 ms |
24532 KB |
Output is correct |
4 |
Correct |
12 ms |
26072 KB |
Output is correct |
5 |
Correct |
12 ms |
26016 KB |
Output is correct |
6 |
Correct |
12 ms |
24484 KB |
Output is correct |
7 |
Correct |
12 ms |
24532 KB |
Output is correct |
8 |
Correct |
12 ms |
24532 KB |
Output is correct |
9 |
Correct |
179 ms |
47724 KB |
Output is correct |
10 |
Correct |
25 ms |
28220 KB |
Output is correct |
11 |
Correct |
77 ms |
37716 KB |
Output is correct |
12 |
Correct |
27 ms |
29452 KB |
Output is correct |
13 |
Correct |
44 ms |
31828 KB |
Output is correct |
14 |
Correct |
12 ms |
24724 KB |
Output is correct |
15 |
Correct |
13 ms |
24788 KB |
Output is correct |
16 |
Correct |
229 ms |
47720 KB |
Output is correct |
17 |
Correct |
13 ms |
26068 KB |
Output is correct |
18 |
Correct |
12 ms |
26068 KB |
Output is correct |
19 |
Correct |
11 ms |
24532 KB |
Output is correct |
20 |
Correct |
484 ms |
99080 KB |
Output is correct |
21 |
Correct |
454 ms |
95536 KB |
Output is correct |
22 |
Correct |
496 ms |
95512 KB |
Output is correct |
23 |
Correct |
310 ms |
62016 KB |
Output is correct |
24 |
Correct |
154 ms |
44964 KB |
Output is correct |
25 |
Correct |
286 ms |
57504 KB |
Output is correct |
26 |
Correct |
235 ms |
57420 KB |
Output is correct |
27 |
Correct |
331 ms |
67004 KB |
Output is correct |
28 |
Correct |
325 ms |
66968 KB |
Output is correct |
29 |
Correct |
368 ms |
67420 KB |
Output is correct |
30 |
Correct |
330 ms |
67336 KB |
Output is correct |
31 |
Correct |
14 ms |
26068 KB |
Output is correct |
32 |
Correct |
35 ms |
30576 KB |
Output is correct |
33 |
Correct |
83 ms |
36992 KB |
Output is correct |
34 |
Correct |
488 ms |
99172 KB |
Output is correct |
35 |
Correct |
20 ms |
26196 KB |
Output is correct |
36 |
Correct |
62 ms |
33028 KB |
Output is correct |
37 |
Correct |
125 ms |
41556 KB |
Output is correct |
38 |
Correct |
173 ms |
50856 KB |
Output is correct |
39 |
Correct |
240 ms |
60396 KB |
Output is correct |
40 |
Correct |
327 ms |
69708 KB |
Output is correct |
41 |
Correct |
428 ms |
79080 KB |
Output is correct |
42 |
Correct |
475 ms |
88384 KB |
Output is correct |
43 |
Correct |
14 ms |
26068 KB |
Output is correct |
44 |
Correct |
16 ms |
26024 KB |
Output is correct |
45 |
Correct |
13 ms |
26068 KB |
Output is correct |
46 |
Correct |
12 ms |
24532 KB |
Output is correct |
47 |
Correct |
13 ms |
24540 KB |
Output is correct |
48 |
Correct |
13 ms |
26068 KB |
Output is correct |
49 |
Correct |
13 ms |
26132 KB |
Output is correct |
50 |
Correct |
13 ms |
26100 KB |
Output is correct |
51 |
Correct |
13 ms |
26068 KB |
Output is correct |
52 |
Correct |
17 ms |
24532 KB |
Output is correct |
53 |
Correct |
13 ms |
26104 KB |
Output is correct |
54 |
Correct |
15 ms |
24840 KB |
Output is correct |
55 |
Correct |
15 ms |
25044 KB |
Output is correct |
56 |
Correct |
260 ms |
54260 KB |
Output is correct |
57 |
Correct |
431 ms |
66868 KB |
Output is correct |
58 |
Correct |
431 ms |
66844 KB |
Output is correct |
59 |
Correct |
13 ms |
24532 KB |
Output is correct |
60 |
Correct |
14 ms |
26068 KB |
Output is correct |
61 |
Correct |
13 ms |
24532 KB |
Output is correct |
62 |
Correct |
427 ms |
66748 KB |
Output is correct |
63 |
Correct |
434 ms |
66824 KB |
Output is correct |
64 |
Correct |
378 ms |
66656 KB |
Output is correct |
65 |
Correct |
22 ms |
25172 KB |
Output is correct |
66 |
Correct |
19 ms |
25884 KB |
Output is correct |
67 |
Correct |
322 ms |
54832 KB |
Output is correct |
68 |
Correct |
545 ms |
69216 KB |
Output is correct |
69 |
Correct |
835 ms |
83528 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
10 ms |
23720 KB |
Output is correct |
2 |
Correct |
13 ms |
26068 KB |
Output is correct |
3 |
Correct |
12 ms |
24532 KB |
Output is correct |
4 |
Correct |
12 ms |
26072 KB |
Output is correct |
5 |
Correct |
12 ms |
26016 KB |
Output is correct |
6 |
Correct |
12 ms |
24484 KB |
Output is correct |
7 |
Correct |
12 ms |
24532 KB |
Output is correct |
8 |
Correct |
12 ms |
24532 KB |
Output is correct |
9 |
Correct |
179 ms |
47724 KB |
Output is correct |
10 |
Correct |
25 ms |
28220 KB |
Output is correct |
11 |
Correct |
77 ms |
37716 KB |
Output is correct |
12 |
Correct |
27 ms |
29452 KB |
Output is correct |
13 |
Correct |
44 ms |
31828 KB |
Output is correct |
14 |
Correct |
12 ms |
24724 KB |
Output is correct |
15 |
Correct |
13 ms |
24788 KB |
Output is correct |
16 |
Correct |
229 ms |
47720 KB |
Output is correct |
17 |
Correct |
475 ms |
67596 KB |
Output is correct |
18 |
Correct |
429 ms |
67772 KB |
Output is correct |
19 |
Correct |
576 ms |
95540 KB |
Output is correct |
20 |
Correct |
537 ms |
82304 KB |
Output is correct |
21 |
Correct |
454 ms |
70384 KB |
Output is correct |
22 |
Correct |
12 ms |
26100 KB |
Output is correct |
23 |
Correct |
71 ms |
36004 KB |
Output is correct |
24 |
Correct |
33 ms |
27816 KB |
Output is correct |
25 |
Correct |
94 ms |
36320 KB |
Output is correct |
26 |
Correct |
190 ms |
44764 KB |
Output is correct |
27 |
Correct |
246 ms |
56052 KB |
Output is correct |
28 |
Correct |
296 ms |
63876 KB |
Output is correct |
29 |
Correct |
411 ms |
71380 KB |
Output is correct |
30 |
Correct |
456 ms |
78412 KB |
Output is correct |
31 |
Correct |
568 ms |
86184 KB |
Output is correct |
32 |
Correct |
650 ms |
81896 KB |
Output is correct |
33 |
Correct |
433 ms |
66832 KB |
Output is correct |
34 |
Correct |
17 ms |
25300 KB |
Output is correct |
35 |
Correct |
21 ms |
26036 KB |
Output is correct |
36 |
Correct |
295 ms |
55088 KB |
Output is correct |
37 |
Correct |
454 ms |
69452 KB |
Output is correct |
38 |
Correct |
732 ms |
83988 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
10 ms |
23720 KB |
Output is correct |
2 |
Correct |
13 ms |
26068 KB |
Output is correct |
3 |
Correct |
12 ms |
24532 KB |
Output is correct |
4 |
Correct |
12 ms |
26072 KB |
Output is correct |
5 |
Correct |
12 ms |
26016 KB |
Output is correct |
6 |
Correct |
12 ms |
24484 KB |
Output is correct |
7 |
Correct |
12 ms |
24532 KB |
Output is correct |
8 |
Correct |
12 ms |
24532 KB |
Output is correct |
9 |
Correct |
179 ms |
47724 KB |
Output is correct |
10 |
Correct |
25 ms |
28220 KB |
Output is correct |
11 |
Correct |
77 ms |
37716 KB |
Output is correct |
12 |
Correct |
27 ms |
29452 KB |
Output is correct |
13 |
Correct |
44 ms |
31828 KB |
Output is correct |
14 |
Correct |
12 ms |
24724 KB |
Output is correct |
15 |
Correct |
13 ms |
24788 KB |
Output is correct |
16 |
Correct |
229 ms |
47720 KB |
Output is correct |
17 |
Correct |
13 ms |
26064 KB |
Output is correct |
18 |
Correct |
14 ms |
26068 KB |
Output is correct |
19 |
Correct |
12 ms |
26044 KB |
Output is correct |
20 |
Correct |
14 ms |
26068 KB |
Output is correct |
21 |
Correct |
11 ms |
24532 KB |
Output is correct |
22 |
Correct |
12 ms |
26112 KB |
Output is correct |
23 |
Correct |
740 ms |
86840 KB |
Output is correct |
24 |
Correct |
15 ms |
26128 KB |
Output is correct |
25 |
Correct |
19 ms |
26440 KB |
Output is correct |
26 |
Correct |
15 ms |
24996 KB |
Output is correct |
27 |
Correct |
15 ms |
25232 KB |
Output is correct |
28 |
Correct |
218 ms |
50868 KB |
Output is correct |
29 |
Correct |
407 ms |
63008 KB |
Output is correct |
30 |
Correct |
639 ms |
75652 KB |
Output is correct |
31 |
Correct |
718 ms |
88116 KB |
Output is correct |
32 |
Correct |
13 ms |
26068 KB |
Output is correct |
33 |
Correct |
13 ms |
26096 KB |
Output is correct |
34 |
Correct |
13 ms |
26028 KB |
Output is correct |
35 |
Correct |
13 ms |
24532 KB |
Output is correct |
36 |
Correct |
12 ms |
24512 KB |
Output is correct |
37 |
Correct |
17 ms |
26068 KB |
Output is correct |
38 |
Correct |
18 ms |
26068 KB |
Output is correct |
39 |
Correct |
13 ms |
26068 KB |
Output is correct |
40 |
Correct |
13 ms |
26068 KB |
Output is correct |
41 |
Correct |
16 ms |
24452 KB |
Output is correct |
42 |
Correct |
16 ms |
26104 KB |
Output is correct |
43 |
Correct |
14 ms |
24788 KB |
Output is correct |
44 |
Correct |
19 ms |
24996 KB |
Output is correct |
45 |
Correct |
336 ms |
54172 KB |
Output is correct |
46 |
Correct |
412 ms |
66912 KB |
Output is correct |
47 |
Correct |
418 ms |
66860 KB |
Output is correct |
48 |
Correct |
15 ms |
26100 KB |
Output is correct |
49 |
Correct |
13 ms |
26068 KB |
Output is correct |
50 |
Correct |
15 ms |
26068 KB |
Output is correct |
51 |
Correct |
14 ms |
26040 KB |
Output is correct |
52 |
Correct |
16 ms |
26112 KB |
Output is correct |
53 |
Correct |
13 ms |
26068 KB |
Output is correct |
54 |
Correct |
16 ms |
26068 KB |
Output is correct |
55 |
Correct |
785 ms |
89420 KB |
Output is correct |
56 |
Correct |
13 ms |
26068 KB |
Output is correct |
57 |
Correct |
15 ms |
26708 KB |
Output is correct |
58 |
Correct |
22 ms |
28084 KB |
Output is correct |
59 |
Correct |
22 ms |
26240 KB |
Output is correct |
60 |
Correct |
256 ms |
57752 KB |
Output is correct |
61 |
Correct |
377 ms |
68664 KB |
Output is correct |
62 |
Correct |
522 ms |
77768 KB |
Output is correct |
63 |
Correct |
717 ms |
89216 KB |
Output is correct |
64 |
Correct |
13 ms |
24532 KB |
Output is correct |
65 |
Correct |
13 ms |
26068 KB |
Output is correct |
66 |
Correct |
11 ms |
24520 KB |
Output is correct |
67 |
Correct |
397 ms |
66808 KB |
Output is correct |
68 |
Correct |
396 ms |
66740 KB |
Output is correct |
69 |
Correct |
471 ms |
66596 KB |
Output is correct |
70 |
Correct |
15 ms |
25172 KB |
Output is correct |
71 |
Correct |
23 ms |
25864 KB |
Output is correct |
72 |
Correct |
262 ms |
54812 KB |
Output is correct |
73 |
Correct |
437 ms |
69208 KB |
Output is correct |
74 |
Correct |
647 ms |
83608 KB |
Output is correct |
75 |
Correct |
595 ms |
81780 KB |
Output is correct |
76 |
Correct |
396 ms |
66776 KB |
Output is correct |
77 |
Correct |
16 ms |
25300 KB |
Output is correct |
78 |
Correct |
24 ms |
25940 KB |
Output is correct |
79 |
Correct |
281 ms |
55044 KB |
Output is correct |
80 |
Correct |
461 ms |
69480 KB |
Output is correct |
81 |
Correct |
723 ms |
83892 KB |
Output is correct |
82 |
Correct |
13 ms |
26068 KB |
Output is correct |
83 |
Correct |
12 ms |
26068 KB |
Output is correct |
84 |
Correct |
11 ms |
24532 KB |
Output is correct |
85 |
Correct |
484 ms |
99080 KB |
Output is correct |
86 |
Correct |
454 ms |
95536 KB |
Output is correct |
87 |
Correct |
496 ms |
95512 KB |
Output is correct |
88 |
Correct |
310 ms |
62016 KB |
Output is correct |
89 |
Correct |
154 ms |
44964 KB |
Output is correct |
90 |
Correct |
286 ms |
57504 KB |
Output is correct |
91 |
Correct |
235 ms |
57420 KB |
Output is correct |
92 |
Correct |
331 ms |
67004 KB |
Output is correct |
93 |
Correct |
325 ms |
66968 KB |
Output is correct |
94 |
Correct |
368 ms |
67420 KB |
Output is correct |
95 |
Correct |
330 ms |
67336 KB |
Output is correct |
96 |
Correct |
14 ms |
26068 KB |
Output is correct |
97 |
Correct |
35 ms |
30576 KB |
Output is correct |
98 |
Correct |
83 ms |
36992 KB |
Output is correct |
99 |
Correct |
488 ms |
99172 KB |
Output is correct |
100 |
Correct |
20 ms |
26196 KB |
Output is correct |
101 |
Correct |
62 ms |
33028 KB |
Output is correct |
102 |
Correct |
125 ms |
41556 KB |
Output is correct |
103 |
Correct |
173 ms |
50856 KB |
Output is correct |
104 |
Correct |
240 ms |
60396 KB |
Output is correct |
105 |
Correct |
327 ms |
69708 KB |
Output is correct |
106 |
Correct |
428 ms |
79080 KB |
Output is correct |
107 |
Correct |
475 ms |
88384 KB |
Output is correct |
108 |
Correct |
14 ms |
26068 KB |
Output is correct |
109 |
Correct |
16 ms |
26024 KB |
Output is correct |
110 |
Correct |
13 ms |
26068 KB |
Output is correct |
111 |
Correct |
12 ms |
24532 KB |
Output is correct |
112 |
Correct |
13 ms |
24540 KB |
Output is correct |
113 |
Correct |
13 ms |
26068 KB |
Output is correct |
114 |
Correct |
13 ms |
26132 KB |
Output is correct |
115 |
Correct |
13 ms |
26100 KB |
Output is correct |
116 |
Correct |
13 ms |
26068 KB |
Output is correct |
117 |
Correct |
17 ms |
24532 KB |
Output is correct |
118 |
Correct |
13 ms |
26104 KB |
Output is correct |
119 |
Correct |
15 ms |
24840 KB |
Output is correct |
120 |
Correct |
15 ms |
25044 KB |
Output is correct |
121 |
Correct |
260 ms |
54260 KB |
Output is correct |
122 |
Correct |
431 ms |
66868 KB |
Output is correct |
123 |
Correct |
431 ms |
66844 KB |
Output is correct |
124 |
Correct |
13 ms |
24532 KB |
Output is correct |
125 |
Correct |
14 ms |
26068 KB |
Output is correct |
126 |
Correct |
13 ms |
24532 KB |
Output is correct |
127 |
Correct |
427 ms |
66748 KB |
Output is correct |
128 |
Correct |
434 ms |
66824 KB |
Output is correct |
129 |
Correct |
378 ms |
66656 KB |
Output is correct |
130 |
Correct |
22 ms |
25172 KB |
Output is correct |
131 |
Correct |
19 ms |
25884 KB |
Output is correct |
132 |
Correct |
322 ms |
54832 KB |
Output is correct |
133 |
Correct |
545 ms |
69216 KB |
Output is correct |
134 |
Correct |
835 ms |
83528 KB |
Output is correct |
135 |
Correct |
475 ms |
67596 KB |
Output is correct |
136 |
Correct |
429 ms |
67772 KB |
Output is correct |
137 |
Correct |
576 ms |
95540 KB |
Output is correct |
138 |
Correct |
537 ms |
82304 KB |
Output is correct |
139 |
Correct |
454 ms |
70384 KB |
Output is correct |
140 |
Correct |
12 ms |
26100 KB |
Output is correct |
141 |
Correct |
71 ms |
36004 KB |
Output is correct |
142 |
Correct |
33 ms |
27816 KB |
Output is correct |
143 |
Correct |
94 ms |
36320 KB |
Output is correct |
144 |
Correct |
190 ms |
44764 KB |
Output is correct |
145 |
Correct |
246 ms |
56052 KB |
Output is correct |
146 |
Correct |
296 ms |
63876 KB |
Output is correct |
147 |
Correct |
411 ms |
71380 KB |
Output is correct |
148 |
Correct |
456 ms |
78412 KB |
Output is correct |
149 |
Correct |
568 ms |
86184 KB |
Output is correct |
150 |
Correct |
650 ms |
81896 KB |
Output is correct |
151 |
Correct |
433 ms |
66832 KB |
Output is correct |
152 |
Correct |
17 ms |
25300 KB |
Output is correct |
153 |
Correct |
21 ms |
26036 KB |
Output is correct |
154 |
Correct |
295 ms |
55088 KB |
Output is correct |
155 |
Correct |
454 ms |
69452 KB |
Output is correct |
156 |
Correct |
732 ms |
83988 KB |
Output is correct |
157 |
Correct |
13 ms |
26068 KB |
Output is correct |
158 |
Correct |
12 ms |
24580 KB |
Output is correct |
159 |
Correct |
14 ms |
26068 KB |
Output is correct |
160 |
Correct |
14 ms |
26068 KB |
Output is correct |
161 |
Correct |
475 ms |
91900 KB |
Output is correct |
162 |
Correct |
486 ms |
99132 KB |
Output is correct |
163 |
Correct |
528 ms |
93136 KB |
Output is correct |
164 |
Correct |
473 ms |
93120 KB |
Output is correct |
165 |
Correct |
485 ms |
93880 KB |
Output is correct |
166 |
Correct |
489 ms |
93664 KB |
Output is correct |
167 |
Incorrect |
102 ms |
39724 KB |
Solution announced impossible, but it is possible. |
168 |
Halted |
0 ms |
0 KB |
- |