#include "parks.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const int MAX = 2e5+5;
#define all(x) x.begin(), x.end()
#define sz(x) (int)x.size()
#define mk make_pair
#define pb push_back
#define fr first
#define sc second
int N;
vector<int> v[MAX], X, Y;
vector<pii> range[MAX];
bool check(vector<pii> e) {
vector<int> g[N];
for(auto [A,B] : e)
g[A].pb(B), g[B].pb(A);
queue<int> fila;
vector<bool> vis(N);
fila.push(0);
vis[0] = 1;
while(!fila.empty()) {
int at = fila.front();
fila.pop();
for(int viz : g[at])
if(!vis[viz]) fila.push(viz), vis[viz] = 1;
}
for(int i = 0; i < N; i++) if(!vis[i]) return 0;
return 1;
}
bool construct(vector<pii> edges){
vector<int> U, V, A, B;
map<pii,vector<pii>> point;
// vamos anotar pontos e quantas ruas eles olham
for(auto [i1, i2] : edges){
int x1 = X[i1], y1 = Y[i1], x2 = X[i2], y2 = Y[i2];
if(x1 == x2) {
point[{x1+1, (y1+y2)/2}].pb({i1,i2});
point[{x1-1, (y1+y2)/2}].pb({i1,i2});
}
if(y1 == y2) {
point[{(x1+x2)/2, y1+1}].pb({i1,i2});
point[{(x1+x2)/2, y1-1}].pb({i1,i2});
}
}
queue<pii> fila;
for(auto [p, qtd] : point)
if(sz(qtd) == 1) fila.push(p);
while(!point.empty()) {
if(fila.empty()) fila.push((*point.begin()).fr);
auto [a,b] = fila.front();
fila.pop();
if(point.count({a,b}) == 0) continue;
auto [u,v] = point[{a,b}].back();
point[{a,b}].pop_back();
U.pb(u); V.pb(v); A.pb(a); B.pb(b);
pii p = {a,b};
if(X[u] == X[v]) p.fr = 2*X[u] - p.fr;
else p.sc = 2*Y[u] - p.sc;
for(int ind = 0; ind < sz(point[p]); ind++) {
if(point[p][ind] == mk(u,v)) {
point[p].erase(point[p].begin() + ind);
break;
}
}
if(sz(point[p]) == 1) fila.push(p);
if(point[p].empty()) point.erase(p);
point.erase({a,b});
}
if(sz(U) != sz(edges)) return 0;
build(U, V, A, B);
return 1;
}
int construct_roads(vector<int> x, vector<int> y) {
N = sz(x);
map<pii,int> ind;
X = x;
Y = y;
for(int i = 0; i < N; i++)
ind[{x[i], y[i]}] = i, v[x[i]].pb(y[i]);
vector<pii> edges;
for(int i = 2; i < MAX; i += 2) {
sort(all(v[i]));
for(int k = 0, last = -1; k < sz(v[i]); k++) {
int j = v[i][k];
// olhando o ponto (i,j)
if(last == -1) last = j;
if(k+1 == sz(v[i]) or v[i][k+1] - j != 2) range[i].pb({last, j}), last = -1;
else edges.pb({ind[{i, j}], ind[{i, j+2}]});
}
}
for(int i = 2; i < MAX; i += 2) {
for(int j = 0, k = 0; j < sz(range[i]) and k < sz(range[i-2]); ) {
if(range[i][j].sc < range[i-2][k].fr) j++;
else if(range[i-2][k].sc < range[i][j].fr) k++;
else {
int p = min(range[i][j].sc, range[i-2][k].sc);
edges.pb({ind[{i-2,p}], ind[{i,p}]});
if(range[i][j].sc < range[i-2][k].sc) j++;
else k++;
}
}
}
if(!check(edges)) return 0;
return construct(edges);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
9820 KB |
Output is correct |
2 |
Correct |
2 ms |
9820 KB |
Output is correct |
3 |
Correct |
3 ms |
9816 KB |
Output is correct |
4 |
Correct |
2 ms |
9820 KB |
Output is correct |
5 |
Correct |
2 ms |
9820 KB |
Output is correct |
6 |
Correct |
2 ms |
9820 KB |
Output is correct |
7 |
Correct |
2 ms |
9820 KB |
Output is correct |
8 |
Correct |
2 ms |
9820 KB |
Output is correct |
9 |
Correct |
237 ms |
46564 KB |
Output is correct |
10 |
Correct |
15 ms |
13400 KB |
Output is correct |
11 |
Correct |
96 ms |
29624 KB |
Output is correct |
12 |
Correct |
22 ms |
15324 KB |
Output is correct |
13 |
Correct |
28 ms |
16852 KB |
Output is correct |
14 |
Correct |
3 ms |
9820 KB |
Output is correct |
15 |
Correct |
3 ms |
9908 KB |
Output is correct |
16 |
Correct |
221 ms |
46812 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
9820 KB |
Output is correct |
2 |
Correct |
2 ms |
9820 KB |
Output is correct |
3 |
Correct |
3 ms |
9816 KB |
Output is correct |
4 |
Correct |
2 ms |
9820 KB |
Output is correct |
5 |
Correct |
2 ms |
9820 KB |
Output is correct |
6 |
Correct |
2 ms |
9820 KB |
Output is correct |
7 |
Correct |
2 ms |
9820 KB |
Output is correct |
8 |
Correct |
2 ms |
9820 KB |
Output is correct |
9 |
Correct |
237 ms |
46564 KB |
Output is correct |
10 |
Correct |
15 ms |
13400 KB |
Output is correct |
11 |
Correct |
96 ms |
29624 KB |
Output is correct |
12 |
Correct |
22 ms |
15324 KB |
Output is correct |
13 |
Correct |
28 ms |
16852 KB |
Output is correct |
14 |
Correct |
3 ms |
9820 KB |
Output is correct |
15 |
Correct |
3 ms |
9908 KB |
Output is correct |
16 |
Correct |
221 ms |
46812 KB |
Output is correct |
17 |
Correct |
2 ms |
9820 KB |
Output is correct |
18 |
Correct |
2 ms |
9812 KB |
Output is correct |
19 |
Correct |
2 ms |
9820 KB |
Output is correct |
20 |
Correct |
2 ms |
9820 KB |
Output is correct |
21 |
Correct |
2 ms |
9820 KB |
Output is correct |
22 |
Correct |
2 ms |
9820 KB |
Output is correct |
23 |
Correct |
408 ms |
75524 KB |
Output is correct |
24 |
Correct |
2 ms |
9820 KB |
Output is correct |
25 |
Correct |
3 ms |
10076 KB |
Output is correct |
26 |
Correct |
4 ms |
10076 KB |
Output is correct |
27 |
Correct |
4 ms |
10332 KB |
Output is correct |
28 |
Correct |
140 ms |
35512 KB |
Output is correct |
29 |
Correct |
215 ms |
48072 KB |
Output is correct |
30 |
Correct |
316 ms |
62600 KB |
Output is correct |
31 |
Correct |
383 ms |
75420 KB |
Output is correct |
32 |
Correct |
2 ms |
9816 KB |
Output is correct |
33 |
Correct |
2 ms |
9820 KB |
Output is correct |
34 |
Correct |
3 ms |
9820 KB |
Output is correct |
35 |
Correct |
2 ms |
9820 KB |
Output is correct |
36 |
Correct |
2 ms |
9820 KB |
Output is correct |
37 |
Correct |
2 ms |
9820 KB |
Output is correct |
38 |
Correct |
2 ms |
9820 KB |
Output is correct |
39 |
Correct |
2 ms |
9820 KB |
Output is correct |
40 |
Correct |
2 ms |
9820 KB |
Output is correct |
41 |
Correct |
2 ms |
9820 KB |
Output is correct |
42 |
Correct |
2 ms |
9820 KB |
Output is correct |
43 |
Correct |
3 ms |
10076 KB |
Output is correct |
44 |
Correct |
3 ms |
10076 KB |
Output is correct |
45 |
Correct |
200 ms |
40884 KB |
Output is correct |
46 |
Correct |
296 ms |
56520 KB |
Output is correct |
47 |
Correct |
295 ms |
55892 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
9820 KB |
Output is correct |
2 |
Correct |
2 ms |
9820 KB |
Output is correct |
3 |
Correct |
3 ms |
9816 KB |
Output is correct |
4 |
Correct |
2 ms |
9820 KB |
Output is correct |
5 |
Correct |
2 ms |
9820 KB |
Output is correct |
6 |
Correct |
2 ms |
9820 KB |
Output is correct |
7 |
Correct |
2 ms |
9820 KB |
Output is correct |
8 |
Correct |
2 ms |
9820 KB |
Output is correct |
9 |
Correct |
237 ms |
46564 KB |
Output is correct |
10 |
Correct |
15 ms |
13400 KB |
Output is correct |
11 |
Correct |
96 ms |
29624 KB |
Output is correct |
12 |
Correct |
22 ms |
15324 KB |
Output is correct |
13 |
Correct |
28 ms |
16852 KB |
Output is correct |
14 |
Correct |
3 ms |
9820 KB |
Output is correct |
15 |
Correct |
3 ms |
9908 KB |
Output is correct |
16 |
Correct |
221 ms |
46812 KB |
Output is correct |
17 |
Correct |
2 ms |
9820 KB |
Output is correct |
18 |
Correct |
2 ms |
9812 KB |
Output is correct |
19 |
Correct |
2 ms |
9820 KB |
Output is correct |
20 |
Correct |
2 ms |
9820 KB |
Output is correct |
21 |
Correct |
2 ms |
9820 KB |
Output is correct |
22 |
Correct |
2 ms |
9820 KB |
Output is correct |
23 |
Correct |
408 ms |
75524 KB |
Output is correct |
24 |
Correct |
2 ms |
9820 KB |
Output is correct |
25 |
Correct |
3 ms |
10076 KB |
Output is correct |
26 |
Correct |
4 ms |
10076 KB |
Output is correct |
27 |
Correct |
4 ms |
10332 KB |
Output is correct |
28 |
Correct |
140 ms |
35512 KB |
Output is correct |
29 |
Correct |
215 ms |
48072 KB |
Output is correct |
30 |
Correct |
316 ms |
62600 KB |
Output is correct |
31 |
Correct |
383 ms |
75420 KB |
Output is correct |
32 |
Correct |
2 ms |
9816 KB |
Output is correct |
33 |
Correct |
2 ms |
9820 KB |
Output is correct |
34 |
Correct |
3 ms |
9820 KB |
Output is correct |
35 |
Correct |
2 ms |
9820 KB |
Output is correct |
36 |
Correct |
2 ms |
9820 KB |
Output is correct |
37 |
Correct |
2 ms |
9820 KB |
Output is correct |
38 |
Correct |
2 ms |
9820 KB |
Output is correct |
39 |
Correct |
2 ms |
9820 KB |
Output is correct |
40 |
Correct |
2 ms |
9820 KB |
Output is correct |
41 |
Correct |
2 ms |
9820 KB |
Output is correct |
42 |
Correct |
2 ms |
9820 KB |
Output is correct |
43 |
Correct |
3 ms |
10076 KB |
Output is correct |
44 |
Correct |
3 ms |
10076 KB |
Output is correct |
45 |
Correct |
200 ms |
40884 KB |
Output is correct |
46 |
Correct |
296 ms |
56520 KB |
Output is correct |
47 |
Correct |
295 ms |
55892 KB |
Output is correct |
48 |
Correct |
2 ms |
9820 KB |
Output is correct |
49 |
Correct |
2 ms |
9820 KB |
Output is correct |
50 |
Correct |
2 ms |
9820 KB |
Output is correct |
51 |
Correct |
2 ms |
9820 KB |
Output is correct |
52 |
Correct |
2 ms |
9820 KB |
Output is correct |
53 |
Correct |
2 ms |
9820 KB |
Output is correct |
54 |
Correct |
2 ms |
9820 KB |
Output is correct |
55 |
Correct |
461 ms |
72152 KB |
Output is correct |
56 |
Correct |
2 ms |
9820 KB |
Output is correct |
57 |
Correct |
5 ms |
10332 KB |
Output is correct |
58 |
Correct |
10 ms |
11612 KB |
Output is correct |
59 |
Correct |
8 ms |
11356 KB |
Output is correct |
60 |
Correct |
185 ms |
40788 KB |
Output is correct |
61 |
Correct |
255 ms |
51100 KB |
Output is correct |
62 |
Correct |
324 ms |
61492 KB |
Output is correct |
63 |
Correct |
409 ms |
72128 KB |
Output is correct |
64 |
Correct |
2 ms |
9820 KB |
Output is correct |
65 |
Correct |
2 ms |
9820 KB |
Output is correct |
66 |
Correct |
2 ms |
9820 KB |
Output is correct |
67 |
Correct |
454 ms |
83848 KB |
Output is correct |
68 |
Correct |
411 ms |
83796 KB |
Output is correct |
69 |
Correct |
419 ms |
83364 KB |
Output is correct |
70 |
Correct |
4 ms |
10332 KB |
Output is correct |
71 |
Correct |
6 ms |
11100 KB |
Output is correct |
72 |
Correct |
205 ms |
40756 KB |
Output is correct |
73 |
Correct |
316 ms |
56524 KB |
Output is correct |
74 |
Correct |
459 ms |
72216 KB |
Output is correct |
75 |
Correct |
472 ms |
79708 KB |
Output is correct |
76 |
Correct |
413 ms |
83796 KB |
Output is correct |
77 |
Correct |
5 ms |
10588 KB |
Output is correct |
78 |
Correct |
10 ms |
11340 KB |
Output is correct |
79 |
Correct |
214 ms |
41952 KB |
Output is correct |
80 |
Correct |
328 ms |
59300 KB |
Output is correct |
81 |
Correct |
464 ms |
75288 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
9820 KB |
Output is correct |
2 |
Correct |
2 ms |
9820 KB |
Output is correct |
3 |
Correct |
3 ms |
9816 KB |
Output is correct |
4 |
Correct |
2 ms |
9820 KB |
Output is correct |
5 |
Correct |
2 ms |
9820 KB |
Output is correct |
6 |
Correct |
2 ms |
9820 KB |
Output is correct |
7 |
Correct |
2 ms |
9820 KB |
Output is correct |
8 |
Correct |
2 ms |
9820 KB |
Output is correct |
9 |
Correct |
237 ms |
46564 KB |
Output is correct |
10 |
Correct |
15 ms |
13400 KB |
Output is correct |
11 |
Correct |
96 ms |
29624 KB |
Output is correct |
12 |
Correct |
22 ms |
15324 KB |
Output is correct |
13 |
Correct |
28 ms |
16852 KB |
Output is correct |
14 |
Correct |
3 ms |
9820 KB |
Output is correct |
15 |
Correct |
3 ms |
9908 KB |
Output is correct |
16 |
Correct |
221 ms |
46812 KB |
Output is correct |
17 |
Correct |
2 ms |
9816 KB |
Output is correct |
18 |
Correct |
2 ms |
9820 KB |
Output is correct |
19 |
Correct |
3 ms |
9820 KB |
Output is correct |
20 |
Correct |
374 ms |
64988 KB |
Output is correct |
21 |
Correct |
355 ms |
61596 KB |
Output is correct |
22 |
Correct |
340 ms |
61536 KB |
Output is correct |
23 |
Correct |
333 ms |
76060 KB |
Output is correct |
24 |
Correct |
115 ms |
34132 KB |
Output is correct |
25 |
Correct |
163 ms |
43464 KB |
Output is correct |
26 |
Correct |
155 ms |
41828 KB |
Output is correct |
27 |
Correct |
361 ms |
87208 KB |
Output is correct |
28 |
Correct |
347 ms |
87460 KB |
Output is correct |
29 |
Correct |
369 ms |
85860 KB |
Output is correct |
30 |
Correct |
432 ms |
85856 KB |
Output is correct |
31 |
Correct |
2 ms |
9820 KB |
Output is correct |
32 |
Correct |
29 ms |
14172 KB |
Output is correct |
33 |
Correct |
61 ms |
26960 KB |
Output is correct |
34 |
Correct |
362 ms |
64868 KB |
Output is correct |
35 |
Correct |
9 ms |
11356 KB |
Output is correct |
36 |
Correct |
40 ms |
18264 KB |
Output is correct |
37 |
Correct |
80 ms |
26604 KB |
Output is correct |
38 |
Correct |
169 ms |
33356 KB |
Output is correct |
39 |
Correct |
240 ms |
42344 KB |
Output is correct |
40 |
Correct |
320 ms |
51064 KB |
Output is correct |
41 |
Correct |
414 ms |
62272 KB |
Output is correct |
42 |
Correct |
479 ms |
70060 KB |
Output is correct |
43 |
Correct |
2 ms |
9820 KB |
Output is correct |
44 |
Correct |
2 ms |
9820 KB |
Output is correct |
45 |
Correct |
2 ms |
9820 KB |
Output is correct |
46 |
Correct |
2 ms |
9820 KB |
Output is correct |
47 |
Correct |
2 ms |
9820 KB |
Output is correct |
48 |
Correct |
2 ms |
9820 KB |
Output is correct |
49 |
Correct |
2 ms |
9820 KB |
Output is correct |
50 |
Correct |
2 ms |
9820 KB |
Output is correct |
51 |
Correct |
2 ms |
9820 KB |
Output is correct |
52 |
Correct |
2 ms |
9820 KB |
Output is correct |
53 |
Correct |
2 ms |
9820 KB |
Output is correct |
54 |
Correct |
3 ms |
10076 KB |
Output is correct |
55 |
Correct |
4 ms |
10072 KB |
Output is correct |
56 |
Correct |
198 ms |
41024 KB |
Output is correct |
57 |
Correct |
303 ms |
56552 KB |
Output is correct |
58 |
Correct |
289 ms |
55984 KB |
Output is correct |
59 |
Correct |
2 ms |
9820 KB |
Output is correct |
60 |
Correct |
2 ms |
9820 KB |
Output is correct |
61 |
Correct |
2 ms |
9820 KB |
Output is correct |
62 |
Correct |
467 ms |
83844 KB |
Output is correct |
63 |
Correct |
436 ms |
83796 KB |
Output is correct |
64 |
Correct |
430 ms |
83568 KB |
Output is correct |
65 |
Correct |
4 ms |
10328 KB |
Output is correct |
66 |
Correct |
7 ms |
11096 KB |
Output is correct |
67 |
Correct |
194 ms |
40760 KB |
Output is correct |
68 |
Correct |
332 ms |
56616 KB |
Output is correct |
69 |
Correct |
458 ms |
72076 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
9820 KB |
Output is correct |
2 |
Correct |
2 ms |
9820 KB |
Output is correct |
3 |
Correct |
3 ms |
9816 KB |
Output is correct |
4 |
Correct |
2 ms |
9820 KB |
Output is correct |
5 |
Correct |
2 ms |
9820 KB |
Output is correct |
6 |
Correct |
2 ms |
9820 KB |
Output is correct |
7 |
Correct |
2 ms |
9820 KB |
Output is correct |
8 |
Correct |
2 ms |
9820 KB |
Output is correct |
9 |
Correct |
237 ms |
46564 KB |
Output is correct |
10 |
Correct |
15 ms |
13400 KB |
Output is correct |
11 |
Correct |
96 ms |
29624 KB |
Output is correct |
12 |
Correct |
22 ms |
15324 KB |
Output is correct |
13 |
Correct |
28 ms |
16852 KB |
Output is correct |
14 |
Correct |
3 ms |
9820 KB |
Output is correct |
15 |
Correct |
3 ms |
9908 KB |
Output is correct |
16 |
Correct |
221 ms |
46812 KB |
Output is correct |
17 |
Correct |
395 ms |
86880 KB |
Output is correct |
18 |
Correct |
395 ms |
87140 KB |
Output is correct |
19 |
Correct |
381 ms |
62888 KB |
Output is correct |
20 |
Correct |
395 ms |
67284 KB |
Output is correct |
21 |
Correct |
353 ms |
74504 KB |
Output is correct |
22 |
Correct |
2 ms |
9820 KB |
Output is correct |
23 |
Correct |
67 ms |
19372 KB |
Output is correct |
24 |
Correct |
17 ms |
13012 KB |
Output is correct |
25 |
Correct |
58 ms |
21700 KB |
Output is correct |
26 |
Correct |
108 ms |
30148 KB |
Output is correct |
27 |
Correct |
254 ms |
40688 KB |
Output is correct |
28 |
Correct |
320 ms |
48752 KB |
Output is correct |
29 |
Correct |
409 ms |
57156 KB |
Output is correct |
30 |
Correct |
505 ms |
65388 KB |
Output is correct |
31 |
Correct |
546 ms |
75364 KB |
Output is correct |
32 |
Correct |
472 ms |
79716 KB |
Output is correct |
33 |
Correct |
405 ms |
83800 KB |
Output is correct |
34 |
Correct |
5 ms |
10584 KB |
Output is correct |
35 |
Correct |
8 ms |
11100 KB |
Output is correct |
36 |
Correct |
217 ms |
42080 KB |
Output is correct |
37 |
Correct |
348 ms |
59300 KB |
Output is correct |
38 |
Correct |
484 ms |
75252 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
9820 KB |
Output is correct |
2 |
Correct |
2 ms |
9820 KB |
Output is correct |
3 |
Correct |
3 ms |
9816 KB |
Output is correct |
4 |
Correct |
2 ms |
9820 KB |
Output is correct |
5 |
Correct |
2 ms |
9820 KB |
Output is correct |
6 |
Correct |
2 ms |
9820 KB |
Output is correct |
7 |
Correct |
2 ms |
9820 KB |
Output is correct |
8 |
Correct |
2 ms |
9820 KB |
Output is correct |
9 |
Correct |
237 ms |
46564 KB |
Output is correct |
10 |
Correct |
15 ms |
13400 KB |
Output is correct |
11 |
Correct |
96 ms |
29624 KB |
Output is correct |
12 |
Correct |
22 ms |
15324 KB |
Output is correct |
13 |
Correct |
28 ms |
16852 KB |
Output is correct |
14 |
Correct |
3 ms |
9820 KB |
Output is correct |
15 |
Correct |
3 ms |
9908 KB |
Output is correct |
16 |
Correct |
221 ms |
46812 KB |
Output is correct |
17 |
Correct |
2 ms |
9820 KB |
Output is correct |
18 |
Correct |
2 ms |
9812 KB |
Output is correct |
19 |
Correct |
2 ms |
9820 KB |
Output is correct |
20 |
Correct |
2 ms |
9820 KB |
Output is correct |
21 |
Correct |
2 ms |
9820 KB |
Output is correct |
22 |
Correct |
2 ms |
9820 KB |
Output is correct |
23 |
Correct |
408 ms |
75524 KB |
Output is correct |
24 |
Correct |
2 ms |
9820 KB |
Output is correct |
25 |
Correct |
3 ms |
10076 KB |
Output is correct |
26 |
Correct |
4 ms |
10076 KB |
Output is correct |
27 |
Correct |
4 ms |
10332 KB |
Output is correct |
28 |
Correct |
140 ms |
35512 KB |
Output is correct |
29 |
Correct |
215 ms |
48072 KB |
Output is correct |
30 |
Correct |
316 ms |
62600 KB |
Output is correct |
31 |
Correct |
383 ms |
75420 KB |
Output is correct |
32 |
Correct |
2 ms |
9816 KB |
Output is correct |
33 |
Correct |
2 ms |
9820 KB |
Output is correct |
34 |
Correct |
3 ms |
9820 KB |
Output is correct |
35 |
Correct |
2 ms |
9820 KB |
Output is correct |
36 |
Correct |
2 ms |
9820 KB |
Output is correct |
37 |
Correct |
2 ms |
9820 KB |
Output is correct |
38 |
Correct |
2 ms |
9820 KB |
Output is correct |
39 |
Correct |
2 ms |
9820 KB |
Output is correct |
40 |
Correct |
2 ms |
9820 KB |
Output is correct |
41 |
Correct |
2 ms |
9820 KB |
Output is correct |
42 |
Correct |
2 ms |
9820 KB |
Output is correct |
43 |
Correct |
3 ms |
10076 KB |
Output is correct |
44 |
Correct |
3 ms |
10076 KB |
Output is correct |
45 |
Correct |
200 ms |
40884 KB |
Output is correct |
46 |
Correct |
296 ms |
56520 KB |
Output is correct |
47 |
Correct |
295 ms |
55892 KB |
Output is correct |
48 |
Correct |
2 ms |
9820 KB |
Output is correct |
49 |
Correct |
2 ms |
9820 KB |
Output is correct |
50 |
Correct |
2 ms |
9820 KB |
Output is correct |
51 |
Correct |
2 ms |
9820 KB |
Output is correct |
52 |
Correct |
2 ms |
9820 KB |
Output is correct |
53 |
Correct |
2 ms |
9820 KB |
Output is correct |
54 |
Correct |
2 ms |
9820 KB |
Output is correct |
55 |
Correct |
461 ms |
72152 KB |
Output is correct |
56 |
Correct |
2 ms |
9820 KB |
Output is correct |
57 |
Correct |
5 ms |
10332 KB |
Output is correct |
58 |
Correct |
10 ms |
11612 KB |
Output is correct |
59 |
Correct |
8 ms |
11356 KB |
Output is correct |
60 |
Correct |
185 ms |
40788 KB |
Output is correct |
61 |
Correct |
255 ms |
51100 KB |
Output is correct |
62 |
Correct |
324 ms |
61492 KB |
Output is correct |
63 |
Correct |
409 ms |
72128 KB |
Output is correct |
64 |
Correct |
2 ms |
9820 KB |
Output is correct |
65 |
Correct |
2 ms |
9820 KB |
Output is correct |
66 |
Correct |
2 ms |
9820 KB |
Output is correct |
67 |
Correct |
454 ms |
83848 KB |
Output is correct |
68 |
Correct |
411 ms |
83796 KB |
Output is correct |
69 |
Correct |
419 ms |
83364 KB |
Output is correct |
70 |
Correct |
4 ms |
10332 KB |
Output is correct |
71 |
Correct |
6 ms |
11100 KB |
Output is correct |
72 |
Correct |
205 ms |
40756 KB |
Output is correct |
73 |
Correct |
316 ms |
56524 KB |
Output is correct |
74 |
Correct |
459 ms |
72216 KB |
Output is correct |
75 |
Correct |
472 ms |
79708 KB |
Output is correct |
76 |
Correct |
413 ms |
83796 KB |
Output is correct |
77 |
Correct |
5 ms |
10588 KB |
Output is correct |
78 |
Correct |
10 ms |
11340 KB |
Output is correct |
79 |
Correct |
214 ms |
41952 KB |
Output is correct |
80 |
Correct |
328 ms |
59300 KB |
Output is correct |
81 |
Correct |
464 ms |
75288 KB |
Output is correct |
82 |
Correct |
2 ms |
9816 KB |
Output is correct |
83 |
Correct |
2 ms |
9820 KB |
Output is correct |
84 |
Correct |
3 ms |
9820 KB |
Output is correct |
85 |
Correct |
374 ms |
64988 KB |
Output is correct |
86 |
Correct |
355 ms |
61596 KB |
Output is correct |
87 |
Correct |
340 ms |
61536 KB |
Output is correct |
88 |
Correct |
333 ms |
76060 KB |
Output is correct |
89 |
Correct |
115 ms |
34132 KB |
Output is correct |
90 |
Correct |
163 ms |
43464 KB |
Output is correct |
91 |
Correct |
155 ms |
41828 KB |
Output is correct |
92 |
Correct |
361 ms |
87208 KB |
Output is correct |
93 |
Correct |
347 ms |
87460 KB |
Output is correct |
94 |
Correct |
369 ms |
85860 KB |
Output is correct |
95 |
Correct |
432 ms |
85856 KB |
Output is correct |
96 |
Correct |
2 ms |
9820 KB |
Output is correct |
97 |
Correct |
29 ms |
14172 KB |
Output is correct |
98 |
Correct |
61 ms |
26960 KB |
Output is correct |
99 |
Correct |
362 ms |
64868 KB |
Output is correct |
100 |
Correct |
9 ms |
11356 KB |
Output is correct |
101 |
Correct |
40 ms |
18264 KB |
Output is correct |
102 |
Correct |
80 ms |
26604 KB |
Output is correct |
103 |
Correct |
169 ms |
33356 KB |
Output is correct |
104 |
Correct |
240 ms |
42344 KB |
Output is correct |
105 |
Correct |
320 ms |
51064 KB |
Output is correct |
106 |
Correct |
414 ms |
62272 KB |
Output is correct |
107 |
Correct |
479 ms |
70060 KB |
Output is correct |
108 |
Correct |
2 ms |
9820 KB |
Output is correct |
109 |
Correct |
2 ms |
9820 KB |
Output is correct |
110 |
Correct |
2 ms |
9820 KB |
Output is correct |
111 |
Correct |
2 ms |
9820 KB |
Output is correct |
112 |
Correct |
2 ms |
9820 KB |
Output is correct |
113 |
Correct |
2 ms |
9820 KB |
Output is correct |
114 |
Correct |
2 ms |
9820 KB |
Output is correct |
115 |
Correct |
2 ms |
9820 KB |
Output is correct |
116 |
Correct |
2 ms |
9820 KB |
Output is correct |
117 |
Correct |
2 ms |
9820 KB |
Output is correct |
118 |
Correct |
2 ms |
9820 KB |
Output is correct |
119 |
Correct |
3 ms |
10076 KB |
Output is correct |
120 |
Correct |
4 ms |
10072 KB |
Output is correct |
121 |
Correct |
198 ms |
41024 KB |
Output is correct |
122 |
Correct |
303 ms |
56552 KB |
Output is correct |
123 |
Correct |
289 ms |
55984 KB |
Output is correct |
124 |
Correct |
2 ms |
9820 KB |
Output is correct |
125 |
Correct |
2 ms |
9820 KB |
Output is correct |
126 |
Correct |
2 ms |
9820 KB |
Output is correct |
127 |
Correct |
467 ms |
83844 KB |
Output is correct |
128 |
Correct |
436 ms |
83796 KB |
Output is correct |
129 |
Correct |
430 ms |
83568 KB |
Output is correct |
130 |
Correct |
4 ms |
10328 KB |
Output is correct |
131 |
Correct |
7 ms |
11096 KB |
Output is correct |
132 |
Correct |
194 ms |
40760 KB |
Output is correct |
133 |
Correct |
332 ms |
56616 KB |
Output is correct |
134 |
Correct |
458 ms |
72076 KB |
Output is correct |
135 |
Correct |
395 ms |
86880 KB |
Output is correct |
136 |
Correct |
395 ms |
87140 KB |
Output is correct |
137 |
Correct |
381 ms |
62888 KB |
Output is correct |
138 |
Correct |
395 ms |
67284 KB |
Output is correct |
139 |
Correct |
353 ms |
74504 KB |
Output is correct |
140 |
Correct |
2 ms |
9820 KB |
Output is correct |
141 |
Correct |
67 ms |
19372 KB |
Output is correct |
142 |
Correct |
17 ms |
13012 KB |
Output is correct |
143 |
Correct |
58 ms |
21700 KB |
Output is correct |
144 |
Correct |
108 ms |
30148 KB |
Output is correct |
145 |
Correct |
254 ms |
40688 KB |
Output is correct |
146 |
Correct |
320 ms |
48752 KB |
Output is correct |
147 |
Correct |
409 ms |
57156 KB |
Output is correct |
148 |
Correct |
505 ms |
65388 KB |
Output is correct |
149 |
Correct |
546 ms |
75364 KB |
Output is correct |
150 |
Correct |
472 ms |
79716 KB |
Output is correct |
151 |
Correct |
405 ms |
83800 KB |
Output is correct |
152 |
Correct |
5 ms |
10584 KB |
Output is correct |
153 |
Correct |
8 ms |
11100 KB |
Output is correct |
154 |
Correct |
217 ms |
42080 KB |
Output is correct |
155 |
Correct |
348 ms |
59300 KB |
Output is correct |
156 |
Correct |
484 ms |
75252 KB |
Output is correct |
157 |
Correct |
2 ms |
9816 KB |
Output is correct |
158 |
Correct |
2 ms |
9820 KB |
Output is correct |
159 |
Correct |
2 ms |
9820 KB |
Output is correct |
160 |
Correct |
2 ms |
9820 KB |
Output is correct |
161 |
Correct |
388 ms |
59028 KB |
Output is correct |
162 |
Correct |
374 ms |
64868 KB |
Output is correct |
163 |
Correct |
380 ms |
67492 KB |
Output is correct |
164 |
Correct |
382 ms |
67544 KB |
Output is correct |
165 |
Correct |
378 ms |
65444 KB |
Output is correct |
166 |
Correct |
379 ms |
64428 KB |
Output is correct |
167 |
Incorrect |
91 ms |
22868 KB |
Solution announced impossible, but it is possible. |
168 |
Halted |
0 ms |
0 KB |
- |