#include "parks.h"
#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef pair<int, int> pi;
typedef vector<pi> vpi;
#define mp make_pair
#define f first
#define s second
#define pb push_back
#define ins insert
#define bk back()
#define lb lower_bound
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
void ckmin(int& a, int b){
a = min(a, b);
}
void ckmax(int& a, int b){
a = max(a, b);
}
const int MOD = 1e9+7;
struct DSUreg{
vi e;
void init(int n){
e = vi(n+1, -1);
}
int get(int a){
if(e[a] < 0) return a;
e[a] = get(e[a]);
return e[a];
}
bool unite(int a, int b){
a = get(a); b = get(b);
if(a == b) return 0;
if(-e[a] < -e[b]) swap(a, b);
e[a]+=e[b];
e[b] = a;
return 1;
}
};
int n;
const int mx = 200005;
set<pi> at_x[mx];
DSUreg dsu;
int getPoint(pi a){
auto it = at_x[a.f].lb(mp(a.s, 0));
if(it != at_x[a.f].end() && it->f == a.s){
return it->s;
}
return -1;
}
vpi best_dirs[2] = {vpi{mp(-1, 0), mp(1, 0), mp(0, 1), mp(0, -1)}, vpi{mp(0, 1), mp(0, -1), mp(-1, 0), mp(1, 0)}};
int construct_roads(vi x, vi y) {
n = sz(x);
dsu.init(n+5);
if(n == 1){
build({}, {}, {}, {});
return 1;
}
vi u, v, a, b;
set<pi> benches;
for(int i = 0; i < n; i++){
for(int x_ch = -1; x_ch <= 1; x_ch+=2){
for(int y_ch = -1; y_ch <= 1; y_ch+=2){
benches.ins(mp(x[i]+x_ch, y[i]+y_ch));
}
}
}
map<pi, int> fountains;
for(int i = 0; i < n; i++){
fountains[mp(x[i], y[i])] = i;
}
for(auto bench: benches){
// cout << "bench: " << bench.f << " " << bench.s << "\n";
int parity = (bench.f/2+bench.s/2) % 2;
for(auto dir: best_dirs[parity]){
pi pos1 = mp(bench.f+dir.f-dir.s, bench.s+dir.s+dir.f);
pi pos2 = mp(bench.f+dir.f+dir.s, bench.s+dir.s-dir.f);
if(fountains.count(pos1) && fountains.count(pos2)){
int ind1 = fountains[pos1];
int ind2 = fountains[pos2];
if(dsu.unite(ind1, ind2)){
u.pb(ind1);
v.pb(ind2);
a.pb(bench.f);
b.pb(bench.s);
// cout << ind1 << " " << ind2 << "\n";
}
break;
}
}
}
for(int i = 0; i < n; i++){
if(dsu.get(i) != dsu.get(0)){
return 0;
}
}
build(u, v, a, b);
return 1;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
9684 KB |
Output is correct |
2 |
Correct |
8 ms |
9668 KB |
Output is correct |
3 |
Correct |
7 ms |
9696 KB |
Output is correct |
4 |
Correct |
6 ms |
9692 KB |
Output is correct |
5 |
Correct |
7 ms |
9672 KB |
Output is correct |
6 |
Correct |
6 ms |
9676 KB |
Output is correct |
7 |
Correct |
7 ms |
9676 KB |
Output is correct |
8 |
Correct |
7 ms |
9628 KB |
Output is correct |
9 |
Correct |
418 ms |
32080 KB |
Output is correct |
10 |
Correct |
30 ms |
12144 KB |
Output is correct |
11 |
Correct |
152 ms |
21744 KB |
Output is correct |
12 |
Correct |
43 ms |
13220 KB |
Output is correct |
13 |
Correct |
117 ms |
18296 KB |
Output is correct |
14 |
Correct |
8 ms |
9804 KB |
Output is correct |
15 |
Correct |
10 ms |
10076 KB |
Output is correct |
16 |
Correct |
421 ms |
32060 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
9684 KB |
Output is correct |
2 |
Correct |
8 ms |
9668 KB |
Output is correct |
3 |
Correct |
7 ms |
9696 KB |
Output is correct |
4 |
Correct |
6 ms |
9692 KB |
Output is correct |
5 |
Correct |
7 ms |
9672 KB |
Output is correct |
6 |
Correct |
6 ms |
9676 KB |
Output is correct |
7 |
Correct |
7 ms |
9676 KB |
Output is correct |
8 |
Correct |
7 ms |
9628 KB |
Output is correct |
9 |
Correct |
418 ms |
32080 KB |
Output is correct |
10 |
Correct |
30 ms |
12144 KB |
Output is correct |
11 |
Correct |
152 ms |
21744 KB |
Output is correct |
12 |
Correct |
43 ms |
13220 KB |
Output is correct |
13 |
Correct |
117 ms |
18296 KB |
Output is correct |
14 |
Correct |
8 ms |
9804 KB |
Output is correct |
15 |
Correct |
10 ms |
10076 KB |
Output is correct |
16 |
Correct |
421 ms |
32060 KB |
Output is correct |
17 |
Correct |
7 ms |
9676 KB |
Output is correct |
18 |
Correct |
7 ms |
9676 KB |
Output is correct |
19 |
Correct |
8 ms |
9656 KB |
Output is correct |
20 |
Correct |
8 ms |
9676 KB |
Output is correct |
21 |
Correct |
7 ms |
9676 KB |
Output is correct |
22 |
Correct |
7 ms |
9676 KB |
Output is correct |
23 |
Correct |
878 ms |
49712 KB |
Output is correct |
24 |
Correct |
6 ms |
9676 KB |
Output is correct |
25 |
Correct |
9 ms |
9932 KB |
Output is correct |
26 |
Correct |
14 ms |
10188 KB |
Output is correct |
27 |
Correct |
13 ms |
10392 KB |
Output is correct |
28 |
Correct |
235 ms |
25704 KB |
Output is correct |
29 |
Correct |
444 ms |
33880 KB |
Output is correct |
30 |
Correct |
724 ms |
41740 KB |
Output is correct |
31 |
Correct |
968 ms |
49668 KB |
Output is correct |
32 |
Correct |
7 ms |
9676 KB |
Output is correct |
33 |
Correct |
7 ms |
9676 KB |
Output is correct |
34 |
Correct |
7 ms |
9676 KB |
Output is correct |
35 |
Correct |
7 ms |
9644 KB |
Output is correct |
36 |
Correct |
8 ms |
9676 KB |
Output is correct |
37 |
Correct |
7 ms |
9676 KB |
Output is correct |
38 |
Correct |
7 ms |
9676 KB |
Output is correct |
39 |
Correct |
7 ms |
9676 KB |
Output is correct |
40 |
Correct |
7 ms |
9676 KB |
Output is correct |
41 |
Correct |
7 ms |
9676 KB |
Output is correct |
42 |
Correct |
6 ms |
9676 KB |
Output is correct |
43 |
Correct |
10 ms |
10060 KB |
Output is correct |
44 |
Correct |
12 ms |
10264 KB |
Output is correct |
45 |
Correct |
405 ms |
32076 KB |
Output is correct |
46 |
Correct |
678 ms |
42112 KB |
Output is correct |
47 |
Correct |
693 ms |
42136 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
9684 KB |
Output is correct |
2 |
Correct |
8 ms |
9668 KB |
Output is correct |
3 |
Correct |
7 ms |
9696 KB |
Output is correct |
4 |
Correct |
6 ms |
9692 KB |
Output is correct |
5 |
Correct |
7 ms |
9672 KB |
Output is correct |
6 |
Correct |
6 ms |
9676 KB |
Output is correct |
7 |
Correct |
7 ms |
9676 KB |
Output is correct |
8 |
Correct |
7 ms |
9628 KB |
Output is correct |
9 |
Correct |
418 ms |
32080 KB |
Output is correct |
10 |
Correct |
30 ms |
12144 KB |
Output is correct |
11 |
Correct |
152 ms |
21744 KB |
Output is correct |
12 |
Correct |
43 ms |
13220 KB |
Output is correct |
13 |
Correct |
117 ms |
18296 KB |
Output is correct |
14 |
Correct |
8 ms |
9804 KB |
Output is correct |
15 |
Correct |
10 ms |
10076 KB |
Output is correct |
16 |
Correct |
421 ms |
32060 KB |
Output is correct |
17 |
Correct |
7 ms |
9676 KB |
Output is correct |
18 |
Correct |
7 ms |
9676 KB |
Output is correct |
19 |
Correct |
8 ms |
9656 KB |
Output is correct |
20 |
Correct |
8 ms |
9676 KB |
Output is correct |
21 |
Correct |
7 ms |
9676 KB |
Output is correct |
22 |
Correct |
7 ms |
9676 KB |
Output is correct |
23 |
Correct |
878 ms |
49712 KB |
Output is correct |
24 |
Correct |
6 ms |
9676 KB |
Output is correct |
25 |
Correct |
9 ms |
9932 KB |
Output is correct |
26 |
Correct |
14 ms |
10188 KB |
Output is correct |
27 |
Correct |
13 ms |
10392 KB |
Output is correct |
28 |
Correct |
235 ms |
25704 KB |
Output is correct |
29 |
Correct |
444 ms |
33880 KB |
Output is correct |
30 |
Correct |
724 ms |
41740 KB |
Output is correct |
31 |
Correct |
968 ms |
49668 KB |
Output is correct |
32 |
Correct |
7 ms |
9676 KB |
Output is correct |
33 |
Correct |
7 ms |
9676 KB |
Output is correct |
34 |
Correct |
7 ms |
9676 KB |
Output is correct |
35 |
Correct |
7 ms |
9644 KB |
Output is correct |
36 |
Correct |
8 ms |
9676 KB |
Output is correct |
37 |
Correct |
7 ms |
9676 KB |
Output is correct |
38 |
Correct |
7 ms |
9676 KB |
Output is correct |
39 |
Correct |
7 ms |
9676 KB |
Output is correct |
40 |
Correct |
7 ms |
9676 KB |
Output is correct |
41 |
Correct |
7 ms |
9676 KB |
Output is correct |
42 |
Correct |
6 ms |
9676 KB |
Output is correct |
43 |
Correct |
10 ms |
10060 KB |
Output is correct |
44 |
Correct |
12 ms |
10264 KB |
Output is correct |
45 |
Correct |
405 ms |
32076 KB |
Output is correct |
46 |
Correct |
678 ms |
42112 KB |
Output is correct |
47 |
Correct |
693 ms |
42136 KB |
Output is correct |
48 |
Correct |
7 ms |
9676 KB |
Output is correct |
49 |
Correct |
6 ms |
9676 KB |
Output is correct |
50 |
Correct |
6 ms |
9676 KB |
Output is correct |
51 |
Correct |
7 ms |
9676 KB |
Output is correct |
52 |
Correct |
7 ms |
9648 KB |
Output is correct |
53 |
Correct |
7 ms |
9676 KB |
Output is correct |
54 |
Correct |
7 ms |
9668 KB |
Output is correct |
55 |
Correct |
902 ms |
48200 KB |
Output is correct |
56 |
Correct |
6 ms |
9676 KB |
Output is correct |
57 |
Correct |
11 ms |
10016 KB |
Output is correct |
58 |
Correct |
19 ms |
10956 KB |
Output is correct |
59 |
Correct |
26 ms |
11424 KB |
Output is correct |
60 |
Correct |
351 ms |
29092 KB |
Output is correct |
61 |
Correct |
548 ms |
35616 KB |
Output is correct |
62 |
Correct |
713 ms |
41408 KB |
Output is correct |
63 |
Correct |
891 ms |
48188 KB |
Output is correct |
64 |
Correct |
8 ms |
9596 KB |
Output is correct |
65 |
Correct |
7 ms |
9676 KB |
Output is correct |
66 |
Correct |
7 ms |
9564 KB |
Output is correct |
67 |
Correct |
966 ms |
54472 KB |
Output is correct |
68 |
Correct |
983 ms |
54448 KB |
Output is correct |
69 |
Correct |
912 ms |
54140 KB |
Output is correct |
70 |
Correct |
17 ms |
10444 KB |
Output is correct |
71 |
Correct |
23 ms |
11232 KB |
Output is correct |
72 |
Correct |
411 ms |
31608 KB |
Output is correct |
73 |
Correct |
671 ms |
42576 KB |
Output is correct |
74 |
Correct |
1169 ms |
53720 KB |
Output is correct |
75 |
Correct |
981 ms |
50812 KB |
Output is correct |
76 |
Correct |
978 ms |
54460 KB |
Output is correct |
77 |
Correct |
19 ms |
10640 KB |
Output is correct |
78 |
Correct |
29 ms |
11416 KB |
Output is correct |
79 |
Correct |
395 ms |
30932 KB |
Output is correct |
80 |
Correct |
719 ms |
41548 KB |
Output is correct |
81 |
Correct |
974 ms |
52236 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
9684 KB |
Output is correct |
2 |
Correct |
8 ms |
9668 KB |
Output is correct |
3 |
Correct |
7 ms |
9696 KB |
Output is correct |
4 |
Correct |
6 ms |
9692 KB |
Output is correct |
5 |
Correct |
7 ms |
9672 KB |
Output is correct |
6 |
Correct |
6 ms |
9676 KB |
Output is correct |
7 |
Correct |
7 ms |
9676 KB |
Output is correct |
8 |
Correct |
7 ms |
9628 KB |
Output is correct |
9 |
Correct |
418 ms |
32080 KB |
Output is correct |
10 |
Correct |
30 ms |
12144 KB |
Output is correct |
11 |
Correct |
152 ms |
21744 KB |
Output is correct |
12 |
Correct |
43 ms |
13220 KB |
Output is correct |
13 |
Correct |
117 ms |
18296 KB |
Output is correct |
14 |
Correct |
8 ms |
9804 KB |
Output is correct |
15 |
Correct |
10 ms |
10076 KB |
Output is correct |
16 |
Correct |
421 ms |
32060 KB |
Output is correct |
17 |
Correct |
6 ms |
9572 KB |
Output is correct |
18 |
Correct |
6 ms |
9676 KB |
Output is correct |
19 |
Correct |
6 ms |
9676 KB |
Output is correct |
20 |
Correct |
910 ms |
54368 KB |
Output is correct |
21 |
Correct |
1000 ms |
54596 KB |
Output is correct |
22 |
Correct |
945 ms |
54376 KB |
Output is correct |
23 |
Correct |
834 ms |
47868 KB |
Output is correct |
24 |
Correct |
1059 ms |
63596 KB |
Output is correct |
25 |
Correct |
905 ms |
48224 KB |
Output is correct |
26 |
Correct |
882 ms |
48320 KB |
Output is correct |
27 |
Correct |
961 ms |
54448 KB |
Output is correct |
28 |
Correct |
910 ms |
54364 KB |
Output is correct |
29 |
Correct |
1115 ms |
54536 KB |
Output is correct |
30 |
Correct |
1086 ms |
54476 KB |
Output is correct |
31 |
Correct |
7 ms |
9660 KB |
Output is correct |
32 |
Correct |
56 ms |
13072 KB |
Output is correct |
33 |
Correct |
385 ms |
32056 KB |
Output is correct |
34 |
Correct |
921 ms |
54356 KB |
Output is correct |
35 |
Correct |
28 ms |
11584 KB |
Output is correct |
36 |
Correct |
177 ms |
18628 KB |
Output is correct |
37 |
Correct |
361 ms |
27480 KB |
Output is correct |
38 |
Correct |
324 ms |
26784 KB |
Output is correct |
39 |
Correct |
505 ms |
32628 KB |
Output is correct |
40 |
Correct |
576 ms |
38908 KB |
Output is correct |
41 |
Correct |
766 ms |
45172 KB |
Output is correct |
42 |
Correct |
997 ms |
51444 KB |
Output is correct |
43 |
Correct |
6 ms |
9676 KB |
Output is correct |
44 |
Correct |
7 ms |
9676 KB |
Output is correct |
45 |
Correct |
6 ms |
9688 KB |
Output is correct |
46 |
Correct |
6 ms |
9676 KB |
Output is correct |
47 |
Correct |
7 ms |
9676 KB |
Output is correct |
48 |
Correct |
7 ms |
9676 KB |
Output is correct |
49 |
Correct |
7 ms |
9676 KB |
Output is correct |
50 |
Correct |
7 ms |
9676 KB |
Output is correct |
51 |
Correct |
8 ms |
9676 KB |
Output is correct |
52 |
Correct |
8 ms |
9676 KB |
Output is correct |
53 |
Correct |
7 ms |
9680 KB |
Output is correct |
54 |
Correct |
11 ms |
10060 KB |
Output is correct |
55 |
Correct |
12 ms |
10204 KB |
Output is correct |
56 |
Correct |
387 ms |
32096 KB |
Output is correct |
57 |
Correct |
674 ms |
42136 KB |
Output is correct |
58 |
Correct |
635 ms |
42132 KB |
Output is correct |
59 |
Correct |
7 ms |
9676 KB |
Output is correct |
60 |
Correct |
8 ms |
9676 KB |
Output is correct |
61 |
Correct |
8 ms |
9580 KB |
Output is correct |
62 |
Correct |
970 ms |
54496 KB |
Output is correct |
63 |
Correct |
997 ms |
54456 KB |
Output is correct |
64 |
Correct |
1052 ms |
54196 KB |
Output is correct |
65 |
Correct |
14 ms |
10444 KB |
Output is correct |
66 |
Correct |
28 ms |
11204 KB |
Output is correct |
67 |
Correct |
464 ms |
31548 KB |
Output is correct |
68 |
Correct |
669 ms |
42528 KB |
Output is correct |
69 |
Correct |
966 ms |
53516 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
9684 KB |
Output is correct |
2 |
Correct |
8 ms |
9668 KB |
Output is correct |
3 |
Correct |
7 ms |
9696 KB |
Output is correct |
4 |
Correct |
6 ms |
9692 KB |
Output is correct |
5 |
Correct |
7 ms |
9672 KB |
Output is correct |
6 |
Correct |
6 ms |
9676 KB |
Output is correct |
7 |
Correct |
7 ms |
9676 KB |
Output is correct |
8 |
Correct |
7 ms |
9628 KB |
Output is correct |
9 |
Correct |
418 ms |
32080 KB |
Output is correct |
10 |
Correct |
30 ms |
12144 KB |
Output is correct |
11 |
Correct |
152 ms |
21744 KB |
Output is correct |
12 |
Correct |
43 ms |
13220 KB |
Output is correct |
13 |
Correct |
117 ms |
18296 KB |
Output is correct |
14 |
Correct |
8 ms |
9804 KB |
Output is correct |
15 |
Correct |
10 ms |
10076 KB |
Output is correct |
16 |
Correct |
421 ms |
32060 KB |
Output is correct |
17 |
Correct |
979 ms |
54484 KB |
Output is correct |
18 |
Correct |
950 ms |
54428 KB |
Output is correct |
19 |
Correct |
893 ms |
54348 KB |
Output is correct |
20 |
Correct |
853 ms |
47460 KB |
Output is correct |
21 |
Correct |
824 ms |
47136 KB |
Output is correct |
22 |
Correct |
8 ms |
9624 KB |
Output is correct |
23 |
Correct |
98 ms |
16744 KB |
Output is correct |
24 |
Correct |
48 ms |
13296 KB |
Output is correct |
25 |
Correct |
193 ms |
21756 KB |
Output is correct |
26 |
Correct |
421 ms |
29984 KB |
Output is correct |
27 |
Correct |
349 ms |
29632 KB |
Output is correct |
28 |
Correct |
461 ms |
34640 KB |
Output is correct |
29 |
Correct |
684 ms |
39592 KB |
Output is correct |
30 |
Correct |
721 ms |
44552 KB |
Output is correct |
31 |
Correct |
891 ms |
49720 KB |
Output is correct |
32 |
Correct |
971 ms |
50684 KB |
Output is correct |
33 |
Correct |
1039 ms |
54456 KB |
Output is correct |
34 |
Correct |
16 ms |
10572 KB |
Output is correct |
35 |
Correct |
26 ms |
11456 KB |
Output is correct |
36 |
Correct |
365 ms |
31188 KB |
Output is correct |
37 |
Correct |
711 ms |
41728 KB |
Output is correct |
38 |
Correct |
1024 ms |
52244 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
9684 KB |
Output is correct |
2 |
Correct |
8 ms |
9668 KB |
Output is correct |
3 |
Correct |
7 ms |
9696 KB |
Output is correct |
4 |
Correct |
6 ms |
9692 KB |
Output is correct |
5 |
Correct |
7 ms |
9672 KB |
Output is correct |
6 |
Correct |
6 ms |
9676 KB |
Output is correct |
7 |
Correct |
7 ms |
9676 KB |
Output is correct |
8 |
Correct |
7 ms |
9628 KB |
Output is correct |
9 |
Correct |
418 ms |
32080 KB |
Output is correct |
10 |
Correct |
30 ms |
12144 KB |
Output is correct |
11 |
Correct |
152 ms |
21744 KB |
Output is correct |
12 |
Correct |
43 ms |
13220 KB |
Output is correct |
13 |
Correct |
117 ms |
18296 KB |
Output is correct |
14 |
Correct |
8 ms |
9804 KB |
Output is correct |
15 |
Correct |
10 ms |
10076 KB |
Output is correct |
16 |
Correct |
421 ms |
32060 KB |
Output is correct |
17 |
Correct |
7 ms |
9676 KB |
Output is correct |
18 |
Correct |
7 ms |
9676 KB |
Output is correct |
19 |
Correct |
8 ms |
9656 KB |
Output is correct |
20 |
Correct |
8 ms |
9676 KB |
Output is correct |
21 |
Correct |
7 ms |
9676 KB |
Output is correct |
22 |
Correct |
7 ms |
9676 KB |
Output is correct |
23 |
Correct |
878 ms |
49712 KB |
Output is correct |
24 |
Correct |
6 ms |
9676 KB |
Output is correct |
25 |
Correct |
9 ms |
9932 KB |
Output is correct |
26 |
Correct |
14 ms |
10188 KB |
Output is correct |
27 |
Correct |
13 ms |
10392 KB |
Output is correct |
28 |
Correct |
235 ms |
25704 KB |
Output is correct |
29 |
Correct |
444 ms |
33880 KB |
Output is correct |
30 |
Correct |
724 ms |
41740 KB |
Output is correct |
31 |
Correct |
968 ms |
49668 KB |
Output is correct |
32 |
Correct |
7 ms |
9676 KB |
Output is correct |
33 |
Correct |
7 ms |
9676 KB |
Output is correct |
34 |
Correct |
7 ms |
9676 KB |
Output is correct |
35 |
Correct |
7 ms |
9644 KB |
Output is correct |
36 |
Correct |
8 ms |
9676 KB |
Output is correct |
37 |
Correct |
7 ms |
9676 KB |
Output is correct |
38 |
Correct |
7 ms |
9676 KB |
Output is correct |
39 |
Correct |
7 ms |
9676 KB |
Output is correct |
40 |
Correct |
7 ms |
9676 KB |
Output is correct |
41 |
Correct |
7 ms |
9676 KB |
Output is correct |
42 |
Correct |
6 ms |
9676 KB |
Output is correct |
43 |
Correct |
10 ms |
10060 KB |
Output is correct |
44 |
Correct |
12 ms |
10264 KB |
Output is correct |
45 |
Correct |
405 ms |
32076 KB |
Output is correct |
46 |
Correct |
678 ms |
42112 KB |
Output is correct |
47 |
Correct |
693 ms |
42136 KB |
Output is correct |
48 |
Correct |
7 ms |
9676 KB |
Output is correct |
49 |
Correct |
6 ms |
9676 KB |
Output is correct |
50 |
Correct |
6 ms |
9676 KB |
Output is correct |
51 |
Correct |
7 ms |
9676 KB |
Output is correct |
52 |
Correct |
7 ms |
9648 KB |
Output is correct |
53 |
Correct |
7 ms |
9676 KB |
Output is correct |
54 |
Correct |
7 ms |
9668 KB |
Output is correct |
55 |
Correct |
902 ms |
48200 KB |
Output is correct |
56 |
Correct |
6 ms |
9676 KB |
Output is correct |
57 |
Correct |
11 ms |
10016 KB |
Output is correct |
58 |
Correct |
19 ms |
10956 KB |
Output is correct |
59 |
Correct |
26 ms |
11424 KB |
Output is correct |
60 |
Correct |
351 ms |
29092 KB |
Output is correct |
61 |
Correct |
548 ms |
35616 KB |
Output is correct |
62 |
Correct |
713 ms |
41408 KB |
Output is correct |
63 |
Correct |
891 ms |
48188 KB |
Output is correct |
64 |
Correct |
8 ms |
9596 KB |
Output is correct |
65 |
Correct |
7 ms |
9676 KB |
Output is correct |
66 |
Correct |
7 ms |
9564 KB |
Output is correct |
67 |
Correct |
966 ms |
54472 KB |
Output is correct |
68 |
Correct |
983 ms |
54448 KB |
Output is correct |
69 |
Correct |
912 ms |
54140 KB |
Output is correct |
70 |
Correct |
17 ms |
10444 KB |
Output is correct |
71 |
Correct |
23 ms |
11232 KB |
Output is correct |
72 |
Correct |
411 ms |
31608 KB |
Output is correct |
73 |
Correct |
671 ms |
42576 KB |
Output is correct |
74 |
Correct |
1169 ms |
53720 KB |
Output is correct |
75 |
Correct |
981 ms |
50812 KB |
Output is correct |
76 |
Correct |
978 ms |
54460 KB |
Output is correct |
77 |
Correct |
19 ms |
10640 KB |
Output is correct |
78 |
Correct |
29 ms |
11416 KB |
Output is correct |
79 |
Correct |
395 ms |
30932 KB |
Output is correct |
80 |
Correct |
719 ms |
41548 KB |
Output is correct |
81 |
Correct |
974 ms |
52236 KB |
Output is correct |
82 |
Correct |
6 ms |
9572 KB |
Output is correct |
83 |
Correct |
6 ms |
9676 KB |
Output is correct |
84 |
Correct |
6 ms |
9676 KB |
Output is correct |
85 |
Correct |
910 ms |
54368 KB |
Output is correct |
86 |
Correct |
1000 ms |
54596 KB |
Output is correct |
87 |
Correct |
945 ms |
54376 KB |
Output is correct |
88 |
Correct |
834 ms |
47868 KB |
Output is correct |
89 |
Correct |
1059 ms |
63596 KB |
Output is correct |
90 |
Correct |
905 ms |
48224 KB |
Output is correct |
91 |
Correct |
882 ms |
48320 KB |
Output is correct |
92 |
Correct |
961 ms |
54448 KB |
Output is correct |
93 |
Correct |
910 ms |
54364 KB |
Output is correct |
94 |
Correct |
1115 ms |
54536 KB |
Output is correct |
95 |
Correct |
1086 ms |
54476 KB |
Output is correct |
96 |
Correct |
7 ms |
9660 KB |
Output is correct |
97 |
Correct |
56 ms |
13072 KB |
Output is correct |
98 |
Correct |
385 ms |
32056 KB |
Output is correct |
99 |
Correct |
921 ms |
54356 KB |
Output is correct |
100 |
Correct |
28 ms |
11584 KB |
Output is correct |
101 |
Correct |
177 ms |
18628 KB |
Output is correct |
102 |
Correct |
361 ms |
27480 KB |
Output is correct |
103 |
Correct |
324 ms |
26784 KB |
Output is correct |
104 |
Correct |
505 ms |
32628 KB |
Output is correct |
105 |
Correct |
576 ms |
38908 KB |
Output is correct |
106 |
Correct |
766 ms |
45172 KB |
Output is correct |
107 |
Correct |
997 ms |
51444 KB |
Output is correct |
108 |
Correct |
6 ms |
9676 KB |
Output is correct |
109 |
Correct |
7 ms |
9676 KB |
Output is correct |
110 |
Correct |
6 ms |
9688 KB |
Output is correct |
111 |
Correct |
6 ms |
9676 KB |
Output is correct |
112 |
Correct |
7 ms |
9676 KB |
Output is correct |
113 |
Correct |
7 ms |
9676 KB |
Output is correct |
114 |
Correct |
7 ms |
9676 KB |
Output is correct |
115 |
Correct |
7 ms |
9676 KB |
Output is correct |
116 |
Correct |
8 ms |
9676 KB |
Output is correct |
117 |
Correct |
8 ms |
9676 KB |
Output is correct |
118 |
Correct |
7 ms |
9680 KB |
Output is correct |
119 |
Correct |
11 ms |
10060 KB |
Output is correct |
120 |
Correct |
12 ms |
10204 KB |
Output is correct |
121 |
Correct |
387 ms |
32096 KB |
Output is correct |
122 |
Correct |
674 ms |
42136 KB |
Output is correct |
123 |
Correct |
635 ms |
42132 KB |
Output is correct |
124 |
Correct |
7 ms |
9676 KB |
Output is correct |
125 |
Correct |
8 ms |
9676 KB |
Output is correct |
126 |
Correct |
8 ms |
9580 KB |
Output is correct |
127 |
Correct |
970 ms |
54496 KB |
Output is correct |
128 |
Correct |
997 ms |
54456 KB |
Output is correct |
129 |
Correct |
1052 ms |
54196 KB |
Output is correct |
130 |
Correct |
14 ms |
10444 KB |
Output is correct |
131 |
Correct |
28 ms |
11204 KB |
Output is correct |
132 |
Correct |
464 ms |
31548 KB |
Output is correct |
133 |
Correct |
669 ms |
42528 KB |
Output is correct |
134 |
Correct |
966 ms |
53516 KB |
Output is correct |
135 |
Correct |
979 ms |
54484 KB |
Output is correct |
136 |
Correct |
950 ms |
54428 KB |
Output is correct |
137 |
Correct |
893 ms |
54348 KB |
Output is correct |
138 |
Correct |
853 ms |
47460 KB |
Output is correct |
139 |
Correct |
824 ms |
47136 KB |
Output is correct |
140 |
Correct |
8 ms |
9624 KB |
Output is correct |
141 |
Correct |
98 ms |
16744 KB |
Output is correct |
142 |
Correct |
48 ms |
13296 KB |
Output is correct |
143 |
Correct |
193 ms |
21756 KB |
Output is correct |
144 |
Correct |
421 ms |
29984 KB |
Output is correct |
145 |
Correct |
349 ms |
29632 KB |
Output is correct |
146 |
Correct |
461 ms |
34640 KB |
Output is correct |
147 |
Correct |
684 ms |
39592 KB |
Output is correct |
148 |
Correct |
721 ms |
44552 KB |
Output is correct |
149 |
Correct |
891 ms |
49720 KB |
Output is correct |
150 |
Correct |
971 ms |
50684 KB |
Output is correct |
151 |
Correct |
1039 ms |
54456 KB |
Output is correct |
152 |
Correct |
16 ms |
10572 KB |
Output is correct |
153 |
Correct |
26 ms |
11456 KB |
Output is correct |
154 |
Correct |
365 ms |
31188 KB |
Output is correct |
155 |
Correct |
711 ms |
41728 KB |
Output is correct |
156 |
Correct |
1024 ms |
52244 KB |
Output is correct |
157 |
Correct |
7 ms |
9688 KB |
Output is correct |
158 |
Correct |
7 ms |
9676 KB |
Output is correct |
159 |
Correct |
7 ms |
9676 KB |
Output is correct |
160 |
Correct |
7 ms |
9676 KB |
Output is correct |
161 |
Correct |
766 ms |
45120 KB |
Output is correct |
162 |
Correct |
957 ms |
54412 KB |
Output is correct |
163 |
Correct |
987 ms |
51228 KB |
Output is correct |
164 |
Correct |
881 ms |
51312 KB |
Output is correct |
165 |
Correct |
750 ms |
47276 KB |
Output is correct |
166 |
Correct |
737 ms |
45648 KB |
Output is correct |
167 |
Correct |
132 ms |
18504 KB |
Output is correct |
168 |
Correct |
64 ms |
14292 KB |
Output is correct |
169 |
Correct |
247 ms |
21708 KB |
Output is correct |
170 |
Correct |
412 ms |
32108 KB |
Output is correct |
171 |
Correct |
784 ms |
39436 KB |
Output is correct |
172 |
Correct |
295 ms |
27476 KB |
Output is correct |
173 |
Correct |
354 ms |
31092 KB |
Output is correct |
174 |
Correct |
464 ms |
34476 KB |
Output is correct |
175 |
Correct |
543 ms |
38112 KB |
Output is correct |
176 |
Correct |
661 ms |
41560 KB |
Output is correct |
177 |
Correct |
752 ms |
45296 KB |
Output is correct |