#include "parks.h"
#include <bits/stdc++.h>
using namespace std;
using pii = pair<int,int>;
template<typename T> ostream& operator<<(ostream &os, const vector<T> &v) { os << '['; string sep = ""; for (const auto &x : v) os << sep << x, sep = ", "; return os << ']'; }
template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; }
template<typename A> ostream& operator<<(ostream &os, const set<A> &s) { os << '{'; string sep = ""; for (const auto &x : s) os << sep << x, sep = ", "; return os << '}'; }
template<typename A, typename B> ostream& operator<<(ostream &os, const map<A, B> &m) { os << '{'; string sep = ""; for (const auto &x : m) os << sep << x.first << " -> " << x.second, sep = ", "; return os << '}'; }
void debug() { cerr << endl; }
template<typename Ini, typename... Fim> void debug(Ini I, Fim... F) { cerr << I; if(sizeof...(F)) cerr << ", "; debug(F...);}
#define db(...) cerr << "DEBUG (" << #__VA_ARGS__ << ") == ", debug(__VA_ARGS__)
#define pb push_back
#define sz(a) ((int)(a).size())
#define all(a) (a).begin(),(a).end()
#define ff first
#define ss second
constexpr int inf = 0x3f3f3f3f;
constexpr int maxn = 8e5 + 10;
mt19937 rng(random_device{}());
int rnd(int x) { return (rng() % x + x) % x; }
vector<int> g[maxn];
int match[maxn];
bool mark[maxn];
int t, n, qtd_ruas;
bool dfs(int u) {
mark[u] = 1;
if(u >= qtd_ruas) return (match[u] == -1 ? 1 : dfs(match[u]));
for(int v : g[u]) {
if(mark[v] || !dfs(v)) continue;
match[u] = v; match[v] = u;
return 1;
}
return 0;
}
struct Road { // todas as ruas possiveis
int x, y, tipo; // ponto inicial da rua e se é vertical ou horizontal
} ruas[maxn];
pii conecta[maxn];
struct Banco {
int x, y;
} bancos[maxn];
map<pair<int,int>, int> mp; // salva o id dos pontos
inline void add(int a, int b) { g[a].pb(b), g[b].pb(a); }
int get(pii p) {
if(mp.count(p)) return mp[p];
bancos[t] = {p.ff, p.ss};
return mp[p] = t++;
}
bool mark2[maxn];
int vis = 0;
void vai(int x, int y) {
++vis;
int id = mp[pii(x, y)];
mark2[id] = 1;
vector<int> gld(4); iota(all(gld), 0); shuffle(all(gld), rng);
for(int opa : gld) {
if(opa == 0 && mp.count({x+2, y}) && !mark2[mp[pii(x+2, y)]]) {
conecta[t] = {id, mp[pii(x+2, y)]};
ruas[t++] = {x, y, 0};
// db(x, y, x+2, y);
vai(x+2, y);
}
if(opa == 1 && mp.count({x-2, y}) && !mark2[mp[pii(x-2, y)]]) {
conecta[t] = {mp[pii(x-2, y)], id};
ruas[t++] = {x-2, y, 0};
// db(x, y, x-2, y);
vai(x-2, y);
}
if(opa == 2 && mp.count({x, y+2}) && !mark2[mp[pii(x, y+2)]]) {
conecta[t] = {id, mp[pii(x, y+2)]};
ruas[t++] = {x, y, 1};
// db(x, y, x, y+2);
vai(x, y+2);
}
if(opa == 3 && mp.count({x, y-2}) && !mark2[mp[pii(x, y-2)]]) {
conecta[t] = {mp[pii(x, y-2)], id};
ruas[t++] = {x, y-2, 1};
// db(x, y, x, y-2);
vai(x, y-2);
}
}
}
int bonitao(vector<int> x, vector<int> y) {
mp.clear(); vis = t = n = qtd_ruas = 0;
memset(bancos, 0, sizeof bancos);
memset(mark, 0, sizeof mark);
memset(mark2, 0, sizeof mark2);
memset(match, 0, sizeof match);
for(int i = 0; i < maxn; i++)
g[i].clear(), conecta[i] = {0, 0};
n = sz(x);
for(int i = 0; i < n; i++)
mp[pii(x[i], y[i])] = i;
int hm = rnd(n);
vai(x[hm], y[hm]);
if(vis != n) return -1; // impossivel, o grafo completo não é conexo
qtd_ruas = t;
for(int i = 0; i < qtd_ruas; i++) {
auto [X, Y, tipo] = ruas[i];
if(!tipo) {
int aq = get({X+1, Y+1});
add(i, aq);
aq = get({X+1, Y-1});
add(i, aq);
} else {
int aq = get({X+1, Y+1});
add(i, aq);
aq = get({X-1, Y+1});
add(i, aq);
}
}
int ans = 0;
memset(match, -1, sizeof match);
vector<int> p(qtd_ruas); iota(all(p), 0);
for(int i = 0; i < t; i++)
shuffle(all(g[i]), rng);
for(int antes = -1; ans != antes;) {
antes = ans;
memset(mark, 0, sizeof mark);
shuffle(all(p), rng);
for(int i = 0; i < qtd_ruas; i++)
if(!mark[p[i]] && match[p[i]] == -1 && dfs(p[i])) ++ans;
}
if(ans != qtd_ruas) return 0;
vector<int> u(qtd_ruas), v(qtd_ruas), a(qtd_ruas), b(qtd_ruas);
for(int i = 0; i < qtd_ruas; i++) {
u[i] = conecta[i].ff, v[i] = conecta[i].ss;
a[i] = bancos[match[i]].x, b[i] = bancos[match[i]].y;
}
build(u, v, a, b);
return 1;
}
int construct_roads(vector<int> x, vector<int> y) {
for(int i = 0; i < 3; i++) {
int a = bonitao(x, y);
if(a == -1) return 0;
if(a == 0) continue;
return 1;
}
// assert(0);
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
23 ms |
36300 KB |
Output is correct |
2 |
Correct |
23 ms |
36224 KB |
Output is correct |
3 |
Correct |
23 ms |
36208 KB |
Output is correct |
4 |
Correct |
23 ms |
36296 KB |
Output is correct |
5 |
Correct |
26 ms |
36252 KB |
Output is correct |
6 |
Correct |
21 ms |
36300 KB |
Output is correct |
7 |
Correct |
24 ms |
36228 KB |
Output is correct |
8 |
Correct |
23 ms |
36292 KB |
Output is correct |
9 |
Correct |
351 ms |
88072 KB |
Output is correct |
10 |
Correct |
49 ms |
41540 KB |
Output is correct |
11 |
Correct |
198 ms |
61896 KB |
Output is correct |
12 |
Correct |
69 ms |
44612 KB |
Output is correct |
13 |
Correct |
72 ms |
44440 KB |
Output is correct |
14 |
Correct |
22 ms |
36404 KB |
Output is correct |
15 |
Correct |
24 ms |
36520 KB |
Output is correct |
16 |
Correct |
362 ms |
91948 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
23 ms |
36300 KB |
Output is correct |
2 |
Correct |
23 ms |
36224 KB |
Output is correct |
3 |
Correct |
23 ms |
36208 KB |
Output is correct |
4 |
Correct |
23 ms |
36296 KB |
Output is correct |
5 |
Correct |
26 ms |
36252 KB |
Output is correct |
6 |
Correct |
21 ms |
36300 KB |
Output is correct |
7 |
Correct |
24 ms |
36228 KB |
Output is correct |
8 |
Correct |
23 ms |
36292 KB |
Output is correct |
9 |
Correct |
351 ms |
88072 KB |
Output is correct |
10 |
Correct |
49 ms |
41540 KB |
Output is correct |
11 |
Correct |
198 ms |
61896 KB |
Output is correct |
12 |
Correct |
69 ms |
44612 KB |
Output is correct |
13 |
Correct |
72 ms |
44440 KB |
Output is correct |
14 |
Correct |
22 ms |
36404 KB |
Output is correct |
15 |
Correct |
24 ms |
36520 KB |
Output is correct |
16 |
Correct |
362 ms |
91948 KB |
Output is correct |
17 |
Correct |
24 ms |
36272 KB |
Output is correct |
18 |
Correct |
23 ms |
36244 KB |
Output is correct |
19 |
Correct |
24 ms |
36212 KB |
Output is correct |
20 |
Correct |
24 ms |
36288 KB |
Output is correct |
21 |
Correct |
22 ms |
36240 KB |
Output is correct |
22 |
Correct |
23 ms |
36300 KB |
Output is correct |
23 |
Correct |
816 ms |
113748 KB |
Output is correct |
24 |
Correct |
24 ms |
36300 KB |
Output is correct |
25 |
Correct |
26 ms |
36724 KB |
Output is correct |
26 |
Correct |
25 ms |
36700 KB |
Output is correct |
27 |
Correct |
28 ms |
36624 KB |
Output is correct |
28 |
Correct |
287 ms |
66252 KB |
Output is correct |
29 |
Correct |
441 ms |
88644 KB |
Output is correct |
30 |
Correct |
617 ms |
96316 KB |
Output is correct |
31 |
Correct |
780 ms |
115224 KB |
Output is correct |
32 |
Correct |
24 ms |
36220 KB |
Output is correct |
33 |
Correct |
24 ms |
36240 KB |
Output is correct |
34 |
Correct |
23 ms |
36312 KB |
Output is correct |
35 |
Correct |
27 ms |
36264 KB |
Output is correct |
36 |
Correct |
26 ms |
36232 KB |
Output is correct |
37 |
Correct |
26 ms |
36216 KB |
Output is correct |
38 |
Correct |
26 ms |
36300 KB |
Output is correct |
39 |
Correct |
25 ms |
36320 KB |
Output is correct |
40 |
Correct |
24 ms |
36300 KB |
Output is correct |
41 |
Correct |
24 ms |
36300 KB |
Output is correct |
42 |
Correct |
23 ms |
36300 KB |
Output is correct |
43 |
Correct |
29 ms |
36652 KB |
Output is correct |
44 |
Correct |
25 ms |
36520 KB |
Output is correct |
45 |
Correct |
349 ms |
75988 KB |
Output is correct |
46 |
Correct |
605 ms |
94772 KB |
Output is correct |
47 |
Correct |
535 ms |
97224 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
23 ms |
36300 KB |
Output is correct |
2 |
Correct |
23 ms |
36224 KB |
Output is correct |
3 |
Correct |
23 ms |
36208 KB |
Output is correct |
4 |
Correct |
23 ms |
36296 KB |
Output is correct |
5 |
Correct |
26 ms |
36252 KB |
Output is correct |
6 |
Correct |
21 ms |
36300 KB |
Output is correct |
7 |
Correct |
24 ms |
36228 KB |
Output is correct |
8 |
Correct |
23 ms |
36292 KB |
Output is correct |
9 |
Correct |
351 ms |
88072 KB |
Output is correct |
10 |
Correct |
49 ms |
41540 KB |
Output is correct |
11 |
Correct |
198 ms |
61896 KB |
Output is correct |
12 |
Correct |
69 ms |
44612 KB |
Output is correct |
13 |
Correct |
72 ms |
44440 KB |
Output is correct |
14 |
Correct |
22 ms |
36404 KB |
Output is correct |
15 |
Correct |
24 ms |
36520 KB |
Output is correct |
16 |
Correct |
362 ms |
91948 KB |
Output is correct |
17 |
Correct |
24 ms |
36272 KB |
Output is correct |
18 |
Correct |
23 ms |
36244 KB |
Output is correct |
19 |
Correct |
24 ms |
36212 KB |
Output is correct |
20 |
Correct |
24 ms |
36288 KB |
Output is correct |
21 |
Correct |
22 ms |
36240 KB |
Output is correct |
22 |
Correct |
23 ms |
36300 KB |
Output is correct |
23 |
Correct |
816 ms |
113748 KB |
Output is correct |
24 |
Correct |
24 ms |
36300 KB |
Output is correct |
25 |
Correct |
26 ms |
36724 KB |
Output is correct |
26 |
Correct |
25 ms |
36700 KB |
Output is correct |
27 |
Correct |
28 ms |
36624 KB |
Output is correct |
28 |
Correct |
287 ms |
66252 KB |
Output is correct |
29 |
Correct |
441 ms |
88644 KB |
Output is correct |
30 |
Correct |
617 ms |
96316 KB |
Output is correct |
31 |
Correct |
780 ms |
115224 KB |
Output is correct |
32 |
Correct |
24 ms |
36220 KB |
Output is correct |
33 |
Correct |
24 ms |
36240 KB |
Output is correct |
34 |
Correct |
23 ms |
36312 KB |
Output is correct |
35 |
Correct |
27 ms |
36264 KB |
Output is correct |
36 |
Correct |
26 ms |
36232 KB |
Output is correct |
37 |
Correct |
26 ms |
36216 KB |
Output is correct |
38 |
Correct |
26 ms |
36300 KB |
Output is correct |
39 |
Correct |
25 ms |
36320 KB |
Output is correct |
40 |
Correct |
24 ms |
36300 KB |
Output is correct |
41 |
Correct |
24 ms |
36300 KB |
Output is correct |
42 |
Correct |
23 ms |
36300 KB |
Output is correct |
43 |
Correct |
29 ms |
36652 KB |
Output is correct |
44 |
Correct |
25 ms |
36520 KB |
Output is correct |
45 |
Correct |
349 ms |
75988 KB |
Output is correct |
46 |
Correct |
605 ms |
94772 KB |
Output is correct |
47 |
Correct |
535 ms |
97224 KB |
Output is correct |
48 |
Correct |
27 ms |
36224 KB |
Output is correct |
49 |
Correct |
23 ms |
36220 KB |
Output is correct |
50 |
Correct |
23 ms |
36232 KB |
Output is correct |
51 |
Correct |
23 ms |
36300 KB |
Output is correct |
52 |
Correct |
23 ms |
36276 KB |
Output is correct |
53 |
Correct |
24 ms |
36296 KB |
Output is correct |
54 |
Correct |
23 ms |
36260 KB |
Output is correct |
55 |
Correct |
801 ms |
110120 KB |
Output is correct |
56 |
Correct |
23 ms |
36268 KB |
Output is correct |
57 |
Correct |
28 ms |
36912 KB |
Output is correct |
58 |
Correct |
38 ms |
38708 KB |
Output is correct |
59 |
Correct |
28 ms |
37316 KB |
Output is correct |
60 |
Correct |
375 ms |
75652 KB |
Output is correct |
61 |
Correct |
521 ms |
87492 KB |
Output is correct |
62 |
Correct |
650 ms |
100340 KB |
Output is correct |
63 |
Correct |
808 ms |
117956 KB |
Output is correct |
64 |
Correct |
21 ms |
36300 KB |
Output is correct |
65 |
Correct |
24 ms |
36300 KB |
Output is correct |
66 |
Correct |
22 ms |
36288 KB |
Output is correct |
67 |
Correct |
777 ms |
144820 KB |
Output is correct |
68 |
Correct |
812 ms |
144708 KB |
Output is correct |
69 |
Correct |
765 ms |
138552 KB |
Output is correct |
70 |
Correct |
26 ms |
36816 KB |
Output is correct |
71 |
Correct |
28 ms |
37124 KB |
Output is correct |
72 |
Correct |
368 ms |
74260 KB |
Output is correct |
73 |
Correct |
586 ms |
93332 KB |
Output is correct |
74 |
Correct |
789 ms |
111288 KB |
Output is correct |
75 |
Correct |
782 ms |
116720 KB |
Output is correct |
76 |
Correct |
755 ms |
147396 KB |
Output is correct |
77 |
Correct |
27 ms |
36940 KB |
Output is correct |
78 |
Correct |
30 ms |
37556 KB |
Output is correct |
79 |
Correct |
375 ms |
76596 KB |
Output is correct |
80 |
Correct |
587 ms |
99180 KB |
Output is correct |
81 |
Correct |
811 ms |
120436 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
23 ms |
36300 KB |
Output is correct |
2 |
Correct |
23 ms |
36224 KB |
Output is correct |
3 |
Correct |
23 ms |
36208 KB |
Output is correct |
4 |
Correct |
23 ms |
36296 KB |
Output is correct |
5 |
Correct |
26 ms |
36252 KB |
Output is correct |
6 |
Correct |
21 ms |
36300 KB |
Output is correct |
7 |
Correct |
24 ms |
36228 KB |
Output is correct |
8 |
Correct |
23 ms |
36292 KB |
Output is correct |
9 |
Correct |
351 ms |
88072 KB |
Output is correct |
10 |
Correct |
49 ms |
41540 KB |
Output is correct |
11 |
Correct |
198 ms |
61896 KB |
Output is correct |
12 |
Correct |
69 ms |
44612 KB |
Output is correct |
13 |
Correct |
72 ms |
44440 KB |
Output is correct |
14 |
Correct |
22 ms |
36404 KB |
Output is correct |
15 |
Correct |
24 ms |
36520 KB |
Output is correct |
16 |
Correct |
362 ms |
91948 KB |
Output is correct |
17 |
Correct |
23 ms |
36288 KB |
Output is correct |
18 |
Correct |
23 ms |
36292 KB |
Output is correct |
19 |
Correct |
21 ms |
36292 KB |
Output is correct |
20 |
Correct |
800 ms |
126832 KB |
Output is correct |
21 |
Correct |
833 ms |
119328 KB |
Output is correct |
22 |
Correct |
859 ms |
116084 KB |
Output is correct |
23 |
Correct |
747 ms |
129200 KB |
Output is correct |
24 |
Correct |
185 ms |
53440 KB |
Output is correct |
25 |
Correct |
195 ms |
53700 KB |
Output is correct |
26 |
Correct |
188 ms |
53600 KB |
Output is correct |
27 |
Correct |
721 ms |
110136 KB |
Output is correct |
28 |
Correct |
686 ms |
110064 KB |
Output is correct |
29 |
Correct |
967 ms |
110184 KB |
Output is correct |
30 |
Correct |
931 ms |
109996 KB |
Output is correct |
31 |
Correct |
23 ms |
36300 KB |
Output is correct |
32 |
Correct |
76 ms |
41676 KB |
Output is correct |
33 |
Correct |
87 ms |
44848 KB |
Output is correct |
34 |
Correct |
775 ms |
118400 KB |
Output is correct |
35 |
Correct |
32 ms |
37232 KB |
Output is correct |
36 |
Correct |
61 ms |
40744 KB |
Output is correct |
37 |
Correct |
107 ms |
44976 KB |
Output is correct |
38 |
Correct |
302 ms |
59800 KB |
Output is correct |
39 |
Correct |
460 ms |
68504 KB |
Output is correct |
40 |
Correct |
560 ms |
77412 KB |
Output is correct |
41 |
Correct |
680 ms |
86056 KB |
Output is correct |
42 |
Correct |
823 ms |
94760 KB |
Output is correct |
43 |
Correct |
24 ms |
36244 KB |
Output is correct |
44 |
Correct |
22 ms |
36300 KB |
Output is correct |
45 |
Correct |
24 ms |
36280 KB |
Output is correct |
46 |
Correct |
23 ms |
36300 KB |
Output is correct |
47 |
Correct |
23 ms |
36240 KB |
Output is correct |
48 |
Correct |
22 ms |
36320 KB |
Output is correct |
49 |
Correct |
22 ms |
36300 KB |
Output is correct |
50 |
Correct |
23 ms |
36300 KB |
Output is correct |
51 |
Correct |
24 ms |
36272 KB |
Output is correct |
52 |
Correct |
23 ms |
36280 KB |
Output is correct |
53 |
Correct |
23 ms |
36248 KB |
Output is correct |
54 |
Correct |
25 ms |
36552 KB |
Output is correct |
55 |
Correct |
25 ms |
36644 KB |
Output is correct |
56 |
Correct |
375 ms |
78640 KB |
Output is correct |
57 |
Correct |
525 ms |
94732 KB |
Output is correct |
58 |
Correct |
523 ms |
97936 KB |
Output is correct |
59 |
Correct |
23 ms |
36300 KB |
Output is correct |
60 |
Correct |
24 ms |
36336 KB |
Output is correct |
61 |
Correct |
23 ms |
36220 KB |
Output is correct |
62 |
Correct |
740 ms |
131044 KB |
Output is correct |
63 |
Correct |
760 ms |
136596 KB |
Output is correct |
64 |
Correct |
760 ms |
142388 KB |
Output is correct |
65 |
Correct |
26 ms |
36940 KB |
Output is correct |
66 |
Correct |
27 ms |
37172 KB |
Output is correct |
67 |
Correct |
363 ms |
75344 KB |
Output is correct |
68 |
Correct |
568 ms |
98088 KB |
Output is correct |
69 |
Correct |
769 ms |
112428 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
23 ms |
36300 KB |
Output is correct |
2 |
Correct |
23 ms |
36224 KB |
Output is correct |
3 |
Correct |
23 ms |
36208 KB |
Output is correct |
4 |
Correct |
23 ms |
36296 KB |
Output is correct |
5 |
Correct |
26 ms |
36252 KB |
Output is correct |
6 |
Correct |
21 ms |
36300 KB |
Output is correct |
7 |
Correct |
24 ms |
36228 KB |
Output is correct |
8 |
Correct |
23 ms |
36292 KB |
Output is correct |
9 |
Correct |
351 ms |
88072 KB |
Output is correct |
10 |
Correct |
49 ms |
41540 KB |
Output is correct |
11 |
Correct |
198 ms |
61896 KB |
Output is correct |
12 |
Correct |
69 ms |
44612 KB |
Output is correct |
13 |
Correct |
72 ms |
44440 KB |
Output is correct |
14 |
Correct |
22 ms |
36404 KB |
Output is correct |
15 |
Correct |
24 ms |
36520 KB |
Output is correct |
16 |
Correct |
362 ms |
91948 KB |
Output is correct |
17 |
Correct |
772 ms |
147496 KB |
Output is correct |
18 |
Correct |
762 ms |
128708 KB |
Output is correct |
19 |
Correct |
881 ms |
128632 KB |
Output is correct |
20 |
Correct |
810 ms |
102832 KB |
Output is correct |
21 |
Correct |
718 ms |
105284 KB |
Output is correct |
22 |
Correct |
23 ms |
36296 KB |
Output is correct |
23 |
Correct |
124 ms |
47188 KB |
Output is correct |
24 |
Correct |
44 ms |
38560 KB |
Output is correct |
25 |
Correct |
78 ms |
43084 KB |
Output is correct |
26 |
Correct |
126 ms |
47580 KB |
Output is correct |
27 |
Correct |
396 ms |
70052 KB |
Output is correct |
28 |
Correct |
513 ms |
79376 KB |
Output is correct |
29 |
Correct |
625 ms |
87748 KB |
Output is correct |
30 |
Correct |
730 ms |
95356 KB |
Output is correct |
31 |
Correct |
841 ms |
105152 KB |
Output is correct |
32 |
Correct |
758 ms |
120388 KB |
Output is correct |
33 |
Correct |
783 ms |
147504 KB |
Output is correct |
34 |
Correct |
27 ms |
36940 KB |
Output is correct |
35 |
Correct |
28 ms |
37344 KB |
Output is correct |
36 |
Correct |
376 ms |
73412 KB |
Output is correct |
37 |
Correct |
562 ms |
92860 KB |
Output is correct |
38 |
Correct |
799 ms |
119492 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
23 ms |
36300 KB |
Output is correct |
2 |
Correct |
23 ms |
36224 KB |
Output is correct |
3 |
Correct |
23 ms |
36208 KB |
Output is correct |
4 |
Correct |
23 ms |
36296 KB |
Output is correct |
5 |
Correct |
26 ms |
36252 KB |
Output is correct |
6 |
Correct |
21 ms |
36300 KB |
Output is correct |
7 |
Correct |
24 ms |
36228 KB |
Output is correct |
8 |
Correct |
23 ms |
36292 KB |
Output is correct |
9 |
Correct |
351 ms |
88072 KB |
Output is correct |
10 |
Correct |
49 ms |
41540 KB |
Output is correct |
11 |
Correct |
198 ms |
61896 KB |
Output is correct |
12 |
Correct |
69 ms |
44612 KB |
Output is correct |
13 |
Correct |
72 ms |
44440 KB |
Output is correct |
14 |
Correct |
22 ms |
36404 KB |
Output is correct |
15 |
Correct |
24 ms |
36520 KB |
Output is correct |
16 |
Correct |
362 ms |
91948 KB |
Output is correct |
17 |
Correct |
24 ms |
36272 KB |
Output is correct |
18 |
Correct |
23 ms |
36244 KB |
Output is correct |
19 |
Correct |
24 ms |
36212 KB |
Output is correct |
20 |
Correct |
24 ms |
36288 KB |
Output is correct |
21 |
Correct |
22 ms |
36240 KB |
Output is correct |
22 |
Correct |
23 ms |
36300 KB |
Output is correct |
23 |
Correct |
816 ms |
113748 KB |
Output is correct |
24 |
Correct |
24 ms |
36300 KB |
Output is correct |
25 |
Correct |
26 ms |
36724 KB |
Output is correct |
26 |
Correct |
25 ms |
36700 KB |
Output is correct |
27 |
Correct |
28 ms |
36624 KB |
Output is correct |
28 |
Correct |
287 ms |
66252 KB |
Output is correct |
29 |
Correct |
441 ms |
88644 KB |
Output is correct |
30 |
Correct |
617 ms |
96316 KB |
Output is correct |
31 |
Correct |
780 ms |
115224 KB |
Output is correct |
32 |
Correct |
24 ms |
36220 KB |
Output is correct |
33 |
Correct |
24 ms |
36240 KB |
Output is correct |
34 |
Correct |
23 ms |
36312 KB |
Output is correct |
35 |
Correct |
27 ms |
36264 KB |
Output is correct |
36 |
Correct |
26 ms |
36232 KB |
Output is correct |
37 |
Correct |
26 ms |
36216 KB |
Output is correct |
38 |
Correct |
26 ms |
36300 KB |
Output is correct |
39 |
Correct |
25 ms |
36320 KB |
Output is correct |
40 |
Correct |
24 ms |
36300 KB |
Output is correct |
41 |
Correct |
24 ms |
36300 KB |
Output is correct |
42 |
Correct |
23 ms |
36300 KB |
Output is correct |
43 |
Correct |
29 ms |
36652 KB |
Output is correct |
44 |
Correct |
25 ms |
36520 KB |
Output is correct |
45 |
Correct |
349 ms |
75988 KB |
Output is correct |
46 |
Correct |
605 ms |
94772 KB |
Output is correct |
47 |
Correct |
535 ms |
97224 KB |
Output is correct |
48 |
Correct |
27 ms |
36224 KB |
Output is correct |
49 |
Correct |
23 ms |
36220 KB |
Output is correct |
50 |
Correct |
23 ms |
36232 KB |
Output is correct |
51 |
Correct |
23 ms |
36300 KB |
Output is correct |
52 |
Correct |
23 ms |
36276 KB |
Output is correct |
53 |
Correct |
24 ms |
36296 KB |
Output is correct |
54 |
Correct |
23 ms |
36260 KB |
Output is correct |
55 |
Correct |
801 ms |
110120 KB |
Output is correct |
56 |
Correct |
23 ms |
36268 KB |
Output is correct |
57 |
Correct |
28 ms |
36912 KB |
Output is correct |
58 |
Correct |
38 ms |
38708 KB |
Output is correct |
59 |
Correct |
28 ms |
37316 KB |
Output is correct |
60 |
Correct |
375 ms |
75652 KB |
Output is correct |
61 |
Correct |
521 ms |
87492 KB |
Output is correct |
62 |
Correct |
650 ms |
100340 KB |
Output is correct |
63 |
Correct |
808 ms |
117956 KB |
Output is correct |
64 |
Correct |
21 ms |
36300 KB |
Output is correct |
65 |
Correct |
24 ms |
36300 KB |
Output is correct |
66 |
Correct |
22 ms |
36288 KB |
Output is correct |
67 |
Correct |
777 ms |
144820 KB |
Output is correct |
68 |
Correct |
812 ms |
144708 KB |
Output is correct |
69 |
Correct |
765 ms |
138552 KB |
Output is correct |
70 |
Correct |
26 ms |
36816 KB |
Output is correct |
71 |
Correct |
28 ms |
37124 KB |
Output is correct |
72 |
Correct |
368 ms |
74260 KB |
Output is correct |
73 |
Correct |
586 ms |
93332 KB |
Output is correct |
74 |
Correct |
789 ms |
111288 KB |
Output is correct |
75 |
Correct |
782 ms |
116720 KB |
Output is correct |
76 |
Correct |
755 ms |
147396 KB |
Output is correct |
77 |
Correct |
27 ms |
36940 KB |
Output is correct |
78 |
Correct |
30 ms |
37556 KB |
Output is correct |
79 |
Correct |
375 ms |
76596 KB |
Output is correct |
80 |
Correct |
587 ms |
99180 KB |
Output is correct |
81 |
Correct |
811 ms |
120436 KB |
Output is correct |
82 |
Correct |
23 ms |
36288 KB |
Output is correct |
83 |
Correct |
23 ms |
36292 KB |
Output is correct |
84 |
Correct |
21 ms |
36292 KB |
Output is correct |
85 |
Correct |
800 ms |
126832 KB |
Output is correct |
86 |
Correct |
833 ms |
119328 KB |
Output is correct |
87 |
Correct |
859 ms |
116084 KB |
Output is correct |
88 |
Correct |
747 ms |
129200 KB |
Output is correct |
89 |
Correct |
185 ms |
53440 KB |
Output is correct |
90 |
Correct |
195 ms |
53700 KB |
Output is correct |
91 |
Correct |
188 ms |
53600 KB |
Output is correct |
92 |
Correct |
721 ms |
110136 KB |
Output is correct |
93 |
Correct |
686 ms |
110064 KB |
Output is correct |
94 |
Correct |
967 ms |
110184 KB |
Output is correct |
95 |
Correct |
931 ms |
109996 KB |
Output is correct |
96 |
Correct |
23 ms |
36300 KB |
Output is correct |
97 |
Correct |
76 ms |
41676 KB |
Output is correct |
98 |
Correct |
87 ms |
44848 KB |
Output is correct |
99 |
Correct |
775 ms |
118400 KB |
Output is correct |
100 |
Correct |
32 ms |
37232 KB |
Output is correct |
101 |
Correct |
61 ms |
40744 KB |
Output is correct |
102 |
Correct |
107 ms |
44976 KB |
Output is correct |
103 |
Correct |
302 ms |
59800 KB |
Output is correct |
104 |
Correct |
460 ms |
68504 KB |
Output is correct |
105 |
Correct |
560 ms |
77412 KB |
Output is correct |
106 |
Correct |
680 ms |
86056 KB |
Output is correct |
107 |
Correct |
823 ms |
94760 KB |
Output is correct |
108 |
Correct |
24 ms |
36244 KB |
Output is correct |
109 |
Correct |
22 ms |
36300 KB |
Output is correct |
110 |
Correct |
24 ms |
36280 KB |
Output is correct |
111 |
Correct |
23 ms |
36300 KB |
Output is correct |
112 |
Correct |
23 ms |
36240 KB |
Output is correct |
113 |
Correct |
22 ms |
36320 KB |
Output is correct |
114 |
Correct |
22 ms |
36300 KB |
Output is correct |
115 |
Correct |
23 ms |
36300 KB |
Output is correct |
116 |
Correct |
24 ms |
36272 KB |
Output is correct |
117 |
Correct |
23 ms |
36280 KB |
Output is correct |
118 |
Correct |
23 ms |
36248 KB |
Output is correct |
119 |
Correct |
25 ms |
36552 KB |
Output is correct |
120 |
Correct |
25 ms |
36644 KB |
Output is correct |
121 |
Correct |
375 ms |
78640 KB |
Output is correct |
122 |
Correct |
525 ms |
94732 KB |
Output is correct |
123 |
Correct |
523 ms |
97936 KB |
Output is correct |
124 |
Correct |
23 ms |
36300 KB |
Output is correct |
125 |
Correct |
24 ms |
36336 KB |
Output is correct |
126 |
Correct |
23 ms |
36220 KB |
Output is correct |
127 |
Correct |
740 ms |
131044 KB |
Output is correct |
128 |
Correct |
760 ms |
136596 KB |
Output is correct |
129 |
Correct |
760 ms |
142388 KB |
Output is correct |
130 |
Correct |
26 ms |
36940 KB |
Output is correct |
131 |
Correct |
27 ms |
37172 KB |
Output is correct |
132 |
Correct |
363 ms |
75344 KB |
Output is correct |
133 |
Correct |
568 ms |
98088 KB |
Output is correct |
134 |
Correct |
769 ms |
112428 KB |
Output is correct |
135 |
Correct |
772 ms |
147496 KB |
Output is correct |
136 |
Correct |
762 ms |
128708 KB |
Output is correct |
137 |
Correct |
881 ms |
128632 KB |
Output is correct |
138 |
Correct |
810 ms |
102832 KB |
Output is correct |
139 |
Correct |
718 ms |
105284 KB |
Output is correct |
140 |
Correct |
23 ms |
36296 KB |
Output is correct |
141 |
Correct |
124 ms |
47188 KB |
Output is correct |
142 |
Correct |
44 ms |
38560 KB |
Output is correct |
143 |
Correct |
78 ms |
43084 KB |
Output is correct |
144 |
Correct |
126 ms |
47580 KB |
Output is correct |
145 |
Correct |
396 ms |
70052 KB |
Output is correct |
146 |
Correct |
513 ms |
79376 KB |
Output is correct |
147 |
Correct |
625 ms |
87748 KB |
Output is correct |
148 |
Correct |
730 ms |
95356 KB |
Output is correct |
149 |
Correct |
841 ms |
105152 KB |
Output is correct |
150 |
Correct |
758 ms |
120388 KB |
Output is correct |
151 |
Correct |
783 ms |
147504 KB |
Output is correct |
152 |
Correct |
27 ms |
36940 KB |
Output is correct |
153 |
Correct |
28 ms |
37344 KB |
Output is correct |
154 |
Correct |
376 ms |
73412 KB |
Output is correct |
155 |
Correct |
562 ms |
92860 KB |
Output is correct |
156 |
Correct |
799 ms |
119492 KB |
Output is correct |
157 |
Correct |
23 ms |
36240 KB |
Output is correct |
158 |
Correct |
23 ms |
36236 KB |
Output is correct |
159 |
Correct |
23 ms |
36300 KB |
Output is correct |
160 |
Correct |
22 ms |
36300 KB |
Output is correct |
161 |
Incorrect |
2592 ms |
91980 KB |
Solution announced impossible, but it is possible. |
162 |
Halted |
0 ms |
0 KB |
- |