#include <bits/stdc++.h>
//#include "grader.cpp"
#include "ext/pb_ds/assoc_container.hpp"
#include "parks.h"
#define F first
#define S second
#define pb push_back
#define sz(x) (int)x.size()
#define el "\n"
#define all(x) (x).begin(), (x).end()
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("-O3")
#pragma GCC optimize("Ofast")
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
const int N = 5e5 + 500;
mt19937 rnd(time(0));
const int steps[4][2] = {{0, 2}, {2, 0}, {0, -2}, {-2, 0}};
const int dsteps[4][2] = {{1, 1}, {1, -1}, {-1, 1}, {-1, -1}};
pair <int, int> road[10][10];
pair <int, int> block[N * 2];
int pr[N];
int cmp[2 * N], to[2 * N];
vector <int> g[2 * N], gr[2 * N], ord;
bool mk[2 * N];
int f(int v) {return (pr[v] == v ? v : pr[v] = f(pr[v]));}
void link(int v, int u) {
v = f(v); u = f(u);
if (v == u) {
return;
}
pr[u] = v;
}
int nt(int x) {return (x < N ? x + N : x - N);}
void add_impl(int a, int b) {
int na = nt(a), nb = nt(b);
g[na].pb(b); gr[b].pb(na);
g[nb].pb(a); gr[a].pb(nb);
}
void dfs(int v) {
mk[v] = 1;
for (auto &u : g[v]) {
if (mk[u]) {
continue;
}
dfs(u);
}
ord.pb(v);
}
vector <pair <int, int> > pts;
void dfsd(int v) {
mk[v] = 1;
for (auto &u : g[v]) {
if (mk[u]) {
continue;
}
int dx = pts[v].F - pts[u].F;
int dy = pts[v].S - pts[u].S;
block[u] = road[dx + 4][dy + 4];
dfsd(u);
}
}
inline ll geth(int a, int b) {return ((ll)a << 20) + b;}
void get_erased_2x2(vector <int> &x, vector <int> &y, unordered_map<ll, int> &del) {
unordered_map <ll, int> cnt, who;
for (int i = 0; i < sz(x); i++) {
who[geth(x[i], y[i])] = i;
for (int j = 0; j < 4; j++) {
int cx = x[i] + dsteps[j][0];
int cy = y[i] + dsteps[j][1];
cnt[geth(cx, cy)]++;
if (cnt[geth(cx, cy)] == 4) {
pts.pb({cx, cy});
}
}
}
sort(all(pts));
cnt.clear();
int ptr = 0;
for (auto &[x, y] : pts) {
cnt[geth(x, y)] = ptr++;
}
ptr = 0;
for (auto &[x, y] : pts) {
int par = (x / 2 + y / 2) % 2;
for (int i = 0; i < 2; i++) {
int cx = x + steps[i * 2 + par][0];
int cy = y + steps[i * 2 + par][1];
if (cnt.find(geth(cx, cy)) == cnt.end()) {
continue;
}
g[cnt[geth(cx, cy)]].pb(ptr);
}
ptr++;
}
queue <int> q;
for (int i = 0; i < sz(pts); i++) {
if (mk[i]) {
continue;
}
int par = (pts[i].F / 2 + pts[i].S / 2) & 1;
if (par & 1) {
block[i] = road[-2 + 4][0 + 4];
} else {
block[i] = road[0 + 4][-2 + 4];
}
dfsd(i);
}
for (int i = 0; i < sz(pts); i++) {
auto &[x, y] = pts[i];
auto &[a, b] = block[i];
int v = who[geth(x + dsteps[a][0], y + dsteps[a][1])];
int u = who[geth(x + dsteps[b][0], y + dsteps[b][1])];
del[geth(v, u)] = del[geth(u, v)] = 1;
}
}
int construct_roads(vector <int> x, vector <int> y) {
int n = sz(x);
road[0 + 4][2 + 4] = {2, 0}; road[2 + 4][0 + 4] = {0, 1};
road[0 + 4][-2 + 4] = {1, 3}; road[-2 + 4][0 + 4] = {3, 2};
unordered_map <ll, int> mp;
vector <pair <int, int> > r;
unordered_map <ll, int> del;
vector <int> pm(n);
iota(all(pm), 0);
shuffle(all(pm), rnd);
bool sd = 1;
for (int i = 0; i < n; i++) {
mp[geth(x[i], y[i])] = i;
pr[i] = i;
sd &= (x[i] >= 2 && x[i] <= 4);
}
get_erased_2x2(x, y, del);
for (auto &i : pm) {
for (int j = 0; j < 4; j++) {
int cx = x[i] + steps[j][0];
int cy = y[i] + steps[j][1];
if (mp.find(geth(cx, cy)) != mp.end() && f(i) != f(mp[geth(cx, cy)])) {
int to = mp[geth(cx, cy)];
if (del.find(geth(i, to)) != del.end()) {
continue;
}
link(i, to);
r.pb({i, to});
}
}
}
sort(all(r));
r.resize(unique(all(r)) - r.begin());
for (int i = 0; i < n; i++) {
if (f(i) != f(0)) {
return 0;
}
}
vector <int> u, v, A, B;
unordered_map <ll, vector <int> > e;
for (int i = 0; i < sz(r); i++) {
int a = r[i].F, b = r[i].S;
u.pb(a); v.pb(b);
if (abs(x[a] - x[b]) == 0) {
int lx = x[a];
int ly = min(y[a], y[b]);
e[geth(lx - 1, ly + 1)].pb(i);
e[geth(lx + 1, ly + 1)].pb(nt(i));
} else {
int lx = min(x[a], x[b]);
int ly = y[a];
e[geth(lx + 1, ly + 1)].pb(i);
e[geth(lx + 1, ly - 1)].pb(nt(i));
}
}
for (int i = 0; i < 2 * N; i++) {
mk[i] = 0;
g[i].clear();
}
for (auto &[p, v] : e) {
if (sz(v) == 1) {
continue;
}
for (auto &a : v) {
for (auto &b : v) {
if (a == b) {
continue;
}
add_impl(a, b);
}
}
}
for (int i = 0; i < 2 * N; i++) {
cmp[i] = -1;
if (mk[i]) {
continue;
}
dfs(i);
}
reverse(all(ord));
int C = 0;
for (auto v : ord) {
function <void(int)> dfsr = [&](int v) {
if (cmp[v] != -1) {
return;
}
cmp[v] = C;
for (auto u : gr[v]) {
dfsr(u);
}
};
dfsr(v);
C++;
}
for (int i = 0; i < N; i++) {
if (cmp[i] == cmp[nt(i)]) {
return 0;
}
to[i] = (cmp[i] > cmp[nt(i)]);
}
for (int i = 0; i < sz(r); i++) {
int a = r[i].F, b = r[i].S;
if (abs(x[a] - x[b]) == 0) {
int lx = x[a];
int ly = min(y[a], y[b]);
if (to[i]) {
A.pb(lx + 1);
} else {
A.pb(lx - 1);
}
B.pb(ly + 1);
} else {
int lx = min(x[a], x[b]);
int ly = y[a];
if (to[i]) {
B.pb(ly - 1);
} else {
B.pb(ly + 1);
}
A.pb(lx + 1);
}
}
build(u, v, A, B);
return 1;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
46 ms |
58220 KB |
Output is correct |
2 |
Correct |
48 ms |
58196 KB |
Output is correct |
3 |
Correct |
27 ms |
47224 KB |
Output is correct |
4 |
Correct |
50 ms |
58124 KB |
Output is correct |
5 |
Correct |
41 ms |
58124 KB |
Output is correct |
6 |
Correct |
30 ms |
47248 KB |
Output is correct |
7 |
Correct |
31 ms |
47256 KB |
Output is correct |
8 |
Correct |
24 ms |
47316 KB |
Output is correct |
9 |
Correct |
522 ms |
89752 KB |
Output is correct |
10 |
Correct |
112 ms |
61236 KB |
Output is correct |
11 |
Correct |
147 ms |
74776 KB |
Output is correct |
12 |
Correct |
118 ms |
62656 KB |
Output is correct |
13 |
Correct |
71 ms |
57288 KB |
Output is correct |
14 |
Correct |
28 ms |
47448 KB |
Output is correct |
15 |
Correct |
27 ms |
47660 KB |
Output is correct |
16 |
Correct |
513 ms |
89664 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
46 ms |
58220 KB |
Output is correct |
2 |
Correct |
48 ms |
58196 KB |
Output is correct |
3 |
Correct |
27 ms |
47224 KB |
Output is correct |
4 |
Correct |
50 ms |
58124 KB |
Output is correct |
5 |
Correct |
41 ms |
58124 KB |
Output is correct |
6 |
Correct |
30 ms |
47248 KB |
Output is correct |
7 |
Correct |
31 ms |
47256 KB |
Output is correct |
8 |
Correct |
24 ms |
47316 KB |
Output is correct |
9 |
Correct |
522 ms |
89752 KB |
Output is correct |
10 |
Correct |
112 ms |
61236 KB |
Output is correct |
11 |
Correct |
147 ms |
74776 KB |
Output is correct |
12 |
Correct |
118 ms |
62656 KB |
Output is correct |
13 |
Correct |
71 ms |
57288 KB |
Output is correct |
14 |
Correct |
28 ms |
47448 KB |
Output is correct |
15 |
Correct |
27 ms |
47660 KB |
Output is correct |
16 |
Correct |
513 ms |
89664 KB |
Output is correct |
17 |
Correct |
49 ms |
58152 KB |
Output is correct |
18 |
Correct |
44 ms |
58136 KB |
Output is correct |
19 |
Correct |
55 ms |
58204 KB |
Output is correct |
20 |
Correct |
47 ms |
58140 KB |
Output is correct |
21 |
Correct |
29 ms |
47316 KB |
Output is correct |
22 |
Correct |
46 ms |
58212 KB |
Output is correct |
23 |
Correct |
1792 ms |
133996 KB |
Output is correct |
24 |
Correct |
50 ms |
58220 KB |
Output is correct |
25 |
Correct |
50 ms |
58620 KB |
Output is correct |
26 |
Correct |
33 ms |
47888 KB |
Output is correct |
27 |
Correct |
33 ms |
48104 KB |
Output is correct |
28 |
Correct |
550 ms |
87856 KB |
Output is correct |
29 |
Correct |
912 ms |
102280 KB |
Output is correct |
30 |
Correct |
1346 ms |
117888 KB |
Output is correct |
31 |
Correct |
1838 ms |
133864 KB |
Output is correct |
32 |
Correct |
52 ms |
58184 KB |
Output is correct |
33 |
Correct |
48 ms |
58196 KB |
Output is correct |
34 |
Correct |
50 ms |
58268 KB |
Output is correct |
35 |
Correct |
30 ms |
47248 KB |
Output is correct |
36 |
Correct |
27 ms |
47444 KB |
Output is correct |
37 |
Correct |
44 ms |
58116 KB |
Output is correct |
38 |
Correct |
46 ms |
58192 KB |
Output is correct |
39 |
Correct |
48 ms |
58180 KB |
Output is correct |
40 |
Correct |
50 ms |
58168 KB |
Output is correct |
41 |
Correct |
24 ms |
47300 KB |
Output is correct |
42 |
Correct |
46 ms |
58244 KB |
Output is correct |
43 |
Correct |
30 ms |
47700 KB |
Output is correct |
44 |
Correct |
32 ms |
47820 KB |
Output is correct |
45 |
Correct |
520 ms |
91156 KB |
Output is correct |
46 |
Correct |
930 ms |
107140 KB |
Output is correct |
47 |
Correct |
990 ms |
106980 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
46 ms |
58220 KB |
Output is correct |
2 |
Correct |
48 ms |
58196 KB |
Output is correct |
3 |
Correct |
27 ms |
47224 KB |
Output is correct |
4 |
Correct |
50 ms |
58124 KB |
Output is correct |
5 |
Correct |
41 ms |
58124 KB |
Output is correct |
6 |
Correct |
30 ms |
47248 KB |
Output is correct |
7 |
Correct |
31 ms |
47256 KB |
Output is correct |
8 |
Correct |
24 ms |
47316 KB |
Output is correct |
9 |
Correct |
522 ms |
89752 KB |
Output is correct |
10 |
Correct |
112 ms |
61236 KB |
Output is correct |
11 |
Correct |
147 ms |
74776 KB |
Output is correct |
12 |
Correct |
118 ms |
62656 KB |
Output is correct |
13 |
Correct |
71 ms |
57288 KB |
Output is correct |
14 |
Correct |
28 ms |
47448 KB |
Output is correct |
15 |
Correct |
27 ms |
47660 KB |
Output is correct |
16 |
Correct |
513 ms |
89664 KB |
Output is correct |
17 |
Correct |
49 ms |
58152 KB |
Output is correct |
18 |
Correct |
44 ms |
58136 KB |
Output is correct |
19 |
Correct |
55 ms |
58204 KB |
Output is correct |
20 |
Correct |
47 ms |
58140 KB |
Output is correct |
21 |
Correct |
29 ms |
47316 KB |
Output is correct |
22 |
Correct |
46 ms |
58212 KB |
Output is correct |
23 |
Correct |
1792 ms |
133996 KB |
Output is correct |
24 |
Correct |
50 ms |
58220 KB |
Output is correct |
25 |
Correct |
50 ms |
58620 KB |
Output is correct |
26 |
Correct |
33 ms |
47888 KB |
Output is correct |
27 |
Correct |
33 ms |
48104 KB |
Output is correct |
28 |
Correct |
550 ms |
87856 KB |
Output is correct |
29 |
Correct |
912 ms |
102280 KB |
Output is correct |
30 |
Correct |
1346 ms |
117888 KB |
Output is correct |
31 |
Correct |
1838 ms |
133864 KB |
Output is correct |
32 |
Correct |
52 ms |
58184 KB |
Output is correct |
33 |
Correct |
48 ms |
58196 KB |
Output is correct |
34 |
Correct |
50 ms |
58268 KB |
Output is correct |
35 |
Correct |
30 ms |
47248 KB |
Output is correct |
36 |
Correct |
27 ms |
47444 KB |
Output is correct |
37 |
Correct |
44 ms |
58116 KB |
Output is correct |
38 |
Correct |
46 ms |
58192 KB |
Output is correct |
39 |
Correct |
48 ms |
58180 KB |
Output is correct |
40 |
Correct |
50 ms |
58168 KB |
Output is correct |
41 |
Correct |
24 ms |
47300 KB |
Output is correct |
42 |
Correct |
46 ms |
58244 KB |
Output is correct |
43 |
Correct |
30 ms |
47700 KB |
Output is correct |
44 |
Correct |
32 ms |
47820 KB |
Output is correct |
45 |
Correct |
520 ms |
91156 KB |
Output is correct |
46 |
Correct |
930 ms |
107140 KB |
Output is correct |
47 |
Correct |
990 ms |
106980 KB |
Output is correct |
48 |
Correct |
58 ms |
58208 KB |
Output is correct |
49 |
Correct |
52 ms |
58220 KB |
Output is correct |
50 |
Correct |
47 ms |
58216 KB |
Output is correct |
51 |
Correct |
44 ms |
58224 KB |
Output is correct |
52 |
Correct |
60 ms |
58168 KB |
Output is correct |
53 |
Correct |
45 ms |
58220 KB |
Output is correct |
54 |
Correct |
44 ms |
58128 KB |
Output is correct |
55 |
Correct |
1948 ms |
149208 KB |
Output is correct |
56 |
Correct |
67 ms |
58188 KB |
Output is correct |
57 |
Correct |
50 ms |
58928 KB |
Output is correct |
58 |
Correct |
82 ms |
60972 KB |
Output is correct |
59 |
Correct |
42 ms |
49724 KB |
Output is correct |
60 |
Correct |
675 ms |
103476 KB |
Output is correct |
61 |
Correct |
1076 ms |
122184 KB |
Output is correct |
62 |
Correct |
1342 ms |
133868 KB |
Output is correct |
63 |
Correct |
1766 ms |
149096 KB |
Output is correct |
64 |
Correct |
23 ms |
47316 KB |
Output is correct |
65 |
Correct |
61 ms |
58236 KB |
Output is correct |
66 |
Correct |
24 ms |
47316 KB |
Output is correct |
67 |
Correct |
1229 ms |
122016 KB |
Output is correct |
68 |
Correct |
1301 ms |
121932 KB |
Output is correct |
69 |
Correct |
1219 ms |
121676 KB |
Output is correct |
70 |
Correct |
35 ms |
47948 KB |
Output is correct |
71 |
Correct |
35 ms |
48716 KB |
Output is correct |
72 |
Correct |
499 ms |
91432 KB |
Output is correct |
73 |
Correct |
907 ms |
108700 KB |
Output is correct |
74 |
Correct |
1360 ms |
125572 KB |
Output is correct |
75 |
Correct |
1305 ms |
123200 KB |
Output is correct |
76 |
Correct |
1203 ms |
121872 KB |
Output is correct |
77 |
Correct |
36 ms |
48072 KB |
Output is correct |
78 |
Correct |
40 ms |
48816 KB |
Output is correct |
79 |
Correct |
548 ms |
91124 KB |
Output is correct |
80 |
Correct |
928 ms |
109080 KB |
Output is correct |
81 |
Correct |
1397 ms |
125192 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
46 ms |
58220 KB |
Output is correct |
2 |
Correct |
48 ms |
58196 KB |
Output is correct |
3 |
Correct |
27 ms |
47224 KB |
Output is correct |
4 |
Correct |
50 ms |
58124 KB |
Output is correct |
5 |
Correct |
41 ms |
58124 KB |
Output is correct |
6 |
Correct |
30 ms |
47248 KB |
Output is correct |
7 |
Correct |
31 ms |
47256 KB |
Output is correct |
8 |
Correct |
24 ms |
47316 KB |
Output is correct |
9 |
Correct |
522 ms |
89752 KB |
Output is correct |
10 |
Correct |
112 ms |
61236 KB |
Output is correct |
11 |
Correct |
147 ms |
74776 KB |
Output is correct |
12 |
Correct |
118 ms |
62656 KB |
Output is correct |
13 |
Correct |
71 ms |
57288 KB |
Output is correct |
14 |
Correct |
28 ms |
47448 KB |
Output is correct |
15 |
Correct |
27 ms |
47660 KB |
Output is correct |
16 |
Correct |
513 ms |
89664 KB |
Output is correct |
17 |
Correct |
44 ms |
58196 KB |
Output is correct |
18 |
Correct |
41 ms |
58200 KB |
Output is correct |
19 |
Correct |
25 ms |
47264 KB |
Output is correct |
20 |
Correct |
1263 ms |
132932 KB |
Output is correct |
21 |
Correct |
1267 ms |
131032 KB |
Output is correct |
22 |
Correct |
1370 ms |
130036 KB |
Output is correct |
23 |
Correct |
754 ms |
109468 KB |
Output is correct |
24 |
Correct |
567 ms |
109116 KB |
Output is correct |
25 |
Correct |
624 ms |
88352 KB |
Output is correct |
26 |
Correct |
638 ms |
88436 KB |
Output is correct |
27 |
Correct |
1045 ms |
121960 KB |
Output is correct |
28 |
Correct |
1010 ms |
121848 KB |
Output is correct |
29 |
Correct |
916 ms |
121852 KB |
Output is correct |
30 |
Correct |
941 ms |
121856 KB |
Output is correct |
31 |
Correct |
44 ms |
58212 KB |
Output is correct |
32 |
Correct |
77 ms |
62860 KB |
Output is correct |
33 |
Correct |
205 ms |
70776 KB |
Output is correct |
34 |
Correct |
1066 ms |
133828 KB |
Output is correct |
35 |
Correct |
39 ms |
48952 KB |
Output is correct |
36 |
Correct |
108 ms |
56308 KB |
Output is correct |
37 |
Correct |
252 ms |
65392 KB |
Output is correct |
38 |
Correct |
413 ms |
85904 KB |
Output is correct |
39 |
Correct |
618 ms |
95028 KB |
Output is correct |
40 |
Correct |
857 ms |
106136 KB |
Output is correct |
41 |
Correct |
1034 ms |
116408 KB |
Output is correct |
42 |
Correct |
1249 ms |
125852 KB |
Output is correct |
43 |
Correct |
40 ms |
58200 KB |
Output is correct |
44 |
Correct |
41 ms |
58216 KB |
Output is correct |
45 |
Correct |
46 ms |
58204 KB |
Output is correct |
46 |
Correct |
35 ms |
47224 KB |
Output is correct |
47 |
Correct |
24 ms |
47316 KB |
Output is correct |
48 |
Correct |
50 ms |
58204 KB |
Output is correct |
49 |
Correct |
47 ms |
58184 KB |
Output is correct |
50 |
Correct |
42 ms |
58232 KB |
Output is correct |
51 |
Correct |
41 ms |
58196 KB |
Output is correct |
52 |
Correct |
24 ms |
47312 KB |
Output is correct |
53 |
Correct |
41 ms |
58212 KB |
Output is correct |
54 |
Correct |
25 ms |
47628 KB |
Output is correct |
55 |
Correct |
26 ms |
47940 KB |
Output is correct |
56 |
Correct |
493 ms |
91028 KB |
Output is correct |
57 |
Correct |
804 ms |
107044 KB |
Output is correct |
58 |
Correct |
795 ms |
107236 KB |
Output is correct |
59 |
Correct |
25 ms |
47364 KB |
Output is correct |
60 |
Correct |
40 ms |
58124 KB |
Output is correct |
61 |
Correct |
25 ms |
47296 KB |
Output is correct |
62 |
Correct |
1148 ms |
122004 KB |
Output is correct |
63 |
Correct |
1132 ms |
121928 KB |
Output is correct |
64 |
Correct |
1159 ms |
121628 KB |
Output is correct |
65 |
Correct |
34 ms |
48040 KB |
Output is correct |
66 |
Correct |
33 ms |
48704 KB |
Output is correct |
67 |
Correct |
504 ms |
91368 KB |
Output is correct |
68 |
Correct |
884 ms |
108984 KB |
Output is correct |
69 |
Correct |
1280 ms |
124724 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
46 ms |
58220 KB |
Output is correct |
2 |
Correct |
48 ms |
58196 KB |
Output is correct |
3 |
Correct |
27 ms |
47224 KB |
Output is correct |
4 |
Correct |
50 ms |
58124 KB |
Output is correct |
5 |
Correct |
41 ms |
58124 KB |
Output is correct |
6 |
Correct |
30 ms |
47248 KB |
Output is correct |
7 |
Correct |
31 ms |
47256 KB |
Output is correct |
8 |
Correct |
24 ms |
47316 KB |
Output is correct |
9 |
Correct |
522 ms |
89752 KB |
Output is correct |
10 |
Correct |
112 ms |
61236 KB |
Output is correct |
11 |
Correct |
147 ms |
74776 KB |
Output is correct |
12 |
Correct |
118 ms |
62656 KB |
Output is correct |
13 |
Correct |
71 ms |
57288 KB |
Output is correct |
14 |
Correct |
28 ms |
47448 KB |
Output is correct |
15 |
Correct |
27 ms |
47660 KB |
Output is correct |
16 |
Correct |
513 ms |
89664 KB |
Output is correct |
17 |
Correct |
1034 ms |
121148 KB |
Output is correct |
18 |
Correct |
1123 ms |
121148 KB |
Output is correct |
19 |
Correct |
1292 ms |
132688 KB |
Output is correct |
20 |
Correct |
1210 ms |
124296 KB |
Output is correct |
21 |
Correct |
1028 ms |
114768 KB |
Output is correct |
22 |
Correct |
49 ms |
58116 KB |
Output is correct |
23 |
Correct |
159 ms |
68612 KB |
Output is correct |
24 |
Correct |
50 ms |
50596 KB |
Output is correct |
25 |
Correct |
158 ms |
59248 KB |
Output is correct |
26 |
Correct |
328 ms |
69384 KB |
Output is correct |
27 |
Correct |
574 ms |
91856 KB |
Output is correct |
28 |
Correct |
742 ms |
99472 KB |
Output is correct |
29 |
Correct |
902 ms |
110220 KB |
Output is correct |
30 |
Correct |
1114 ms |
118260 KB |
Output is correct |
31 |
Correct |
1221 ms |
125692 KB |
Output is correct |
32 |
Correct |
1294 ms |
123776 KB |
Output is correct |
33 |
Correct |
1197 ms |
122024 KB |
Output is correct |
34 |
Correct |
28 ms |
48076 KB |
Output is correct |
35 |
Correct |
36 ms |
48892 KB |
Output is correct |
36 |
Correct |
501 ms |
91068 KB |
Output is correct |
37 |
Correct |
887 ms |
108592 KB |
Output is correct |
38 |
Correct |
1340 ms |
125172 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
46 ms |
58220 KB |
Output is correct |
2 |
Correct |
48 ms |
58196 KB |
Output is correct |
3 |
Correct |
27 ms |
47224 KB |
Output is correct |
4 |
Correct |
50 ms |
58124 KB |
Output is correct |
5 |
Correct |
41 ms |
58124 KB |
Output is correct |
6 |
Correct |
30 ms |
47248 KB |
Output is correct |
7 |
Correct |
31 ms |
47256 KB |
Output is correct |
8 |
Correct |
24 ms |
47316 KB |
Output is correct |
9 |
Correct |
522 ms |
89752 KB |
Output is correct |
10 |
Correct |
112 ms |
61236 KB |
Output is correct |
11 |
Correct |
147 ms |
74776 KB |
Output is correct |
12 |
Correct |
118 ms |
62656 KB |
Output is correct |
13 |
Correct |
71 ms |
57288 KB |
Output is correct |
14 |
Correct |
28 ms |
47448 KB |
Output is correct |
15 |
Correct |
27 ms |
47660 KB |
Output is correct |
16 |
Correct |
513 ms |
89664 KB |
Output is correct |
17 |
Correct |
49 ms |
58152 KB |
Output is correct |
18 |
Correct |
44 ms |
58136 KB |
Output is correct |
19 |
Correct |
55 ms |
58204 KB |
Output is correct |
20 |
Correct |
47 ms |
58140 KB |
Output is correct |
21 |
Correct |
29 ms |
47316 KB |
Output is correct |
22 |
Correct |
46 ms |
58212 KB |
Output is correct |
23 |
Correct |
1792 ms |
133996 KB |
Output is correct |
24 |
Correct |
50 ms |
58220 KB |
Output is correct |
25 |
Correct |
50 ms |
58620 KB |
Output is correct |
26 |
Correct |
33 ms |
47888 KB |
Output is correct |
27 |
Correct |
33 ms |
48104 KB |
Output is correct |
28 |
Correct |
550 ms |
87856 KB |
Output is correct |
29 |
Correct |
912 ms |
102280 KB |
Output is correct |
30 |
Correct |
1346 ms |
117888 KB |
Output is correct |
31 |
Correct |
1838 ms |
133864 KB |
Output is correct |
32 |
Correct |
52 ms |
58184 KB |
Output is correct |
33 |
Correct |
48 ms |
58196 KB |
Output is correct |
34 |
Correct |
50 ms |
58268 KB |
Output is correct |
35 |
Correct |
30 ms |
47248 KB |
Output is correct |
36 |
Correct |
27 ms |
47444 KB |
Output is correct |
37 |
Correct |
44 ms |
58116 KB |
Output is correct |
38 |
Correct |
46 ms |
58192 KB |
Output is correct |
39 |
Correct |
48 ms |
58180 KB |
Output is correct |
40 |
Correct |
50 ms |
58168 KB |
Output is correct |
41 |
Correct |
24 ms |
47300 KB |
Output is correct |
42 |
Correct |
46 ms |
58244 KB |
Output is correct |
43 |
Correct |
30 ms |
47700 KB |
Output is correct |
44 |
Correct |
32 ms |
47820 KB |
Output is correct |
45 |
Correct |
520 ms |
91156 KB |
Output is correct |
46 |
Correct |
930 ms |
107140 KB |
Output is correct |
47 |
Correct |
990 ms |
106980 KB |
Output is correct |
48 |
Correct |
58 ms |
58208 KB |
Output is correct |
49 |
Correct |
52 ms |
58220 KB |
Output is correct |
50 |
Correct |
47 ms |
58216 KB |
Output is correct |
51 |
Correct |
44 ms |
58224 KB |
Output is correct |
52 |
Correct |
60 ms |
58168 KB |
Output is correct |
53 |
Correct |
45 ms |
58220 KB |
Output is correct |
54 |
Correct |
44 ms |
58128 KB |
Output is correct |
55 |
Correct |
1948 ms |
149208 KB |
Output is correct |
56 |
Correct |
67 ms |
58188 KB |
Output is correct |
57 |
Correct |
50 ms |
58928 KB |
Output is correct |
58 |
Correct |
82 ms |
60972 KB |
Output is correct |
59 |
Correct |
42 ms |
49724 KB |
Output is correct |
60 |
Correct |
675 ms |
103476 KB |
Output is correct |
61 |
Correct |
1076 ms |
122184 KB |
Output is correct |
62 |
Correct |
1342 ms |
133868 KB |
Output is correct |
63 |
Correct |
1766 ms |
149096 KB |
Output is correct |
64 |
Correct |
23 ms |
47316 KB |
Output is correct |
65 |
Correct |
61 ms |
58236 KB |
Output is correct |
66 |
Correct |
24 ms |
47316 KB |
Output is correct |
67 |
Correct |
1229 ms |
122016 KB |
Output is correct |
68 |
Correct |
1301 ms |
121932 KB |
Output is correct |
69 |
Correct |
1219 ms |
121676 KB |
Output is correct |
70 |
Correct |
35 ms |
47948 KB |
Output is correct |
71 |
Correct |
35 ms |
48716 KB |
Output is correct |
72 |
Correct |
499 ms |
91432 KB |
Output is correct |
73 |
Correct |
907 ms |
108700 KB |
Output is correct |
74 |
Correct |
1360 ms |
125572 KB |
Output is correct |
75 |
Correct |
1305 ms |
123200 KB |
Output is correct |
76 |
Correct |
1203 ms |
121872 KB |
Output is correct |
77 |
Correct |
36 ms |
48072 KB |
Output is correct |
78 |
Correct |
40 ms |
48816 KB |
Output is correct |
79 |
Correct |
548 ms |
91124 KB |
Output is correct |
80 |
Correct |
928 ms |
109080 KB |
Output is correct |
81 |
Correct |
1397 ms |
125192 KB |
Output is correct |
82 |
Correct |
44 ms |
58196 KB |
Output is correct |
83 |
Correct |
41 ms |
58200 KB |
Output is correct |
84 |
Correct |
25 ms |
47264 KB |
Output is correct |
85 |
Correct |
1263 ms |
132932 KB |
Output is correct |
86 |
Correct |
1267 ms |
131032 KB |
Output is correct |
87 |
Correct |
1370 ms |
130036 KB |
Output is correct |
88 |
Correct |
754 ms |
109468 KB |
Output is correct |
89 |
Correct |
567 ms |
109116 KB |
Output is correct |
90 |
Correct |
624 ms |
88352 KB |
Output is correct |
91 |
Correct |
638 ms |
88436 KB |
Output is correct |
92 |
Correct |
1045 ms |
121960 KB |
Output is correct |
93 |
Correct |
1010 ms |
121848 KB |
Output is correct |
94 |
Correct |
916 ms |
121852 KB |
Output is correct |
95 |
Correct |
941 ms |
121856 KB |
Output is correct |
96 |
Correct |
44 ms |
58212 KB |
Output is correct |
97 |
Correct |
77 ms |
62860 KB |
Output is correct |
98 |
Correct |
205 ms |
70776 KB |
Output is correct |
99 |
Correct |
1066 ms |
133828 KB |
Output is correct |
100 |
Correct |
39 ms |
48952 KB |
Output is correct |
101 |
Correct |
108 ms |
56308 KB |
Output is correct |
102 |
Correct |
252 ms |
65392 KB |
Output is correct |
103 |
Correct |
413 ms |
85904 KB |
Output is correct |
104 |
Correct |
618 ms |
95028 KB |
Output is correct |
105 |
Correct |
857 ms |
106136 KB |
Output is correct |
106 |
Correct |
1034 ms |
116408 KB |
Output is correct |
107 |
Correct |
1249 ms |
125852 KB |
Output is correct |
108 |
Correct |
40 ms |
58200 KB |
Output is correct |
109 |
Correct |
41 ms |
58216 KB |
Output is correct |
110 |
Correct |
46 ms |
58204 KB |
Output is correct |
111 |
Correct |
35 ms |
47224 KB |
Output is correct |
112 |
Correct |
24 ms |
47316 KB |
Output is correct |
113 |
Correct |
50 ms |
58204 KB |
Output is correct |
114 |
Correct |
47 ms |
58184 KB |
Output is correct |
115 |
Correct |
42 ms |
58232 KB |
Output is correct |
116 |
Correct |
41 ms |
58196 KB |
Output is correct |
117 |
Correct |
24 ms |
47312 KB |
Output is correct |
118 |
Correct |
41 ms |
58212 KB |
Output is correct |
119 |
Correct |
25 ms |
47628 KB |
Output is correct |
120 |
Correct |
26 ms |
47940 KB |
Output is correct |
121 |
Correct |
493 ms |
91028 KB |
Output is correct |
122 |
Correct |
804 ms |
107044 KB |
Output is correct |
123 |
Correct |
795 ms |
107236 KB |
Output is correct |
124 |
Correct |
25 ms |
47364 KB |
Output is correct |
125 |
Correct |
40 ms |
58124 KB |
Output is correct |
126 |
Correct |
25 ms |
47296 KB |
Output is correct |
127 |
Correct |
1148 ms |
122004 KB |
Output is correct |
128 |
Correct |
1132 ms |
121928 KB |
Output is correct |
129 |
Correct |
1159 ms |
121628 KB |
Output is correct |
130 |
Correct |
34 ms |
48040 KB |
Output is correct |
131 |
Correct |
33 ms |
48704 KB |
Output is correct |
132 |
Correct |
504 ms |
91368 KB |
Output is correct |
133 |
Correct |
884 ms |
108984 KB |
Output is correct |
134 |
Correct |
1280 ms |
124724 KB |
Output is correct |
135 |
Correct |
1034 ms |
121148 KB |
Output is correct |
136 |
Correct |
1123 ms |
121148 KB |
Output is correct |
137 |
Correct |
1292 ms |
132688 KB |
Output is correct |
138 |
Correct |
1210 ms |
124296 KB |
Output is correct |
139 |
Correct |
1028 ms |
114768 KB |
Output is correct |
140 |
Correct |
49 ms |
58116 KB |
Output is correct |
141 |
Correct |
159 ms |
68612 KB |
Output is correct |
142 |
Correct |
50 ms |
50596 KB |
Output is correct |
143 |
Correct |
158 ms |
59248 KB |
Output is correct |
144 |
Correct |
328 ms |
69384 KB |
Output is correct |
145 |
Correct |
574 ms |
91856 KB |
Output is correct |
146 |
Correct |
742 ms |
99472 KB |
Output is correct |
147 |
Correct |
902 ms |
110220 KB |
Output is correct |
148 |
Correct |
1114 ms |
118260 KB |
Output is correct |
149 |
Correct |
1221 ms |
125692 KB |
Output is correct |
150 |
Correct |
1294 ms |
123776 KB |
Output is correct |
151 |
Correct |
1197 ms |
122024 KB |
Output is correct |
152 |
Correct |
28 ms |
48076 KB |
Output is correct |
153 |
Correct |
36 ms |
48892 KB |
Output is correct |
154 |
Correct |
501 ms |
91068 KB |
Output is correct |
155 |
Correct |
887 ms |
108592 KB |
Output is correct |
156 |
Correct |
1340 ms |
125172 KB |
Output is correct |
157 |
Correct |
41 ms |
58200 KB |
Output is correct |
158 |
Correct |
23 ms |
47268 KB |
Output is correct |
159 |
Correct |
64 ms |
58208 KB |
Output is correct |
160 |
Correct |
42 ms |
58168 KB |
Output is correct |
161 |
Correct |
1653 ms |
164064 KB |
Output is correct |
162 |
Correct |
1098 ms |
132756 KB |
Output is correct |
163 |
Correct |
1398 ms |
132728 KB |
Output is correct |
164 |
Correct |
1328 ms |
133960 KB |
Output is correct |
165 |
Correct |
1742 ms |
149112 KB |
Output is correct |
166 |
Correct |
1516 ms |
154652 KB |
Output is correct |
167 |
Correct |
270 ms |
77400 KB |
Output is correct |
168 |
Correct |
90 ms |
56360 KB |
Output is correct |
169 |
Correct |
340 ms |
68868 KB |
Output is correct |
170 |
Correct |
683 ms |
87572 KB |
Output is correct |
171 |
Correct |
969 ms |
106784 KB |
Output is correct |
172 |
Correct |
819 ms |
107412 KB |
Output is correct |
173 |
Correct |
945 ms |
115948 KB |
Output is correct |
174 |
Correct |
1190 ms |
124096 KB |
Output is correct |
175 |
Correct |
1387 ms |
132688 KB |
Output is correct |
176 |
Correct |
1537 ms |
148552 KB |
Output is correct |
177 |
Correct |
1763 ms |
157924 KB |
Output is correct |