#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{}());
vector<int> pt[maxn], 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;
if(mp.count({x+2, y}) && !mark2[mp[pii(x+2, y)]]) {
conecta[t] = {id, mp[pii(x+2, y)]};
ruas[t++] = {x, y, 0};
vai(x+2, y);
}
if(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};
vai(x-2, y);
}
if(mp.count({x, y+2}) && !mark2[mp[pii(x, y+2)]]) {
conecta[t] = {id, mp[pii(x, y+2)]};
ruas[t++] = {x, y, 1};
vai(x, y+2);
}
if(mp.count({x, y-2}) && !mark2[mp[pii(x, y-2)]]) {
conecta[t] = {id, mp[pii(x, y-2)]};
ruas[t++] = {x, y-2, 1};
vai(x, y-2);
}
}
int construct_roads(vector<int> x, vector<int> y) {
n = sz(x);
for(int i = 0; i < n; i++)
mp[pii(x[i], y[i])] = i;
vai(x[0], y[0]);
if(vis != n) return 0; // 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;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
27 ms |
41804 KB |
Output is correct |
2 |
Correct |
26 ms |
41772 KB |
Output is correct |
3 |
Correct |
38 ms |
37896 KB |
Output is correct |
4 |
Correct |
27 ms |
41804 KB |
Output is correct |
5 |
Correct |
29 ms |
41824 KB |
Output is correct |
6 |
Correct |
24 ms |
37836 KB |
Output is correct |
7 |
Correct |
24 ms |
37916 KB |
Output is correct |
8 |
Correct |
24 ms |
37780 KB |
Output is correct |
9 |
Correct |
337 ms |
91184 KB |
Output is correct |
10 |
Correct |
55 ms |
46888 KB |
Output is correct |
11 |
Correct |
208 ms |
68876 KB |
Output is correct |
12 |
Correct |
68 ms |
49476 KB |
Output is correct |
13 |
Correct |
70 ms |
45592 KB |
Output is correct |
14 |
Correct |
25 ms |
37996 KB |
Output is correct |
15 |
Correct |
28 ms |
38016 KB |
Output is correct |
16 |
Correct |
339 ms |
86300 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
27 ms |
41804 KB |
Output is correct |
2 |
Correct |
26 ms |
41772 KB |
Output is correct |
3 |
Correct |
38 ms |
37896 KB |
Output is correct |
4 |
Correct |
27 ms |
41804 KB |
Output is correct |
5 |
Correct |
29 ms |
41824 KB |
Output is correct |
6 |
Correct |
24 ms |
37836 KB |
Output is correct |
7 |
Correct |
24 ms |
37916 KB |
Output is correct |
8 |
Correct |
24 ms |
37780 KB |
Output is correct |
9 |
Correct |
337 ms |
91184 KB |
Output is correct |
10 |
Correct |
55 ms |
46888 KB |
Output is correct |
11 |
Correct |
208 ms |
68876 KB |
Output is correct |
12 |
Correct |
68 ms |
49476 KB |
Output is correct |
13 |
Correct |
70 ms |
45592 KB |
Output is correct |
14 |
Correct |
25 ms |
37996 KB |
Output is correct |
15 |
Correct |
28 ms |
38016 KB |
Output is correct |
16 |
Correct |
339 ms |
86300 KB |
Output is correct |
17 |
Correct |
26 ms |
41808 KB |
Output is correct |
18 |
Correct |
31 ms |
41756 KB |
Output is correct |
19 |
Correct |
26 ms |
41804 KB |
Output is correct |
20 |
Correct |
27 ms |
41804 KB |
Output is correct |
21 |
Correct |
26 ms |
37828 KB |
Output is correct |
22 |
Correct |
26 ms |
41740 KB |
Output is correct |
23 |
Correct |
903 ms |
109764 KB |
Output is correct |
24 |
Correct |
29 ms |
41804 KB |
Output is correct |
25 |
Correct |
31 ms |
42188 KB |
Output is correct |
26 |
Correct |
29 ms |
38220 KB |
Output is correct |
27 |
Correct |
30 ms |
38296 KB |
Output is correct |
28 |
Correct |
301 ms |
69336 KB |
Output is correct |
29 |
Correct |
521 ms |
86884 KB |
Output is correct |
30 |
Correct |
675 ms |
104464 KB |
Output is correct |
31 |
Correct |
930 ms |
108676 KB |
Output is correct |
32 |
Correct |
42 ms |
41804 KB |
Output is correct |
33 |
Correct |
42 ms |
41772 KB |
Output is correct |
34 |
Correct |
24 ms |
41704 KB |
Output is correct |
35 |
Correct |
23 ms |
37892 KB |
Output is correct |
36 |
Correct |
24 ms |
37884 KB |
Output is correct |
37 |
Correct |
26 ms |
41720 KB |
Output is correct |
38 |
Correct |
29 ms |
41728 KB |
Output is correct |
39 |
Correct |
27 ms |
41752 KB |
Output is correct |
40 |
Correct |
31 ms |
41728 KB |
Output is correct |
41 |
Correct |
25 ms |
37900 KB |
Output is correct |
42 |
Correct |
26 ms |
41804 KB |
Output is correct |
43 |
Correct |
26 ms |
37968 KB |
Output is correct |
44 |
Correct |
31 ms |
38156 KB |
Output is correct |
45 |
Correct |
363 ms |
76800 KB |
Output is correct |
46 |
Correct |
525 ms |
91728 KB |
Output is correct |
47 |
Correct |
547 ms |
92400 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
27 ms |
41804 KB |
Output is correct |
2 |
Correct |
26 ms |
41772 KB |
Output is correct |
3 |
Correct |
38 ms |
37896 KB |
Output is correct |
4 |
Correct |
27 ms |
41804 KB |
Output is correct |
5 |
Correct |
29 ms |
41824 KB |
Output is correct |
6 |
Correct |
24 ms |
37836 KB |
Output is correct |
7 |
Correct |
24 ms |
37916 KB |
Output is correct |
8 |
Correct |
24 ms |
37780 KB |
Output is correct |
9 |
Correct |
337 ms |
91184 KB |
Output is correct |
10 |
Correct |
55 ms |
46888 KB |
Output is correct |
11 |
Correct |
208 ms |
68876 KB |
Output is correct |
12 |
Correct |
68 ms |
49476 KB |
Output is correct |
13 |
Correct |
70 ms |
45592 KB |
Output is correct |
14 |
Correct |
25 ms |
37996 KB |
Output is correct |
15 |
Correct |
28 ms |
38016 KB |
Output is correct |
16 |
Correct |
339 ms |
86300 KB |
Output is correct |
17 |
Correct |
26 ms |
41808 KB |
Output is correct |
18 |
Correct |
31 ms |
41756 KB |
Output is correct |
19 |
Correct |
26 ms |
41804 KB |
Output is correct |
20 |
Correct |
27 ms |
41804 KB |
Output is correct |
21 |
Correct |
26 ms |
37828 KB |
Output is correct |
22 |
Correct |
26 ms |
41740 KB |
Output is correct |
23 |
Correct |
903 ms |
109764 KB |
Output is correct |
24 |
Correct |
29 ms |
41804 KB |
Output is correct |
25 |
Correct |
31 ms |
42188 KB |
Output is correct |
26 |
Correct |
29 ms |
38220 KB |
Output is correct |
27 |
Correct |
30 ms |
38296 KB |
Output is correct |
28 |
Correct |
301 ms |
69336 KB |
Output is correct |
29 |
Correct |
521 ms |
86884 KB |
Output is correct |
30 |
Correct |
675 ms |
104464 KB |
Output is correct |
31 |
Correct |
930 ms |
108676 KB |
Output is correct |
32 |
Correct |
42 ms |
41804 KB |
Output is correct |
33 |
Correct |
42 ms |
41772 KB |
Output is correct |
34 |
Correct |
24 ms |
41704 KB |
Output is correct |
35 |
Correct |
23 ms |
37892 KB |
Output is correct |
36 |
Correct |
24 ms |
37884 KB |
Output is correct |
37 |
Correct |
26 ms |
41720 KB |
Output is correct |
38 |
Correct |
29 ms |
41728 KB |
Output is correct |
39 |
Correct |
27 ms |
41752 KB |
Output is correct |
40 |
Correct |
31 ms |
41728 KB |
Output is correct |
41 |
Correct |
25 ms |
37900 KB |
Output is correct |
42 |
Correct |
26 ms |
41804 KB |
Output is correct |
43 |
Correct |
26 ms |
37968 KB |
Output is correct |
44 |
Correct |
31 ms |
38156 KB |
Output is correct |
45 |
Correct |
363 ms |
76800 KB |
Output is correct |
46 |
Correct |
525 ms |
91728 KB |
Output is correct |
47 |
Correct |
547 ms |
92400 KB |
Output is correct |
48 |
Correct |
26 ms |
41732 KB |
Output is correct |
49 |
Correct |
26 ms |
41732 KB |
Output is correct |
50 |
Correct |
27 ms |
41704 KB |
Output is correct |
51 |
Correct |
27 ms |
41796 KB |
Output is correct |
52 |
Correct |
26 ms |
41804 KB |
Output is correct |
53 |
Correct |
26 ms |
41784 KB |
Output is correct |
54 |
Correct |
26 ms |
41804 KB |
Output is correct |
55 |
Correct |
813 ms |
110512 KB |
Output is correct |
56 |
Correct |
26 ms |
41804 KB |
Output is correct |
57 |
Correct |
30 ms |
42444 KB |
Output is correct |
58 |
Correct |
41 ms |
43948 KB |
Output is correct |
59 |
Correct |
30 ms |
38980 KB |
Output is correct |
60 |
Correct |
391 ms |
81020 KB |
Output is correct |
61 |
Correct |
519 ms |
89816 KB |
Output is correct |
62 |
Correct |
675 ms |
99012 KB |
Output is correct |
63 |
Correct |
815 ms |
114888 KB |
Output is correct |
64 |
Correct |
27 ms |
37836 KB |
Output is correct |
65 |
Correct |
26 ms |
41808 KB |
Output is correct |
66 |
Correct |
24 ms |
37864 KB |
Output is correct |
67 |
Correct |
690 ms |
124936 KB |
Output is correct |
68 |
Correct |
698 ms |
131288 KB |
Output is correct |
69 |
Correct |
691 ms |
130940 KB |
Output is correct |
70 |
Correct |
27 ms |
38212 KB |
Output is correct |
71 |
Correct |
29 ms |
38692 KB |
Output is correct |
72 |
Correct |
341 ms |
77888 KB |
Output is correct |
73 |
Correct |
538 ms |
98820 KB |
Output is correct |
74 |
Correct |
743 ms |
114332 KB |
Output is correct |
75 |
Correct |
807 ms |
125116 KB |
Output is correct |
76 |
Correct |
693 ms |
131360 KB |
Output is correct |
77 |
Correct |
28 ms |
38476 KB |
Output is correct |
78 |
Correct |
30 ms |
38856 KB |
Output is correct |
79 |
Correct |
341 ms |
76316 KB |
Output is correct |
80 |
Correct |
530 ms |
94240 KB |
Output is correct |
81 |
Correct |
748 ms |
119848 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
27 ms |
41804 KB |
Output is correct |
2 |
Correct |
26 ms |
41772 KB |
Output is correct |
3 |
Correct |
38 ms |
37896 KB |
Output is correct |
4 |
Correct |
27 ms |
41804 KB |
Output is correct |
5 |
Correct |
29 ms |
41824 KB |
Output is correct |
6 |
Correct |
24 ms |
37836 KB |
Output is correct |
7 |
Correct |
24 ms |
37916 KB |
Output is correct |
8 |
Correct |
24 ms |
37780 KB |
Output is correct |
9 |
Correct |
337 ms |
91184 KB |
Output is correct |
10 |
Correct |
55 ms |
46888 KB |
Output is correct |
11 |
Correct |
208 ms |
68876 KB |
Output is correct |
12 |
Correct |
68 ms |
49476 KB |
Output is correct |
13 |
Correct |
70 ms |
45592 KB |
Output is correct |
14 |
Correct |
25 ms |
37996 KB |
Output is correct |
15 |
Correct |
28 ms |
38016 KB |
Output is correct |
16 |
Correct |
339 ms |
86300 KB |
Output is correct |
17 |
Correct |
26 ms |
41760 KB |
Output is correct |
18 |
Correct |
26 ms |
41740 KB |
Output is correct |
19 |
Correct |
24 ms |
37904 KB |
Output is correct |
20 |
Correct |
733 ms |
122348 KB |
Output is correct |
21 |
Correct |
773 ms |
114700 KB |
Output is correct |
22 |
Correct |
778 ms |
113560 KB |
Output is correct |
23 |
Correct |
605 ms |
118604 KB |
Output is correct |
24 |
Correct |
187 ms |
55236 KB |
Output is correct |
25 |
Correct |
182 ms |
55304 KB |
Output is correct |
26 |
Correct |
194 ms |
55364 KB |
Output is correct |
27 |
Correct |
641 ms |
120440 KB |
Output is correct |
28 |
Correct |
629 ms |
120288 KB |
Output is correct |
29 |
Correct |
961 ms |
120332 KB |
Output is correct |
30 |
Correct |
946 ms |
120388 KB |
Output is correct |
31 |
Correct |
26 ms |
41796 KB |
Output is correct |
32 |
Correct |
74 ms |
47080 KB |
Output is correct |
33 |
Correct |
104 ms |
46924 KB |
Output is correct |
34 |
Correct |
748 ms |
118660 KB |
Output is correct |
35 |
Correct |
33 ms |
38928 KB |
Output is correct |
36 |
Correct |
64 ms |
42692 KB |
Output is correct |
37 |
Correct |
98 ms |
47196 KB |
Output is correct |
38 |
Correct |
291 ms |
67180 KB |
Output is correct |
39 |
Correct |
410 ms |
76496 KB |
Output is correct |
40 |
Correct |
524 ms |
86028 KB |
Output is correct |
41 |
Correct |
650 ms |
95496 KB |
Output is correct |
42 |
Correct |
771 ms |
104876 KB |
Output is correct |
43 |
Correct |
26 ms |
41700 KB |
Output is correct |
44 |
Correct |
26 ms |
41728 KB |
Output is correct |
45 |
Correct |
26 ms |
41804 KB |
Output is correct |
46 |
Correct |
24 ms |
37836 KB |
Output is correct |
47 |
Correct |
24 ms |
37780 KB |
Output is correct |
48 |
Correct |
26 ms |
41804 KB |
Output is correct |
49 |
Correct |
25 ms |
41804 KB |
Output is correct |
50 |
Correct |
26 ms |
41732 KB |
Output is correct |
51 |
Correct |
26 ms |
41756 KB |
Output is correct |
52 |
Correct |
22 ms |
37828 KB |
Output is correct |
53 |
Correct |
26 ms |
41724 KB |
Output is correct |
54 |
Correct |
25 ms |
38052 KB |
Output is correct |
55 |
Correct |
25 ms |
38176 KB |
Output is correct |
56 |
Correct |
304 ms |
76688 KB |
Output is correct |
57 |
Correct |
473 ms |
91800 KB |
Output is correct |
58 |
Correct |
466 ms |
92416 KB |
Output is correct |
59 |
Correct |
25 ms |
37964 KB |
Output is correct |
60 |
Correct |
25 ms |
41740 KB |
Output is correct |
61 |
Correct |
24 ms |
37884 KB |
Output is correct |
62 |
Correct |
685 ms |
124948 KB |
Output is correct |
63 |
Correct |
729 ms |
131392 KB |
Output is correct |
64 |
Correct |
715 ms |
131096 KB |
Output is correct |
65 |
Correct |
27 ms |
38288 KB |
Output is correct |
66 |
Correct |
29 ms |
38732 KB |
Output is correct |
67 |
Correct |
364 ms |
77828 KB |
Output is correct |
68 |
Correct |
569 ms |
98884 KB |
Output is correct |
69 |
Correct |
741 ms |
114260 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
27 ms |
41804 KB |
Output is correct |
2 |
Correct |
26 ms |
41772 KB |
Output is correct |
3 |
Correct |
38 ms |
37896 KB |
Output is correct |
4 |
Correct |
27 ms |
41804 KB |
Output is correct |
5 |
Correct |
29 ms |
41824 KB |
Output is correct |
6 |
Correct |
24 ms |
37836 KB |
Output is correct |
7 |
Correct |
24 ms |
37916 KB |
Output is correct |
8 |
Correct |
24 ms |
37780 KB |
Output is correct |
9 |
Correct |
337 ms |
91184 KB |
Output is correct |
10 |
Correct |
55 ms |
46888 KB |
Output is correct |
11 |
Correct |
208 ms |
68876 KB |
Output is correct |
12 |
Correct |
68 ms |
49476 KB |
Output is correct |
13 |
Correct |
70 ms |
45592 KB |
Output is correct |
14 |
Correct |
25 ms |
37996 KB |
Output is correct |
15 |
Correct |
28 ms |
38016 KB |
Output is correct |
16 |
Correct |
339 ms |
86300 KB |
Output is correct |
17 |
Correct |
737 ms |
137140 KB |
Output is correct |
18 |
Correct |
707 ms |
131224 KB |
Output is correct |
19 |
Correct |
766 ms |
117116 KB |
Output is correct |
20 |
Correct |
894 ms |
117800 KB |
Output is correct |
21 |
Correct |
762 ms |
114756 KB |
Output is correct |
22 |
Correct |
26 ms |
41804 KB |
Output is correct |
23 |
Correct |
142 ms |
53200 KB |
Output is correct |
24 |
Correct |
44 ms |
40260 KB |
Output is correct |
25 |
Correct |
80 ms |
45124 KB |
Output is correct |
26 |
Correct |
120 ms |
49516 KB |
Output is correct |
27 |
Correct |
405 ms |
78324 KB |
Output is correct |
28 |
Correct |
509 ms |
87488 KB |
Output is correct |
29 |
Correct |
622 ms |
96928 KB |
Output is correct |
30 |
Correct |
739 ms |
105668 KB |
Output is correct |
31 |
Correct |
882 ms |
114768 KB |
Output is correct |
32 |
Correct |
773 ms |
125328 KB |
Output is correct |
33 |
Correct |
733 ms |
131340 KB |
Output is correct |
34 |
Correct |
28 ms |
38468 KB |
Output is correct |
35 |
Correct |
30 ms |
38716 KB |
Output is correct |
36 |
Correct |
342 ms |
76408 KB |
Output is correct |
37 |
Correct |
531 ms |
94216 KB |
Output is correct |
38 |
Correct |
756 ms |
119776 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
27 ms |
41804 KB |
Output is correct |
2 |
Correct |
26 ms |
41772 KB |
Output is correct |
3 |
Correct |
38 ms |
37896 KB |
Output is correct |
4 |
Correct |
27 ms |
41804 KB |
Output is correct |
5 |
Correct |
29 ms |
41824 KB |
Output is correct |
6 |
Correct |
24 ms |
37836 KB |
Output is correct |
7 |
Correct |
24 ms |
37916 KB |
Output is correct |
8 |
Correct |
24 ms |
37780 KB |
Output is correct |
9 |
Correct |
337 ms |
91184 KB |
Output is correct |
10 |
Correct |
55 ms |
46888 KB |
Output is correct |
11 |
Correct |
208 ms |
68876 KB |
Output is correct |
12 |
Correct |
68 ms |
49476 KB |
Output is correct |
13 |
Correct |
70 ms |
45592 KB |
Output is correct |
14 |
Correct |
25 ms |
37996 KB |
Output is correct |
15 |
Correct |
28 ms |
38016 KB |
Output is correct |
16 |
Correct |
339 ms |
86300 KB |
Output is correct |
17 |
Correct |
26 ms |
41808 KB |
Output is correct |
18 |
Correct |
31 ms |
41756 KB |
Output is correct |
19 |
Correct |
26 ms |
41804 KB |
Output is correct |
20 |
Correct |
27 ms |
41804 KB |
Output is correct |
21 |
Correct |
26 ms |
37828 KB |
Output is correct |
22 |
Correct |
26 ms |
41740 KB |
Output is correct |
23 |
Correct |
903 ms |
109764 KB |
Output is correct |
24 |
Correct |
29 ms |
41804 KB |
Output is correct |
25 |
Correct |
31 ms |
42188 KB |
Output is correct |
26 |
Correct |
29 ms |
38220 KB |
Output is correct |
27 |
Correct |
30 ms |
38296 KB |
Output is correct |
28 |
Correct |
301 ms |
69336 KB |
Output is correct |
29 |
Correct |
521 ms |
86884 KB |
Output is correct |
30 |
Correct |
675 ms |
104464 KB |
Output is correct |
31 |
Correct |
930 ms |
108676 KB |
Output is correct |
32 |
Correct |
42 ms |
41804 KB |
Output is correct |
33 |
Correct |
42 ms |
41772 KB |
Output is correct |
34 |
Correct |
24 ms |
41704 KB |
Output is correct |
35 |
Correct |
23 ms |
37892 KB |
Output is correct |
36 |
Correct |
24 ms |
37884 KB |
Output is correct |
37 |
Correct |
26 ms |
41720 KB |
Output is correct |
38 |
Correct |
29 ms |
41728 KB |
Output is correct |
39 |
Correct |
27 ms |
41752 KB |
Output is correct |
40 |
Correct |
31 ms |
41728 KB |
Output is correct |
41 |
Correct |
25 ms |
37900 KB |
Output is correct |
42 |
Correct |
26 ms |
41804 KB |
Output is correct |
43 |
Correct |
26 ms |
37968 KB |
Output is correct |
44 |
Correct |
31 ms |
38156 KB |
Output is correct |
45 |
Correct |
363 ms |
76800 KB |
Output is correct |
46 |
Correct |
525 ms |
91728 KB |
Output is correct |
47 |
Correct |
547 ms |
92400 KB |
Output is correct |
48 |
Correct |
26 ms |
41732 KB |
Output is correct |
49 |
Correct |
26 ms |
41732 KB |
Output is correct |
50 |
Correct |
27 ms |
41704 KB |
Output is correct |
51 |
Correct |
27 ms |
41796 KB |
Output is correct |
52 |
Correct |
26 ms |
41804 KB |
Output is correct |
53 |
Correct |
26 ms |
41784 KB |
Output is correct |
54 |
Correct |
26 ms |
41804 KB |
Output is correct |
55 |
Correct |
813 ms |
110512 KB |
Output is correct |
56 |
Correct |
26 ms |
41804 KB |
Output is correct |
57 |
Correct |
30 ms |
42444 KB |
Output is correct |
58 |
Correct |
41 ms |
43948 KB |
Output is correct |
59 |
Correct |
30 ms |
38980 KB |
Output is correct |
60 |
Correct |
391 ms |
81020 KB |
Output is correct |
61 |
Correct |
519 ms |
89816 KB |
Output is correct |
62 |
Correct |
675 ms |
99012 KB |
Output is correct |
63 |
Correct |
815 ms |
114888 KB |
Output is correct |
64 |
Correct |
27 ms |
37836 KB |
Output is correct |
65 |
Correct |
26 ms |
41808 KB |
Output is correct |
66 |
Correct |
24 ms |
37864 KB |
Output is correct |
67 |
Correct |
690 ms |
124936 KB |
Output is correct |
68 |
Correct |
698 ms |
131288 KB |
Output is correct |
69 |
Correct |
691 ms |
130940 KB |
Output is correct |
70 |
Correct |
27 ms |
38212 KB |
Output is correct |
71 |
Correct |
29 ms |
38692 KB |
Output is correct |
72 |
Correct |
341 ms |
77888 KB |
Output is correct |
73 |
Correct |
538 ms |
98820 KB |
Output is correct |
74 |
Correct |
743 ms |
114332 KB |
Output is correct |
75 |
Correct |
807 ms |
125116 KB |
Output is correct |
76 |
Correct |
693 ms |
131360 KB |
Output is correct |
77 |
Correct |
28 ms |
38476 KB |
Output is correct |
78 |
Correct |
30 ms |
38856 KB |
Output is correct |
79 |
Correct |
341 ms |
76316 KB |
Output is correct |
80 |
Correct |
530 ms |
94240 KB |
Output is correct |
81 |
Correct |
748 ms |
119848 KB |
Output is correct |
82 |
Correct |
26 ms |
41760 KB |
Output is correct |
83 |
Correct |
26 ms |
41740 KB |
Output is correct |
84 |
Correct |
24 ms |
37904 KB |
Output is correct |
85 |
Correct |
733 ms |
122348 KB |
Output is correct |
86 |
Correct |
773 ms |
114700 KB |
Output is correct |
87 |
Correct |
778 ms |
113560 KB |
Output is correct |
88 |
Correct |
605 ms |
118604 KB |
Output is correct |
89 |
Correct |
187 ms |
55236 KB |
Output is correct |
90 |
Correct |
182 ms |
55304 KB |
Output is correct |
91 |
Correct |
194 ms |
55364 KB |
Output is correct |
92 |
Correct |
641 ms |
120440 KB |
Output is correct |
93 |
Correct |
629 ms |
120288 KB |
Output is correct |
94 |
Correct |
961 ms |
120332 KB |
Output is correct |
95 |
Correct |
946 ms |
120388 KB |
Output is correct |
96 |
Correct |
26 ms |
41796 KB |
Output is correct |
97 |
Correct |
74 ms |
47080 KB |
Output is correct |
98 |
Correct |
104 ms |
46924 KB |
Output is correct |
99 |
Correct |
748 ms |
118660 KB |
Output is correct |
100 |
Correct |
33 ms |
38928 KB |
Output is correct |
101 |
Correct |
64 ms |
42692 KB |
Output is correct |
102 |
Correct |
98 ms |
47196 KB |
Output is correct |
103 |
Correct |
291 ms |
67180 KB |
Output is correct |
104 |
Correct |
410 ms |
76496 KB |
Output is correct |
105 |
Correct |
524 ms |
86028 KB |
Output is correct |
106 |
Correct |
650 ms |
95496 KB |
Output is correct |
107 |
Correct |
771 ms |
104876 KB |
Output is correct |
108 |
Correct |
26 ms |
41700 KB |
Output is correct |
109 |
Correct |
26 ms |
41728 KB |
Output is correct |
110 |
Correct |
26 ms |
41804 KB |
Output is correct |
111 |
Correct |
24 ms |
37836 KB |
Output is correct |
112 |
Correct |
24 ms |
37780 KB |
Output is correct |
113 |
Correct |
26 ms |
41804 KB |
Output is correct |
114 |
Correct |
25 ms |
41804 KB |
Output is correct |
115 |
Correct |
26 ms |
41732 KB |
Output is correct |
116 |
Correct |
26 ms |
41756 KB |
Output is correct |
117 |
Correct |
22 ms |
37828 KB |
Output is correct |
118 |
Correct |
26 ms |
41724 KB |
Output is correct |
119 |
Correct |
25 ms |
38052 KB |
Output is correct |
120 |
Correct |
25 ms |
38176 KB |
Output is correct |
121 |
Correct |
304 ms |
76688 KB |
Output is correct |
122 |
Correct |
473 ms |
91800 KB |
Output is correct |
123 |
Correct |
466 ms |
92416 KB |
Output is correct |
124 |
Correct |
25 ms |
37964 KB |
Output is correct |
125 |
Correct |
25 ms |
41740 KB |
Output is correct |
126 |
Correct |
24 ms |
37884 KB |
Output is correct |
127 |
Correct |
685 ms |
124948 KB |
Output is correct |
128 |
Correct |
729 ms |
131392 KB |
Output is correct |
129 |
Correct |
715 ms |
131096 KB |
Output is correct |
130 |
Correct |
27 ms |
38288 KB |
Output is correct |
131 |
Correct |
29 ms |
38732 KB |
Output is correct |
132 |
Correct |
364 ms |
77828 KB |
Output is correct |
133 |
Correct |
569 ms |
98884 KB |
Output is correct |
134 |
Correct |
741 ms |
114260 KB |
Output is correct |
135 |
Correct |
737 ms |
137140 KB |
Output is correct |
136 |
Correct |
707 ms |
131224 KB |
Output is correct |
137 |
Correct |
766 ms |
117116 KB |
Output is correct |
138 |
Correct |
894 ms |
117800 KB |
Output is correct |
139 |
Correct |
762 ms |
114756 KB |
Output is correct |
140 |
Correct |
26 ms |
41804 KB |
Output is correct |
141 |
Correct |
142 ms |
53200 KB |
Output is correct |
142 |
Correct |
44 ms |
40260 KB |
Output is correct |
143 |
Correct |
80 ms |
45124 KB |
Output is correct |
144 |
Correct |
120 ms |
49516 KB |
Output is correct |
145 |
Correct |
405 ms |
78324 KB |
Output is correct |
146 |
Correct |
509 ms |
87488 KB |
Output is correct |
147 |
Correct |
622 ms |
96928 KB |
Output is correct |
148 |
Correct |
739 ms |
105668 KB |
Output is correct |
149 |
Correct |
882 ms |
114768 KB |
Output is correct |
150 |
Correct |
773 ms |
125328 KB |
Output is correct |
151 |
Correct |
733 ms |
131340 KB |
Output is correct |
152 |
Correct |
28 ms |
38468 KB |
Output is correct |
153 |
Correct |
30 ms |
38716 KB |
Output is correct |
154 |
Correct |
342 ms |
76408 KB |
Output is correct |
155 |
Correct |
531 ms |
94216 KB |
Output is correct |
156 |
Correct |
756 ms |
119776 KB |
Output is correct |
157 |
Correct |
27 ms |
41796 KB |
Output is correct |
158 |
Correct |
24 ms |
37836 KB |
Output is correct |
159 |
Correct |
26 ms |
41724 KB |
Output is correct |
160 |
Correct |
26 ms |
41780 KB |
Output is correct |
161 |
Correct |
1076 ms |
113756 KB |
Output is correct |
162 |
Correct |
697 ms |
108256 KB |
Output is correct |
163 |
Correct |
759 ms |
110024 KB |
Output is correct |
164 |
Correct |
752 ms |
109216 KB |
Output is correct |
165 |
Correct |
844 ms |
117416 KB |
Output is correct |
166 |
Correct |
914 ms |
121036 KB |
Output is correct |
167 |
Incorrect |
164 ms |
54484 KB |
Solution announced impossible, but it is possible. |
168 |
Halted |
0 ms |
0 KB |
- |