#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define N 300000
#define M 300000
#define INF 0x3f3f3f3f
int abs_(int a) { return a > 0 ? a : -a; }
int min(int a, int b) { return a < b ? a : b; }
unsigned int X = 12345;
int rand_() {
return (X *= 3) >> 1;
}
int xx[N], yy[N], xx_[N], yy_[N], n;
int tt[M], ii[M], ans[M], m;
void sort(int *ii, int l, int r) {
while (l < r) {
int i = l, j = l, k = r, i_ = ii[l + rand_() % (r - l)], tmp;
while (j < k) {
int c = xx[ii[j]] != xx[i_] ? xx[ii[j]] - xx[i_] : yy[ii[j]] - yy[i_];
if (c == 0)
j++;
else if (c < 0) {
tmp = ii[i], ii[i] = ii[j], ii[j] = tmp;
i++, j++;
} else {
k--;
tmp = ii[j], ii[j] = ii[k], ii[k] = tmp;
}
}
sort(ii, l, i);
l = k;
}
}
int ll[N], rr[N], *ej[N], eo[N], n_;
void append(int i, int j) {
int o = eo[i]++;
if (o >= 2 && (o & o - 1) == 0)
ej[i] = (int *) realloc(ej[i], o * 2 * sizeof *ej[i]);
ej[i][o] = j;
}
void delete_(int i, int j) {
int o;
for (o = eo[i]; o--; )
if (ej[i][o] == j) {
eo[i]--;
while (o < eo[i])
ej[i][o] = ej[i][o + 1], o++;
return;
}
}
int sz[N], c;
void dfs1(int p, int i) {
int o, centroid;
sz[i] = 1, centroid = 1;
for (o = eo[i]; o--; ) {
int j = ej[i][o];
if (j != p) {
dfs1(i, j);
if (sz[j] * 2 > n_)
centroid = 0;
sz[i] += sz[j];
}
}
if ((n_ - sz[i]) * 2 > n_)
centroid = 0;
if (centroid)
c = i;
}
int ii_[N], dd[N], oo[N];
void dfs2(int p, int i, int o_) {
int o, p_, i_, y;
if (p == -1)
for (i_ = ll[i]; i_ <= rr[i]; i_++)
ii_[i_] = i_ - ll[i], dd[i_] = 0;
else
for (i_ = ll[i]; i_ <= rr[i]; i_++) {
y = yy[i_];
if (y < yy[ll[p]])
p_ = ll[p];
else if (y > yy[rr[p]])
p_ = rr[p];
else
p_ = ll[p] + y - yy[ll[p]];
ii_[i_] = ii_[p_], dd[i_] = dd[p_] + 1 + abs_(y - yy[p_]);
}
for (i_ = ll[i]; i_ <= rr[i]; i_++)
oo[i_] = o_;
for (o = eo[i]; o--; ) {
int j = ej[i][o];
if (j != p)
dfs2(i, j, p == -1 ? o : o_);
}
}
void update(int *ft, int i, int n, int x) {
while (i < n) {
ft[i] = min(ft[i], x);
i |= i + 1;
}
}
int query(int *ft, int i) {
int x = INF;
while (i >= 0) {
x = min(x, ft[i]);
i &= i + 1, i--;
}
return x;
}
void cd(int *hh, int m, int n, int i) {
static int ft1[N], ft2[N], kk[N], hh_[M];
int m_, o, h, h_, i_, d, d_;
n_ = n, dfs1(-1, i), i = c;
dfs2(-1, i, -1);
memset(ft1, 0x3f, (rr[i] - ll[i] + 1) * sizeof *ft1);
memset(ft2, 0x3f, (rr[i] - ll[i] + 1) * sizeof *ft2);
for (h = 0; h < m; h++) {
h_ = hh[h], i_ = ii_[ii[h_]], d = dd[ii[h_]];
if (tt[h_] == 1)
update(ft1, i_, rr[i] - ll[i] + 1, d - i_), update(ft2, rr[i] - ll[i] - i_, rr[i] - ll[i] + 1, d + i_);
else {
if ((d_ = query(ft1, i_)) != INF)
ans[h_] = min(ans[h_], d + d_ + i_);
if ((d_ = query(ft2, rr[i] - ll[i] - i_)) != INF)
ans[h_] = min(ans[h_], d + d_ - i_);
}
}
memset(kk, 0, (eo[i] + 1) * sizeof *kk);
for (h = 0; h < m; h++) {
h_ = hh[h], o = oo[ii[h_]];
if (o != -1)
kk[o + 1]++;
}
for (o = 1; o < eo[i]; o++)
kk[o] += kk[o - 1];
m_ = 0;
for (h = 0; h < m; h++) {
h_ = hh[h], o = oo[ii[h_]];
if (o != -1)
hh_[kk[o]++] = h_, m_++;
}
memcpy(hh, hh_, (m = m_) * sizeof *hh_);
for (o = 0, h = 0; o < eo[i]; o++, h = h_) {
int j = ej[i][o];
delete_(j, i);
h_ = h;
while (h_ < m && oo[ii[hh[h_]]] == o)
h_++;
cd(hh + h, h_ - h, sz[j] < sz[i] ? sz[j] : n - sz[i], j);
}
}
int main() {
static int hh[M];
int h, i, i_, j, j_, x, y, lower, upper;
scanf("%d", &n);
for (i = 0; i < n; i++)
scanf("%d%d", &xx[i], &yy[i]);
for (i = 0; i < n; i++)
ii[i] = i;
sort(ii, 0, n);
for (i = 0; i < n; i++)
xx_[i] = xx[ii[i]], yy_[i] = yy[ii[i]];
memcpy(xx, xx_, n * sizeof *xx_), memcpy(yy, yy_, n * sizeof *yy_);
n_ = 0;
for (i = 0; i < n; i = j) {
j = i + 1;
while (j < n && xx[j] == xx[j - 1] && yy[j] == yy[j - 1] + 1)
j++;
for (h = i; h < j; h++)
ii[h] = n_;
ll[n_] = i, rr[n_] = j - 1, n_++;
}
for (i = 0; i < n_; i++)
ej[i] = (int *) malloc(2 * sizeof *ej[i]);
for (i = 0, j = 0; i < n; i++) {
x = xx[i], y = yy[i];
while (j < n && (xx[j] < x + 1 || xx[j] == x + 1 && yy[j] < y))
j++;
if (j < n && xx[j] == x + 1 && yy[j] == y) {
i_ = ii[i], j_ = ii[j];
if (ll[i_] == i || ll[j_] == j)
append(i_, j_), append(j_, i_);
}
}
scanf("%d", &m);
for (h = 0; h < m; h++) {
scanf("%d%d%d", &tt[h], &x, &y);
lower = -1, upper = n;
while (upper - lower > 1) {
i = (lower + upper) / 2;
if (xx[i] < x || xx[i] == x && yy[i] <= y)
lower = i;
else
upper = i;
}
ii[h] = lower;
}
memset(ans, 0x3f, m * sizeof *ans);
for (h = 0; h < m; h++)
hh[h] = h;
cd(hh, m, n_, 0);
for (h = 0; h < m; h++)
if (tt[h] == 2)
printf("%d\n", ans[h] == INF ? -1 : ans[h]);
return 0;
}
Compilation message
C.c: In function 'append':
C.c:48:23: warning: suggest parentheses around '-' in operand of '&' [-Wparentheses]
48 | if (o >= 2 && (o & o - 1) == 0)
| ~~^~~
C.c: In function 'main':
C.c:204:52: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
204 | while (j < n && (xx[j] < x + 1 || xx[j] == x + 1 && yy[j] < y))
| ~~~~~~~~~~~~~~~^~~~~~~~~~~~
C.c:218:32: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
218 | if (xx[i] < x || xx[i] == x && yy[i] <= y)
| ~~~~~~~~~~~^~~~~~~~~~~~~
C.c:182:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
182 | scanf("%d", &n);
| ^~~~~~~~~~~~~~~
C.c:184:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
184 | scanf("%d%d", &xx[i], &yy[i]);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C.c:212:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
212 | scanf("%d", &m);
| ^~~~~~~~~~~~~~~
C.c:214:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
214 | scanf("%d%d%d", &tt[h], &x, &y);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
22872 KB |
Output is correct |
2 |
Correct |
3 ms |
22876 KB |
Output is correct |
3 |
Correct |
3 ms |
22876 KB |
Output is correct |
4 |
Correct |
5 ms |
22876 KB |
Output is correct |
5 |
Correct |
6 ms |
22876 KB |
Output is correct |
6 |
Correct |
6 ms |
22876 KB |
Output is correct |
7 |
Correct |
7 ms |
23132 KB |
Output is correct |
8 |
Correct |
7 ms |
23132 KB |
Output is correct |
9 |
Correct |
10 ms |
23388 KB |
Output is correct |
10 |
Correct |
6 ms |
23132 KB |
Output is correct |
11 |
Correct |
7 ms |
23168 KB |
Output is correct |
12 |
Correct |
7 ms |
23132 KB |
Output is correct |
13 |
Correct |
7 ms |
23128 KB |
Output is correct |
14 |
Correct |
7 ms |
23132 KB |
Output is correct |
15 |
Correct |
6 ms |
23132 KB |
Output is correct |
16 |
Correct |
7 ms |
23224 KB |
Output is correct |
17 |
Correct |
7 ms |
23220 KB |
Output is correct |
18 |
Correct |
6 ms |
23384 KB |
Output is correct |
19 |
Correct |
6 ms |
22968 KB |
Output is correct |
20 |
Correct |
7 ms |
23012 KB |
Output is correct |
21 |
Correct |
7 ms |
23184 KB |
Output is correct |
22 |
Correct |
9 ms |
23644 KB |
Output is correct |
23 |
Correct |
7 ms |
23132 KB |
Output is correct |
24 |
Correct |
7 ms |
23388 KB |
Output is correct |
25 |
Correct |
7 ms |
23388 KB |
Output is correct |
26 |
Correct |
7 ms |
23132 KB |
Output is correct |
27 |
Correct |
5 ms |
22876 KB |
Output is correct |
28 |
Correct |
7 ms |
23236 KB |
Output is correct |
29 |
Correct |
7 ms |
23460 KB |
Output is correct |
30 |
Correct |
7 ms |
23316 KB |
Output is correct |
31 |
Correct |
7 ms |
23388 KB |
Output is correct |
32 |
Correct |
7 ms |
23132 KB |
Output is correct |
33 |
Correct |
7 ms |
23128 KB |
Output is correct |
34 |
Correct |
7 ms |
23388 KB |
Output is correct |
35 |
Correct |
6 ms |
23132 KB |
Output is correct |
36 |
Correct |
7 ms |
23476 KB |
Output is correct |
37 |
Correct |
6 ms |
23132 KB |
Output is correct |
38 |
Correct |
6 ms |
23068 KB |
Output is correct |
39 |
Correct |
6 ms |
23132 KB |
Output is correct |
40 |
Correct |
6 ms |
23132 KB |
Output is correct |
41 |
Correct |
7 ms |
23388 KB |
Output is correct |
42 |
Correct |
8 ms |
23384 KB |
Output is correct |
43 |
Correct |
7 ms |
23388 KB |
Output is correct |
44 |
Correct |
7 ms |
23072 KB |
Output is correct |
45 |
Correct |
7 ms |
23128 KB |
Output is correct |
46 |
Correct |
5 ms |
22876 KB |
Output is correct |
47 |
Correct |
7 ms |
23132 KB |
Output is correct |
48 |
Correct |
6 ms |
23132 KB |
Output is correct |
49 |
Correct |
6 ms |
22968 KB |
Output is correct |
50 |
Correct |
6 ms |
23128 KB |
Output is correct |
51 |
Correct |
6 ms |
23136 KB |
Output is correct |
52 |
Correct |
6 ms |
23132 KB |
Output is correct |
53 |
Correct |
7 ms |
23132 KB |
Output is correct |
54 |
Correct |
6 ms |
23136 KB |
Output is correct |
55 |
Correct |
7 ms |
23136 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
22872 KB |
Output is correct |
2 |
Correct |
3 ms |
22876 KB |
Output is correct |
3 |
Correct |
3 ms |
22876 KB |
Output is correct |
4 |
Correct |
5 ms |
22876 KB |
Output is correct |
5 |
Correct |
6 ms |
22876 KB |
Output is correct |
6 |
Correct |
6 ms |
22876 KB |
Output is correct |
7 |
Correct |
7 ms |
23132 KB |
Output is correct |
8 |
Correct |
7 ms |
23132 KB |
Output is correct |
9 |
Correct |
10 ms |
23388 KB |
Output is correct |
10 |
Correct |
6 ms |
23132 KB |
Output is correct |
11 |
Correct |
7 ms |
23168 KB |
Output is correct |
12 |
Correct |
7 ms |
23132 KB |
Output is correct |
13 |
Correct |
7 ms |
23128 KB |
Output is correct |
14 |
Correct |
7 ms |
23132 KB |
Output is correct |
15 |
Correct |
6 ms |
23132 KB |
Output is correct |
16 |
Correct |
7 ms |
23224 KB |
Output is correct |
17 |
Correct |
7 ms |
23220 KB |
Output is correct |
18 |
Correct |
6 ms |
23384 KB |
Output is correct |
19 |
Correct |
6 ms |
22968 KB |
Output is correct |
20 |
Correct |
7 ms |
23012 KB |
Output is correct |
21 |
Correct |
7 ms |
23184 KB |
Output is correct |
22 |
Correct |
9 ms |
23644 KB |
Output is correct |
23 |
Correct |
7 ms |
23132 KB |
Output is correct |
24 |
Correct |
7 ms |
23388 KB |
Output is correct |
25 |
Correct |
7 ms |
23388 KB |
Output is correct |
26 |
Correct |
7 ms |
23132 KB |
Output is correct |
27 |
Correct |
5 ms |
22876 KB |
Output is correct |
28 |
Correct |
7 ms |
23236 KB |
Output is correct |
29 |
Correct |
7 ms |
23460 KB |
Output is correct |
30 |
Correct |
7 ms |
23316 KB |
Output is correct |
31 |
Correct |
7 ms |
23388 KB |
Output is correct |
32 |
Correct |
7 ms |
23132 KB |
Output is correct |
33 |
Correct |
7 ms |
23128 KB |
Output is correct |
34 |
Correct |
7 ms |
23388 KB |
Output is correct |
35 |
Correct |
6 ms |
23132 KB |
Output is correct |
36 |
Correct |
7 ms |
23476 KB |
Output is correct |
37 |
Correct |
6 ms |
23132 KB |
Output is correct |
38 |
Correct |
6 ms |
23068 KB |
Output is correct |
39 |
Correct |
6 ms |
23132 KB |
Output is correct |
40 |
Correct |
6 ms |
23132 KB |
Output is correct |
41 |
Correct |
7 ms |
23388 KB |
Output is correct |
42 |
Correct |
8 ms |
23384 KB |
Output is correct |
43 |
Correct |
7 ms |
23388 KB |
Output is correct |
44 |
Correct |
7 ms |
23072 KB |
Output is correct |
45 |
Correct |
7 ms |
23128 KB |
Output is correct |
46 |
Correct |
5 ms |
22876 KB |
Output is correct |
47 |
Correct |
7 ms |
23132 KB |
Output is correct |
48 |
Correct |
6 ms |
23132 KB |
Output is correct |
49 |
Correct |
6 ms |
22968 KB |
Output is correct |
50 |
Correct |
6 ms |
23128 KB |
Output is correct |
51 |
Correct |
6 ms |
23136 KB |
Output is correct |
52 |
Correct |
6 ms |
23132 KB |
Output is correct |
53 |
Correct |
7 ms |
23132 KB |
Output is correct |
54 |
Correct |
6 ms |
23136 KB |
Output is correct |
55 |
Correct |
7 ms |
23136 KB |
Output is correct |
56 |
Correct |
49 ms |
23996 KB |
Output is correct |
57 |
Correct |
47 ms |
23896 KB |
Output is correct |
58 |
Correct |
49 ms |
23892 KB |
Output is correct |
59 |
Correct |
45 ms |
24784 KB |
Output is correct |
60 |
Correct |
46 ms |
24148 KB |
Output is correct |
61 |
Correct |
47 ms |
24660 KB |
Output is correct |
62 |
Correct |
47 ms |
24700 KB |
Output is correct |
63 |
Correct |
47 ms |
24668 KB |
Output is correct |
64 |
Correct |
46 ms |
24656 KB |
Output is correct |
65 |
Correct |
44 ms |
24144 KB |
Output is correct |
66 |
Correct |
45 ms |
24320 KB |
Output is correct |
67 |
Correct |
44 ms |
24148 KB |
Output is correct |
68 |
Correct |
49 ms |
24744 KB |
Output is correct |
69 |
Correct |
44 ms |
24256 KB |
Output is correct |
70 |
Correct |
46 ms |
24544 KB |
Output is correct |
71 |
Correct |
46 ms |
24656 KB |
Output is correct |
72 |
Correct |
47 ms |
24572 KB |
Output is correct |
73 |
Correct |
46 ms |
24148 KB |
Output is correct |
74 |
Correct |
48 ms |
25372 KB |
Output is correct |
75 |
Correct |
38 ms |
24148 KB |
Output is correct |
76 |
Correct |
36 ms |
24780 KB |
Output is correct |
77 |
Correct |
50 ms |
25104 KB |
Output is correct |
78 |
Correct |
48 ms |
25000 KB |
Output is correct |
79 |
Correct |
53 ms |
25528 KB |
Output is correct |
80 |
Correct |
49 ms |
24776 KB |
Output is correct |
81 |
Correct |
49 ms |
24856 KB |
Output is correct |
82 |
Correct |
46 ms |
24668 KB |
Output is correct |
83 |
Correct |
48 ms |
24916 KB |
Output is correct |
84 |
Correct |
55 ms |
25120 KB |
Output is correct |
85 |
Correct |
47 ms |
24420 KB |
Output is correct |
86 |
Correct |
47 ms |
24400 KB |
Output is correct |
87 |
Correct |
35 ms |
24148 KB |
Output is correct |
88 |
Correct |
45 ms |
24656 KB |
Output is correct |
89 |
Correct |
45 ms |
24812 KB |
Output is correct |
90 |
Correct |
46 ms |
24692 KB |
Output is correct |
91 |
Correct |
46 ms |
24148 KB |
Output is correct |
92 |
Correct |
44 ms |
23892 KB |
Output is correct |
93 |
Correct |
45 ms |
24252 KB |
Output is correct |
94 |
Correct |
52 ms |
24916 KB |
Output is correct |
95 |
Correct |
47 ms |
24656 KB |
Output is correct |
96 |
Correct |
46 ms |
24660 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
64 ms |
23728 KB |
Output is correct |
2 |
Correct |
120 ms |
37200 KB |
Output is correct |
3 |
Correct |
97 ms |
29512 KB |
Output is correct |
4 |
Correct |
95 ms |
29524 KB |
Output is correct |
5 |
Correct |
108 ms |
33364 KB |
Output is correct |
6 |
Correct |
110 ms |
33192 KB |
Output is correct |
7 |
Correct |
89 ms |
26708 KB |
Output is correct |
8 |
Correct |
70 ms |
26004 KB |
Output is correct |
9 |
Correct |
61 ms |
26192 KB |
Output is correct |
10 |
Correct |
97 ms |
26448 KB |
Output is correct |
11 |
Correct |
73 ms |
25748 KB |
Output is correct |
12 |
Correct |
63 ms |
25936 KB |
Output is correct |
13 |
Correct |
61 ms |
25428 KB |
Output is correct |
14 |
Correct |
62 ms |
25428 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
110 ms |
25660 KB |
Output is correct |
2 |
Correct |
116 ms |
27564 KB |
Output is correct |
3 |
Correct |
110 ms |
27488 KB |
Output is correct |
4 |
Correct |
101 ms |
27084 KB |
Output is correct |
5 |
Correct |
99 ms |
26452 KB |
Output is correct |
6 |
Correct |
97 ms |
26448 KB |
Output is correct |
7 |
Correct |
103 ms |
26960 KB |
Output is correct |
8 |
Correct |
100 ms |
27036 KB |
Output is correct |
9 |
Correct |
108 ms |
27220 KB |
Output is correct |
10 |
Correct |
122 ms |
31336 KB |
Output is correct |
11 |
Correct |
110 ms |
30896 KB |
Output is correct |
12 |
Correct |
110 ms |
32384 KB |
Output is correct |
13 |
Correct |
112 ms |
34012 KB |
Output is correct |
14 |
Correct |
75 ms |
27808 KB |
Output is correct |
15 |
Correct |
61 ms |
26396 KB |
Output is correct |
16 |
Correct |
112 ms |
32652 KB |
Output is correct |
17 |
Correct |
110 ms |
32804 KB |
Output is correct |
18 |
Correct |
108 ms |
33176 KB |
Output is correct |
19 |
Correct |
107 ms |
33108 KB |
Output is correct |
20 |
Correct |
105 ms |
28888 KB |
Output is correct |
21 |
Correct |
101 ms |
29268 KB |
Output is correct |
22 |
Correct |
123 ms |
32420 KB |
Output is correct |
23 |
Correct |
103 ms |
28960 KB |
Output is correct |
24 |
Correct |
127 ms |
36064 KB |
Output is correct |
25 |
Correct |
114 ms |
29268 KB |
Output is correct |
26 |
Correct |
97 ms |
29268 KB |
Output is correct |
27 |
Correct |
96 ms |
29524 KB |
Output is correct |
28 |
Correct |
101 ms |
29524 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
22872 KB |
Output is correct |
2 |
Correct |
3 ms |
22876 KB |
Output is correct |
3 |
Correct |
3 ms |
22876 KB |
Output is correct |
4 |
Correct |
5 ms |
22876 KB |
Output is correct |
5 |
Correct |
6 ms |
22876 KB |
Output is correct |
6 |
Correct |
6 ms |
22876 KB |
Output is correct |
7 |
Correct |
7 ms |
23132 KB |
Output is correct |
8 |
Correct |
7 ms |
23132 KB |
Output is correct |
9 |
Correct |
10 ms |
23388 KB |
Output is correct |
10 |
Correct |
6 ms |
23132 KB |
Output is correct |
11 |
Correct |
7 ms |
23168 KB |
Output is correct |
12 |
Correct |
7 ms |
23132 KB |
Output is correct |
13 |
Correct |
7 ms |
23128 KB |
Output is correct |
14 |
Correct |
7 ms |
23132 KB |
Output is correct |
15 |
Correct |
6 ms |
23132 KB |
Output is correct |
16 |
Correct |
7 ms |
23224 KB |
Output is correct |
17 |
Correct |
7 ms |
23220 KB |
Output is correct |
18 |
Correct |
6 ms |
23384 KB |
Output is correct |
19 |
Correct |
6 ms |
22968 KB |
Output is correct |
20 |
Correct |
7 ms |
23012 KB |
Output is correct |
21 |
Correct |
7 ms |
23184 KB |
Output is correct |
22 |
Correct |
9 ms |
23644 KB |
Output is correct |
23 |
Correct |
7 ms |
23132 KB |
Output is correct |
24 |
Correct |
7 ms |
23388 KB |
Output is correct |
25 |
Correct |
7 ms |
23388 KB |
Output is correct |
26 |
Correct |
7 ms |
23132 KB |
Output is correct |
27 |
Correct |
5 ms |
22876 KB |
Output is correct |
28 |
Correct |
7 ms |
23236 KB |
Output is correct |
29 |
Correct |
7 ms |
23460 KB |
Output is correct |
30 |
Correct |
7 ms |
23316 KB |
Output is correct |
31 |
Correct |
7 ms |
23388 KB |
Output is correct |
32 |
Correct |
7 ms |
23132 KB |
Output is correct |
33 |
Correct |
7 ms |
23128 KB |
Output is correct |
34 |
Correct |
7 ms |
23388 KB |
Output is correct |
35 |
Correct |
6 ms |
23132 KB |
Output is correct |
36 |
Correct |
7 ms |
23476 KB |
Output is correct |
37 |
Correct |
6 ms |
23132 KB |
Output is correct |
38 |
Correct |
6 ms |
23068 KB |
Output is correct |
39 |
Correct |
6 ms |
23132 KB |
Output is correct |
40 |
Correct |
6 ms |
23132 KB |
Output is correct |
41 |
Correct |
7 ms |
23388 KB |
Output is correct |
42 |
Correct |
8 ms |
23384 KB |
Output is correct |
43 |
Correct |
7 ms |
23388 KB |
Output is correct |
44 |
Correct |
7 ms |
23072 KB |
Output is correct |
45 |
Correct |
7 ms |
23128 KB |
Output is correct |
46 |
Correct |
5 ms |
22876 KB |
Output is correct |
47 |
Correct |
7 ms |
23132 KB |
Output is correct |
48 |
Correct |
6 ms |
23132 KB |
Output is correct |
49 |
Correct |
6 ms |
22968 KB |
Output is correct |
50 |
Correct |
6 ms |
23128 KB |
Output is correct |
51 |
Correct |
6 ms |
23136 KB |
Output is correct |
52 |
Correct |
6 ms |
23132 KB |
Output is correct |
53 |
Correct |
7 ms |
23132 KB |
Output is correct |
54 |
Correct |
6 ms |
23136 KB |
Output is correct |
55 |
Correct |
7 ms |
23136 KB |
Output is correct |
56 |
Correct |
49 ms |
23996 KB |
Output is correct |
57 |
Correct |
47 ms |
23896 KB |
Output is correct |
58 |
Correct |
49 ms |
23892 KB |
Output is correct |
59 |
Correct |
45 ms |
24784 KB |
Output is correct |
60 |
Correct |
46 ms |
24148 KB |
Output is correct |
61 |
Correct |
47 ms |
24660 KB |
Output is correct |
62 |
Correct |
47 ms |
24700 KB |
Output is correct |
63 |
Correct |
47 ms |
24668 KB |
Output is correct |
64 |
Correct |
46 ms |
24656 KB |
Output is correct |
65 |
Correct |
44 ms |
24144 KB |
Output is correct |
66 |
Correct |
45 ms |
24320 KB |
Output is correct |
67 |
Correct |
44 ms |
24148 KB |
Output is correct |
68 |
Correct |
49 ms |
24744 KB |
Output is correct |
69 |
Correct |
44 ms |
24256 KB |
Output is correct |
70 |
Correct |
46 ms |
24544 KB |
Output is correct |
71 |
Correct |
46 ms |
24656 KB |
Output is correct |
72 |
Correct |
47 ms |
24572 KB |
Output is correct |
73 |
Correct |
46 ms |
24148 KB |
Output is correct |
74 |
Correct |
48 ms |
25372 KB |
Output is correct |
75 |
Correct |
38 ms |
24148 KB |
Output is correct |
76 |
Correct |
36 ms |
24780 KB |
Output is correct |
77 |
Correct |
50 ms |
25104 KB |
Output is correct |
78 |
Correct |
48 ms |
25000 KB |
Output is correct |
79 |
Correct |
53 ms |
25528 KB |
Output is correct |
80 |
Correct |
49 ms |
24776 KB |
Output is correct |
81 |
Correct |
49 ms |
24856 KB |
Output is correct |
82 |
Correct |
46 ms |
24668 KB |
Output is correct |
83 |
Correct |
48 ms |
24916 KB |
Output is correct |
84 |
Correct |
55 ms |
25120 KB |
Output is correct |
85 |
Correct |
47 ms |
24420 KB |
Output is correct |
86 |
Correct |
47 ms |
24400 KB |
Output is correct |
87 |
Correct |
35 ms |
24148 KB |
Output is correct |
88 |
Correct |
45 ms |
24656 KB |
Output is correct |
89 |
Correct |
45 ms |
24812 KB |
Output is correct |
90 |
Correct |
46 ms |
24692 KB |
Output is correct |
91 |
Correct |
46 ms |
24148 KB |
Output is correct |
92 |
Correct |
44 ms |
23892 KB |
Output is correct |
93 |
Correct |
45 ms |
24252 KB |
Output is correct |
94 |
Correct |
52 ms |
24916 KB |
Output is correct |
95 |
Correct |
47 ms |
24656 KB |
Output is correct |
96 |
Correct |
46 ms |
24660 KB |
Output is correct |
97 |
Correct |
64 ms |
23728 KB |
Output is correct |
98 |
Correct |
120 ms |
37200 KB |
Output is correct |
99 |
Correct |
97 ms |
29512 KB |
Output is correct |
100 |
Correct |
95 ms |
29524 KB |
Output is correct |
101 |
Correct |
108 ms |
33364 KB |
Output is correct |
102 |
Correct |
110 ms |
33192 KB |
Output is correct |
103 |
Correct |
89 ms |
26708 KB |
Output is correct |
104 |
Correct |
70 ms |
26004 KB |
Output is correct |
105 |
Correct |
61 ms |
26192 KB |
Output is correct |
106 |
Correct |
97 ms |
26448 KB |
Output is correct |
107 |
Correct |
73 ms |
25748 KB |
Output is correct |
108 |
Correct |
63 ms |
25936 KB |
Output is correct |
109 |
Correct |
61 ms |
25428 KB |
Output is correct |
110 |
Correct |
62 ms |
25428 KB |
Output is correct |
111 |
Correct |
110 ms |
25660 KB |
Output is correct |
112 |
Correct |
116 ms |
27564 KB |
Output is correct |
113 |
Correct |
110 ms |
27488 KB |
Output is correct |
114 |
Correct |
101 ms |
27084 KB |
Output is correct |
115 |
Correct |
99 ms |
26452 KB |
Output is correct |
116 |
Correct |
97 ms |
26448 KB |
Output is correct |
117 |
Correct |
103 ms |
26960 KB |
Output is correct |
118 |
Correct |
100 ms |
27036 KB |
Output is correct |
119 |
Correct |
108 ms |
27220 KB |
Output is correct |
120 |
Correct |
122 ms |
31336 KB |
Output is correct |
121 |
Correct |
110 ms |
30896 KB |
Output is correct |
122 |
Correct |
110 ms |
32384 KB |
Output is correct |
123 |
Correct |
112 ms |
34012 KB |
Output is correct |
124 |
Correct |
75 ms |
27808 KB |
Output is correct |
125 |
Correct |
61 ms |
26396 KB |
Output is correct |
126 |
Correct |
112 ms |
32652 KB |
Output is correct |
127 |
Correct |
110 ms |
32804 KB |
Output is correct |
128 |
Correct |
108 ms |
33176 KB |
Output is correct |
129 |
Correct |
107 ms |
33108 KB |
Output is correct |
130 |
Correct |
105 ms |
28888 KB |
Output is correct |
131 |
Correct |
101 ms |
29268 KB |
Output is correct |
132 |
Correct |
123 ms |
32420 KB |
Output is correct |
133 |
Correct |
103 ms |
28960 KB |
Output is correct |
134 |
Correct |
127 ms |
36064 KB |
Output is correct |
135 |
Correct |
114 ms |
29268 KB |
Output is correct |
136 |
Correct |
97 ms |
29268 KB |
Output is correct |
137 |
Correct |
96 ms |
29524 KB |
Output is correct |
138 |
Correct |
101 ms |
29524 KB |
Output is correct |
139 |
Correct |
66 ms |
24748 KB |
Output is correct |
140 |
Correct |
84 ms |
25172 KB |
Output is correct |
141 |
Correct |
84 ms |
25088 KB |
Output is correct |
142 |
Correct |
91 ms |
25308 KB |
Output is correct |
143 |
Correct |
103 ms |
27420 KB |
Output is correct |
144 |
Correct |
113 ms |
27712 KB |
Output is correct |
145 |
Correct |
97 ms |
26388 KB |
Output is correct |
146 |
Correct |
91 ms |
25920 KB |
Output is correct |
147 |
Correct |
106 ms |
26852 KB |
Output is correct |
148 |
Correct |
105 ms |
27528 KB |
Output is correct |
149 |
Correct |
120 ms |
31612 KB |
Output is correct |
150 |
Correct |
104 ms |
31228 KB |
Output is correct |
151 |
Correct |
104 ms |
34640 KB |
Output is correct |
152 |
Correct |
98 ms |
28584 KB |
Output is correct |
153 |
Correct |
95 ms |
28616 KB |
Output is correct |
154 |
Correct |
59 ms |
25404 KB |
Output is correct |
155 |
Correct |
114 ms |
27156 KB |
Output is correct |
156 |
Correct |
92 ms |
26756 KB |
Output is correct |
157 |
Correct |
91 ms |
26604 KB |
Output is correct |
158 |
Correct |
86 ms |
25632 KB |
Output is correct |
159 |
Correct |
81 ms |
25424 KB |
Output is correct |
160 |
Correct |
92 ms |
26228 KB |
Output is correct |
161 |
Correct |
100 ms |
29016 KB |
Output is correct |
162 |
Correct |
94 ms |
27992 KB |
Output is correct |
163 |
Correct |
95 ms |
27988 KB |
Output is correct |