/* upsolve after reading spoiler */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define N 250000
#define M 3000000
#define K 2750
#define L 1500
#define N_ (N + K * L)
#define INF 0x3f3f3f3f
int min(int a, int b) { return a < b ? a : b; }
int dd[N_], pq[N_], iq[1 + N_], cnt;
int lt(int i, int j) { return dd[i] < dd[j]; }
int p2(int p) {
return (p *= 2) > cnt ? 0 : (p < cnt && lt(iq[p + 1], iq[p]) ? p + 1 : p);
}
void pq_up(int i) {
int p, q, j;
for (p = pq[i]; (q = p / 2) && lt(i, j = iq[q]); p = q)
iq[pq[j] = p] = j;
iq[pq[i] = p] = i;
}
void pq_dn(int i) {
int p, q, j;
for (p = pq[i]; (q = p2(p)) && lt(j = iq[q], i); p = q)
iq[pq[j] = p] = j;
iq[pq[i] = p] = i;
}
void pq_add_last(int i) {
iq[pq[i] = ++cnt] = i;
}
int pq_remove_first() {
int i = iq[1], j = iq[cnt--];
if (j != i)
pq[j] = 1, pq_dn(j);
pq[i] = 0;
return i;
}
int *ej[N], eo[N];
void append(int i, int j) {
ej[i][eo[i]++] = j;
}
void update(int i, int d) {
if (dd[i] > d) {
if (dd[i] == INF)
pq_add_last(i);
dd[i] = d, pq_up(i);
}
}
int main() {
static int uu[M], vv[M], gg[N], hh[N], ll[K], ii[K][L], iil[N], iir[N], idx[N_];
int n, n_, m, k, g, g_, h, i, j;
scanf("%d%d", &n, &m);
for (h = 0; h < m; h++) {
scanf("%d%d", &uu[h], &vv[h]), uu[h]--, vv[h]--;
eo[uu[h]]++, eo[vv[h]]++;
}
for (i = 0; i < n; i++)
ej[i] = (int *) malloc(eo[i] * sizeof *ej[i]), eo[i] = 0;
for (h = 0; h < m; h++)
append(uu[h], vv[h]), append(vv[h], uu[h]);
scanf("%d", &k);
memset(gg, -1, n * sizeof *gg);
for (g = 0; g < k; g++) {
scanf("%d", &ll[g]);
for (h = 0; h < ll[g]; h++) {
scanf("%d", &i), i--;
ii[g][h] = i;
gg[i] = g, hh[i] = h;
}
}
n_ = 0;
for (i = 0, n_ = 0; i < n; i++) {
if (gg[i] == -1)
iil[i] = n_, iir[i] = n_ + 1;
else
iil[i] = n_, iir[i] = n_ + ll[gg[i]];
while (n_ < iir[i])
idx[n_++] = i;
}
memset(dd, 0x3f, n_ * sizeof *dd);
dd[0] = 0, pq_add_last(0);
while (cnt) {
int i_, d, d_, d1, p, q, o, o_;
i_ = pq_remove_first(), i = idx[i_], g = gg[i], h = hh[i], d = dd[i_];
if (i == n - 1) {
printf("%d\n", d);
return 0;
}
if (g == -1) {
for (o = eo[i]; o--; ) {
j = ej[i][o], g_ = gg[j];
if (g_ == -1)
update(iil[j], d + 1);
else {
d_ = (d - hh[j] + ll[g_]) / ll[g_] * ll[g_] + hh[j];
if ((d + 1) % ll[g_] != hh[j])
update(iil[j] + (d + 1) % ll[g_], d + 1);
update(iil[j] + (d_ + 1) % ll[g_], d_ + 1);
}
}
} else {
if ((d + 1) % ll[g] != h)
update(iil[i] + (d + 1) % ll[g], d + 1);
p = ii[g][(h - 1 + ll[g]) % ll[g]], q = ii[g][(h + 1) % ll[g]];
for (o = 0, o_ = 0; o < eo[i]; o++) {
j = ej[i][o], g_ = gg[j];
if (g_ == -1)
update(iil[j], d + 1);
else if (j == q) {
update(iil[j] + (d + 1) % ll[g_], d + 1);
ej[i][o_++] = j;
} else if (j == p) {
if ((d + 1) % ll[g_] != hh[j] && (d + 1) % ll[g_] != h)
update(iil[j] + (d + 1) % ll[g_], d + 1);
ej[i][o_++] = j;
} else {
d_ = (d - hh[j] + ll[g_]) / ll[g_] * ll[g_] + hh[j];
if ((d + 1) % ll[g_] != hh[j])
update(iil[j] + (d + 1) % ll[g_], d + 1);
if (d_ % ll[g] == h) {
d1 = d + (d_ - d + ll[g]) / ll[g] * ll[g];
d_ = (d1 - hh[j] + ll[g_]) / ll[g_] * ll[g_] + hh[j];
if ((d1 + 1) % ll[g_] != hh[j])
update(iil[j] + (d1 + 1) % ll[g_], d1 + 1);
ej[i][o_++] = j;
}
if (d_ % ll[g] != h)
update(iil[j] + (d_ + 1) % ll[g_], d_ + 1);
}
}
eo[i] = o_;
}
}
printf("impossible\n");
return 0;
}
Compilation message
watchmen.c: In function 'main':
watchmen.c:70:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
70 | scanf("%d%d", &n, &m);
| ^~~~~~~~~~~~~~~~~~~~~
watchmen.c:72:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
72 | scanf("%d%d", &uu[h], &vv[h]), uu[h]--, vv[h]--;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
watchmen.c:79:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
79 | scanf("%d", &k);
| ^~~~~~~~~~~~~~~
watchmen.c:82:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
82 | scanf("%d", &ll[g]);
| ^~~~~~~~~~~~~~~~~~~
watchmen.c:84:4: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
84 | scanf("%d", &i), i--;
| ^~~~~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
13 ms |
2388 KB |
Output is correct |
2 |
Correct |
54 ms |
9372 KB |
Output is correct |
3 |
Correct |
43 ms |
8652 KB |
Output is correct |
4 |
Correct |
52 ms |
8780 KB |
Output is correct |
5 |
Correct |
1 ms |
468 KB |
Output is correct |
6 |
Correct |
45 ms |
8732 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
14 ms |
2344 KB |
Output is correct |
2 |
Correct |
43 ms |
9292 KB |
Output is correct |
3 |
Correct |
41 ms |
8744 KB |
Output is correct |
4 |
Correct |
44 ms |
8824 KB |
Output is correct |
5 |
Correct |
1 ms |
488 KB |
Output is correct |
6 |
Correct |
44 ms |
8688 KB |
Output is correct |
7 |
Correct |
43 ms |
8684 KB |
Output is correct |
8 |
Correct |
36 ms |
8564 KB |
Output is correct |
9 |
Correct |
40 ms |
8604 KB |
Output is correct |
10 |
Correct |
40 ms |
8732 KB |
Output is correct |
11 |
Correct |
40 ms |
8668 KB |
Output is correct |
12 |
Correct |
41 ms |
8612 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
14 ms |
2344 KB |
Output is correct |
2 |
Correct |
43 ms |
9292 KB |
Output is correct |
3 |
Correct |
41 ms |
8744 KB |
Output is correct |
4 |
Correct |
44 ms |
8824 KB |
Output is correct |
5 |
Correct |
1 ms |
488 KB |
Output is correct |
6 |
Correct |
44 ms |
8688 KB |
Output is correct |
7 |
Correct |
43 ms |
8684 KB |
Output is correct |
8 |
Correct |
36 ms |
8564 KB |
Output is correct |
9 |
Correct |
40 ms |
8604 KB |
Output is correct |
10 |
Correct |
40 ms |
8732 KB |
Output is correct |
11 |
Correct |
40 ms |
8668 KB |
Output is correct |
12 |
Correct |
41 ms |
8612 KB |
Output is correct |
13 |
Correct |
13 ms |
2380 KB |
Output is correct |
14 |
Correct |
40 ms |
9288 KB |
Output is correct |
15 |
Correct |
45 ms |
8884 KB |
Output is correct |
16 |
Correct |
65 ms |
8832 KB |
Output is correct |
17 |
Correct |
1 ms |
468 KB |
Output is correct |
18 |
Correct |
44 ms |
8764 KB |
Output is correct |
19 |
Correct |
39 ms |
8556 KB |
Output is correct |
20 |
Correct |
37 ms |
8616 KB |
Output is correct |
21 |
Correct |
37 ms |
8556 KB |
Output is correct |
22 |
Correct |
50 ms |
8716 KB |
Output is correct |
23 |
Correct |
41 ms |
8652 KB |
Output is correct |
24 |
Correct |
40 ms |
8572 KB |
Output is correct |
25 |
Correct |
998 ms |
101148 KB |
Output is correct |
26 |
Correct |
990 ms |
101760 KB |
Output is correct |
27 |
Correct |
983 ms |
101552 KB |
Output is correct |
28 |
Correct |
936 ms |
101408 KB |
Output is correct |
29 |
Correct |
1095 ms |
100936 KB |
Output is correct |
30 |
Correct |
1135 ms |
101020 KB |
Output is correct |
31 |
Correct |
1202 ms |
101012 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
14 ms |
2344 KB |
Output is correct |
2 |
Correct |
43 ms |
9292 KB |
Output is correct |
3 |
Correct |
41 ms |
8744 KB |
Output is correct |
4 |
Correct |
44 ms |
8824 KB |
Output is correct |
5 |
Correct |
1 ms |
488 KB |
Output is correct |
6 |
Correct |
44 ms |
8688 KB |
Output is correct |
7 |
Correct |
43 ms |
8684 KB |
Output is correct |
8 |
Correct |
36 ms |
8564 KB |
Output is correct |
9 |
Correct |
40 ms |
8604 KB |
Output is correct |
10 |
Correct |
40 ms |
8732 KB |
Output is correct |
11 |
Correct |
40 ms |
8668 KB |
Output is correct |
12 |
Correct |
41 ms |
8612 KB |
Output is correct |
13 |
Correct |
13 ms |
2380 KB |
Output is correct |
14 |
Correct |
40 ms |
9288 KB |
Output is correct |
15 |
Correct |
45 ms |
8884 KB |
Output is correct |
16 |
Correct |
65 ms |
8832 KB |
Output is correct |
17 |
Correct |
1 ms |
468 KB |
Output is correct |
18 |
Correct |
44 ms |
8764 KB |
Output is correct |
19 |
Correct |
39 ms |
8556 KB |
Output is correct |
20 |
Correct |
37 ms |
8616 KB |
Output is correct |
21 |
Correct |
37 ms |
8556 KB |
Output is correct |
22 |
Correct |
50 ms |
8716 KB |
Output is correct |
23 |
Correct |
41 ms |
8652 KB |
Output is correct |
24 |
Correct |
40 ms |
8572 KB |
Output is correct |
25 |
Correct |
998 ms |
101148 KB |
Output is correct |
26 |
Correct |
990 ms |
101760 KB |
Output is correct |
27 |
Correct |
983 ms |
101552 KB |
Output is correct |
28 |
Correct |
936 ms |
101408 KB |
Output is correct |
29 |
Correct |
1095 ms |
100936 KB |
Output is correct |
30 |
Correct |
1135 ms |
101020 KB |
Output is correct |
31 |
Correct |
1202 ms |
101012 KB |
Output is correct |
32 |
Correct |
16 ms |
2388 KB |
Output is correct |
33 |
Correct |
60 ms |
9384 KB |
Output is correct |
34 |
Correct |
47 ms |
8780 KB |
Output is correct |
35 |
Correct |
60 ms |
8832 KB |
Output is correct |
36 |
Correct |
1 ms |
468 KB |
Output is correct |
37 |
Correct |
59 ms |
8748 KB |
Output is correct |
38 |
Correct |
53 ms |
8620 KB |
Output is correct |
39 |
Correct |
51 ms |
8624 KB |
Output is correct |
40 |
Correct |
53 ms |
8572 KB |
Output is correct |
41 |
Correct |
57 ms |
8676 KB |
Output is correct |
42 |
Correct |
55 ms |
8668 KB |
Output is correct |
43 |
Correct |
59 ms |
8552 KB |
Output is correct |
44 |
Correct |
1173 ms |
100920 KB |
Output is correct |
45 |
Correct |
1151 ms |
101500 KB |
Output is correct |
46 |
Correct |
1153 ms |
101368 KB |
Output is correct |
47 |
Correct |
1045 ms |
101028 KB |
Output is correct |
48 |
Correct |
1254 ms |
100768 KB |
Output is correct |
49 |
Correct |
1135 ms |
100832 KB |
Output is correct |
50 |
Correct |
1152 ms |
101348 KB |
Output is correct |
51 |
Correct |
2121 ms |
127040 KB |
Output is correct |
52 |
Correct |
2825 ms |
143480 KB |
Output is correct |
53 |
Correct |
2353 ms |
130604 KB |
Output is correct |
54 |
Correct |
1229 ms |
104712 KB |
Output is correct |
55 |
Correct |
2396 ms |
127016 KB |
Output is correct |
56 |
Correct |
2164 ms |
121672 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
13 ms |
2388 KB |
Output is correct |
2 |
Correct |
54 ms |
9372 KB |
Output is correct |
3 |
Correct |
43 ms |
8652 KB |
Output is correct |
4 |
Correct |
52 ms |
8780 KB |
Output is correct |
5 |
Correct |
1 ms |
468 KB |
Output is correct |
6 |
Correct |
45 ms |
8732 KB |
Output is correct |
7 |
Correct |
14 ms |
2344 KB |
Output is correct |
8 |
Correct |
43 ms |
9292 KB |
Output is correct |
9 |
Correct |
41 ms |
8744 KB |
Output is correct |
10 |
Correct |
44 ms |
8824 KB |
Output is correct |
11 |
Correct |
1 ms |
488 KB |
Output is correct |
12 |
Correct |
44 ms |
8688 KB |
Output is correct |
13 |
Correct |
43 ms |
8684 KB |
Output is correct |
14 |
Correct |
36 ms |
8564 KB |
Output is correct |
15 |
Correct |
40 ms |
8604 KB |
Output is correct |
16 |
Correct |
40 ms |
8732 KB |
Output is correct |
17 |
Correct |
40 ms |
8668 KB |
Output is correct |
18 |
Correct |
41 ms |
8612 KB |
Output is correct |
19 |
Correct |
1 ms |
336 KB |
Output is correct |
20 |
Correct |
1 ms |
292 KB |
Output is correct |
21 |
Correct |
1 ms |
292 KB |
Output is correct |
22 |
Correct |
15 ms |
2336 KB |
Output is correct |
23 |
Correct |
75 ms |
9376 KB |
Output is correct |
24 |
Correct |
62 ms |
8664 KB |
Output is correct |
25 |
Correct |
72 ms |
8828 KB |
Output is correct |
26 |
Correct |
2 ms |
468 KB |
Output is correct |
27 |
Correct |
67 ms |
8736 KB |
Output is correct |
28 |
Correct |
67 ms |
8616 KB |
Output is correct |
29 |
Correct |
59 ms |
8636 KB |
Output is correct |
30 |
Correct |
63 ms |
8644 KB |
Output is correct |
31 |
Correct |
57 ms |
8724 KB |
Output is correct |
32 |
Correct |
61 ms |
8676 KB |
Output is correct |
33 |
Correct |
62 ms |
8628 KB |
Output is correct |
34 |
Correct |
1324 ms |
99888 KB |
Output is correct |
35 |
Correct |
1337 ms |
100052 KB |
Output is correct |
36 |
Correct |
1369 ms |
99816 KB |
Output is correct |
37 |
Correct |
1218 ms |
100620 KB |
Output is correct |
38 |
Correct |
1287 ms |
100352 KB |
Output is correct |
39 |
Correct |
1095 ms |
100568 KB |
Output is correct |
40 |
Correct |
993 ms |
100092 KB |
Output is correct |
41 |
Correct |
953 ms |
100208 KB |
Output is correct |
42 |
Correct |
994 ms |
100232 KB |
Output is correct |
43 |
Correct |
1006 ms |
100296 KB |
Output is correct |
44 |
Correct |
1024 ms |
100148 KB |
Output is correct |
45 |
Correct |
1050 ms |
99968 KB |
Output is correct |
46 |
Correct |
997 ms |
100428 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
13 ms |
2388 KB |
Output is correct |
2 |
Correct |
54 ms |
9372 KB |
Output is correct |
3 |
Correct |
43 ms |
8652 KB |
Output is correct |
4 |
Correct |
52 ms |
8780 KB |
Output is correct |
5 |
Correct |
1 ms |
468 KB |
Output is correct |
6 |
Correct |
45 ms |
8732 KB |
Output is correct |
7 |
Correct |
14 ms |
2344 KB |
Output is correct |
8 |
Correct |
43 ms |
9292 KB |
Output is correct |
9 |
Correct |
41 ms |
8744 KB |
Output is correct |
10 |
Correct |
44 ms |
8824 KB |
Output is correct |
11 |
Correct |
1 ms |
488 KB |
Output is correct |
12 |
Correct |
44 ms |
8688 KB |
Output is correct |
13 |
Correct |
43 ms |
8684 KB |
Output is correct |
14 |
Correct |
36 ms |
8564 KB |
Output is correct |
15 |
Correct |
40 ms |
8604 KB |
Output is correct |
16 |
Correct |
40 ms |
8732 KB |
Output is correct |
17 |
Correct |
40 ms |
8668 KB |
Output is correct |
18 |
Correct |
41 ms |
8612 KB |
Output is correct |
19 |
Correct |
13 ms |
2380 KB |
Output is correct |
20 |
Correct |
40 ms |
9288 KB |
Output is correct |
21 |
Correct |
45 ms |
8884 KB |
Output is correct |
22 |
Correct |
65 ms |
8832 KB |
Output is correct |
23 |
Correct |
1 ms |
468 KB |
Output is correct |
24 |
Correct |
44 ms |
8764 KB |
Output is correct |
25 |
Correct |
39 ms |
8556 KB |
Output is correct |
26 |
Correct |
37 ms |
8616 KB |
Output is correct |
27 |
Correct |
37 ms |
8556 KB |
Output is correct |
28 |
Correct |
50 ms |
8716 KB |
Output is correct |
29 |
Correct |
41 ms |
8652 KB |
Output is correct |
30 |
Correct |
40 ms |
8572 KB |
Output is correct |
31 |
Correct |
998 ms |
101148 KB |
Output is correct |
32 |
Correct |
990 ms |
101760 KB |
Output is correct |
33 |
Correct |
983 ms |
101552 KB |
Output is correct |
34 |
Correct |
936 ms |
101408 KB |
Output is correct |
35 |
Correct |
1095 ms |
100936 KB |
Output is correct |
36 |
Correct |
1135 ms |
101020 KB |
Output is correct |
37 |
Correct |
1202 ms |
101012 KB |
Output is correct |
38 |
Correct |
1 ms |
336 KB |
Output is correct |
39 |
Correct |
1 ms |
292 KB |
Output is correct |
40 |
Correct |
1 ms |
292 KB |
Output is correct |
41 |
Correct |
15 ms |
2336 KB |
Output is correct |
42 |
Correct |
75 ms |
9376 KB |
Output is correct |
43 |
Correct |
62 ms |
8664 KB |
Output is correct |
44 |
Correct |
72 ms |
8828 KB |
Output is correct |
45 |
Correct |
2 ms |
468 KB |
Output is correct |
46 |
Correct |
67 ms |
8736 KB |
Output is correct |
47 |
Correct |
67 ms |
8616 KB |
Output is correct |
48 |
Correct |
59 ms |
8636 KB |
Output is correct |
49 |
Correct |
63 ms |
8644 KB |
Output is correct |
50 |
Correct |
57 ms |
8724 KB |
Output is correct |
51 |
Correct |
61 ms |
8676 KB |
Output is correct |
52 |
Correct |
62 ms |
8628 KB |
Output is correct |
53 |
Correct |
1324 ms |
99888 KB |
Output is correct |
54 |
Correct |
1337 ms |
100052 KB |
Output is correct |
55 |
Correct |
1369 ms |
99816 KB |
Output is correct |
56 |
Correct |
1218 ms |
100620 KB |
Output is correct |
57 |
Correct |
1287 ms |
100352 KB |
Output is correct |
58 |
Correct |
1095 ms |
100568 KB |
Output is correct |
59 |
Correct |
993 ms |
100092 KB |
Output is correct |
60 |
Correct |
953 ms |
100208 KB |
Output is correct |
61 |
Correct |
994 ms |
100232 KB |
Output is correct |
62 |
Correct |
1006 ms |
100296 KB |
Output is correct |
63 |
Correct |
1024 ms |
100148 KB |
Output is correct |
64 |
Correct |
1050 ms |
99968 KB |
Output is correct |
65 |
Correct |
997 ms |
100428 KB |
Output is correct |
66 |
Correct |
1 ms |
340 KB |
Output is correct |
67 |
Correct |
0 ms |
340 KB |
Output is correct |
68 |
Correct |
0 ms |
340 KB |
Output is correct |
69 |
Correct |
15 ms |
2376 KB |
Output is correct |
70 |
Correct |
58 ms |
9320 KB |
Output is correct |
71 |
Correct |
47 ms |
8908 KB |
Output is correct |
72 |
Correct |
55 ms |
8788 KB |
Output is correct |
73 |
Correct |
1 ms |
468 KB |
Output is correct |
74 |
Correct |
52 ms |
8704 KB |
Output is correct |
75 |
Correct |
46 ms |
8644 KB |
Output is correct |
76 |
Correct |
45 ms |
8636 KB |
Output is correct |
77 |
Correct |
44 ms |
8560 KB |
Output is correct |
78 |
Correct |
46 ms |
8780 KB |
Output is correct |
79 |
Correct |
48 ms |
8668 KB |
Output is correct |
80 |
Correct |
43 ms |
8652 KB |
Output is correct |
81 |
Correct |
1033 ms |
100956 KB |
Output is correct |
82 |
Correct |
1089 ms |
101540 KB |
Output is correct |
83 |
Correct |
964 ms |
101104 KB |
Output is correct |
84 |
Correct |
1010 ms |
101076 KB |
Output is correct |
85 |
Correct |
1000 ms |
100808 KB |
Output is correct |
86 |
Correct |
1063 ms |
101124 KB |
Output is correct |
87 |
Correct |
1052 ms |
101344 KB |
Output is correct |
88 |
Correct |
1097 ms |
100072 KB |
Output is correct |
89 |
Correct |
1056 ms |
99984 KB |
Output is correct |
90 |
Correct |
1038 ms |
99984 KB |
Output is correct |
91 |
Correct |
968 ms |
100576 KB |
Output is correct |
92 |
Correct |
993 ms |
100408 KB |
Output is correct |
93 |
Correct |
960 ms |
100136 KB |
Output is correct |
94 |
Correct |
1012 ms |
99792 KB |
Output is correct |
95 |
Correct |
984 ms |
100028 KB |
Output is correct |
96 |
Correct |
1052 ms |
100276 KB |
Output is correct |
97 |
Correct |
1036 ms |
100096 KB |
Output is correct |
98 |
Correct |
1063 ms |
100448 KB |
Output is correct |
99 |
Correct |
1022 ms |
99780 KB |
Output is correct |
100 |
Correct |
993 ms |
100280 KB |
Output is correct |
101 |
Correct |
1018 ms |
100496 KB |
Output is correct |
102 |
Correct |
979 ms |
101024 KB |
Output is correct |
103 |
Correct |
996 ms |
100940 KB |
Output is correct |
104 |
Correct |
1100 ms |
100832 KB |
Output is correct |
105 |
Correct |
1022 ms |
101044 KB |
Output is correct |
106 |
Correct |
1043 ms |
100516 KB |
Output is correct |
107 |
Correct |
970 ms |
101032 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
13 ms |
2388 KB |
Output is correct |
2 |
Correct |
54 ms |
9372 KB |
Output is correct |
3 |
Correct |
43 ms |
8652 KB |
Output is correct |
4 |
Correct |
52 ms |
8780 KB |
Output is correct |
5 |
Correct |
1 ms |
468 KB |
Output is correct |
6 |
Correct |
45 ms |
8732 KB |
Output is correct |
7 |
Correct |
14 ms |
2344 KB |
Output is correct |
8 |
Correct |
43 ms |
9292 KB |
Output is correct |
9 |
Correct |
41 ms |
8744 KB |
Output is correct |
10 |
Correct |
44 ms |
8824 KB |
Output is correct |
11 |
Correct |
1 ms |
488 KB |
Output is correct |
12 |
Correct |
44 ms |
8688 KB |
Output is correct |
13 |
Correct |
43 ms |
8684 KB |
Output is correct |
14 |
Correct |
36 ms |
8564 KB |
Output is correct |
15 |
Correct |
40 ms |
8604 KB |
Output is correct |
16 |
Correct |
40 ms |
8732 KB |
Output is correct |
17 |
Correct |
40 ms |
8668 KB |
Output is correct |
18 |
Correct |
41 ms |
8612 KB |
Output is correct |
19 |
Correct |
13 ms |
2380 KB |
Output is correct |
20 |
Correct |
40 ms |
9288 KB |
Output is correct |
21 |
Correct |
45 ms |
8884 KB |
Output is correct |
22 |
Correct |
65 ms |
8832 KB |
Output is correct |
23 |
Correct |
1 ms |
468 KB |
Output is correct |
24 |
Correct |
44 ms |
8764 KB |
Output is correct |
25 |
Correct |
39 ms |
8556 KB |
Output is correct |
26 |
Correct |
37 ms |
8616 KB |
Output is correct |
27 |
Correct |
37 ms |
8556 KB |
Output is correct |
28 |
Correct |
50 ms |
8716 KB |
Output is correct |
29 |
Correct |
41 ms |
8652 KB |
Output is correct |
30 |
Correct |
40 ms |
8572 KB |
Output is correct |
31 |
Correct |
998 ms |
101148 KB |
Output is correct |
32 |
Correct |
990 ms |
101760 KB |
Output is correct |
33 |
Correct |
983 ms |
101552 KB |
Output is correct |
34 |
Correct |
936 ms |
101408 KB |
Output is correct |
35 |
Correct |
1095 ms |
100936 KB |
Output is correct |
36 |
Correct |
1135 ms |
101020 KB |
Output is correct |
37 |
Correct |
1202 ms |
101012 KB |
Output is correct |
38 |
Correct |
16 ms |
2388 KB |
Output is correct |
39 |
Correct |
60 ms |
9384 KB |
Output is correct |
40 |
Correct |
47 ms |
8780 KB |
Output is correct |
41 |
Correct |
60 ms |
8832 KB |
Output is correct |
42 |
Correct |
1 ms |
468 KB |
Output is correct |
43 |
Correct |
59 ms |
8748 KB |
Output is correct |
44 |
Correct |
53 ms |
8620 KB |
Output is correct |
45 |
Correct |
51 ms |
8624 KB |
Output is correct |
46 |
Correct |
53 ms |
8572 KB |
Output is correct |
47 |
Correct |
57 ms |
8676 KB |
Output is correct |
48 |
Correct |
55 ms |
8668 KB |
Output is correct |
49 |
Correct |
59 ms |
8552 KB |
Output is correct |
50 |
Correct |
1173 ms |
100920 KB |
Output is correct |
51 |
Correct |
1151 ms |
101500 KB |
Output is correct |
52 |
Correct |
1153 ms |
101368 KB |
Output is correct |
53 |
Correct |
1045 ms |
101028 KB |
Output is correct |
54 |
Correct |
1254 ms |
100768 KB |
Output is correct |
55 |
Correct |
1135 ms |
100832 KB |
Output is correct |
56 |
Correct |
1152 ms |
101348 KB |
Output is correct |
57 |
Correct |
2121 ms |
127040 KB |
Output is correct |
58 |
Correct |
2825 ms |
143480 KB |
Output is correct |
59 |
Correct |
2353 ms |
130604 KB |
Output is correct |
60 |
Correct |
1229 ms |
104712 KB |
Output is correct |
61 |
Correct |
2396 ms |
127016 KB |
Output is correct |
62 |
Correct |
2164 ms |
121672 KB |
Output is correct |
63 |
Correct |
1 ms |
336 KB |
Output is correct |
64 |
Correct |
1 ms |
292 KB |
Output is correct |
65 |
Correct |
1 ms |
292 KB |
Output is correct |
66 |
Correct |
15 ms |
2336 KB |
Output is correct |
67 |
Correct |
75 ms |
9376 KB |
Output is correct |
68 |
Correct |
62 ms |
8664 KB |
Output is correct |
69 |
Correct |
72 ms |
8828 KB |
Output is correct |
70 |
Correct |
2 ms |
468 KB |
Output is correct |
71 |
Correct |
67 ms |
8736 KB |
Output is correct |
72 |
Correct |
67 ms |
8616 KB |
Output is correct |
73 |
Correct |
59 ms |
8636 KB |
Output is correct |
74 |
Correct |
63 ms |
8644 KB |
Output is correct |
75 |
Correct |
57 ms |
8724 KB |
Output is correct |
76 |
Correct |
61 ms |
8676 KB |
Output is correct |
77 |
Correct |
62 ms |
8628 KB |
Output is correct |
78 |
Correct |
1324 ms |
99888 KB |
Output is correct |
79 |
Correct |
1337 ms |
100052 KB |
Output is correct |
80 |
Correct |
1369 ms |
99816 KB |
Output is correct |
81 |
Correct |
1218 ms |
100620 KB |
Output is correct |
82 |
Correct |
1287 ms |
100352 KB |
Output is correct |
83 |
Correct |
1095 ms |
100568 KB |
Output is correct |
84 |
Correct |
993 ms |
100092 KB |
Output is correct |
85 |
Correct |
953 ms |
100208 KB |
Output is correct |
86 |
Correct |
994 ms |
100232 KB |
Output is correct |
87 |
Correct |
1006 ms |
100296 KB |
Output is correct |
88 |
Correct |
1024 ms |
100148 KB |
Output is correct |
89 |
Correct |
1050 ms |
99968 KB |
Output is correct |
90 |
Correct |
997 ms |
100428 KB |
Output is correct |
91 |
Correct |
1 ms |
340 KB |
Output is correct |
92 |
Correct |
0 ms |
340 KB |
Output is correct |
93 |
Correct |
0 ms |
340 KB |
Output is correct |
94 |
Correct |
15 ms |
2376 KB |
Output is correct |
95 |
Correct |
58 ms |
9320 KB |
Output is correct |
96 |
Correct |
47 ms |
8908 KB |
Output is correct |
97 |
Correct |
55 ms |
8788 KB |
Output is correct |
98 |
Correct |
1 ms |
468 KB |
Output is correct |
99 |
Correct |
52 ms |
8704 KB |
Output is correct |
100 |
Correct |
46 ms |
8644 KB |
Output is correct |
101 |
Correct |
45 ms |
8636 KB |
Output is correct |
102 |
Correct |
44 ms |
8560 KB |
Output is correct |
103 |
Correct |
46 ms |
8780 KB |
Output is correct |
104 |
Correct |
48 ms |
8668 KB |
Output is correct |
105 |
Correct |
43 ms |
8652 KB |
Output is correct |
106 |
Correct |
1033 ms |
100956 KB |
Output is correct |
107 |
Correct |
1089 ms |
101540 KB |
Output is correct |
108 |
Correct |
964 ms |
101104 KB |
Output is correct |
109 |
Correct |
1010 ms |
101076 KB |
Output is correct |
110 |
Correct |
1000 ms |
100808 KB |
Output is correct |
111 |
Correct |
1063 ms |
101124 KB |
Output is correct |
112 |
Correct |
1052 ms |
101344 KB |
Output is correct |
113 |
Correct |
1097 ms |
100072 KB |
Output is correct |
114 |
Correct |
1056 ms |
99984 KB |
Output is correct |
115 |
Correct |
1038 ms |
99984 KB |
Output is correct |
116 |
Correct |
968 ms |
100576 KB |
Output is correct |
117 |
Correct |
993 ms |
100408 KB |
Output is correct |
118 |
Correct |
960 ms |
100136 KB |
Output is correct |
119 |
Correct |
1012 ms |
99792 KB |
Output is correct |
120 |
Correct |
984 ms |
100028 KB |
Output is correct |
121 |
Correct |
1052 ms |
100276 KB |
Output is correct |
122 |
Correct |
1036 ms |
100096 KB |
Output is correct |
123 |
Correct |
1063 ms |
100448 KB |
Output is correct |
124 |
Correct |
1022 ms |
99780 KB |
Output is correct |
125 |
Correct |
993 ms |
100280 KB |
Output is correct |
126 |
Correct |
1018 ms |
100496 KB |
Output is correct |
127 |
Correct |
979 ms |
101024 KB |
Output is correct |
128 |
Correct |
996 ms |
100940 KB |
Output is correct |
129 |
Correct |
1100 ms |
100832 KB |
Output is correct |
130 |
Correct |
1022 ms |
101044 KB |
Output is correct |
131 |
Correct |
1043 ms |
100516 KB |
Output is correct |
132 |
Correct |
970 ms |
101032 KB |
Output is correct |
133 |
Correct |
0 ms |
340 KB |
Output is correct |
134 |
Correct |
0 ms |
340 KB |
Output is correct |
135 |
Correct |
0 ms |
340 KB |
Output is correct |
136 |
Correct |
13 ms |
2352 KB |
Output is correct |
137 |
Correct |
43 ms |
9372 KB |
Output is correct |
138 |
Correct |
53 ms |
8752 KB |
Output is correct |
139 |
Correct |
49 ms |
8752 KB |
Output is correct |
140 |
Correct |
1 ms |
544 KB |
Output is correct |
141 |
Correct |
44 ms |
8732 KB |
Output is correct |
142 |
Correct |
44 ms |
8624 KB |
Output is correct |
143 |
Correct |
40 ms |
8592 KB |
Output is correct |
144 |
Correct |
38 ms |
8652 KB |
Output is correct |
145 |
Correct |
43 ms |
8676 KB |
Output is correct |
146 |
Correct |
45 ms |
8640 KB |
Output is correct |
147 |
Correct |
50 ms |
8648 KB |
Output is correct |
148 |
Correct |
1083 ms |
100812 KB |
Output is correct |
149 |
Correct |
991 ms |
101760 KB |
Output is correct |
150 |
Correct |
1034 ms |
101328 KB |
Output is correct |
151 |
Correct |
970 ms |
101168 KB |
Output is correct |
152 |
Correct |
994 ms |
100596 KB |
Output is correct |
153 |
Correct |
1008 ms |
101288 KB |
Output is correct |
154 |
Correct |
1052 ms |
101128 KB |
Output is correct |
155 |
Correct |
1845 ms |
127132 KB |
Output is correct |
156 |
Correct |
2375 ms |
145004 KB |
Output is correct |
157 |
Correct |
1827 ms |
130768 KB |
Output is correct |
158 |
Correct |
895 ms |
104780 KB |
Output is correct |
159 |
Correct |
1908 ms |
127088 KB |
Output is correct |
160 |
Correct |
1636 ms |
121544 KB |
Output is correct |
161 |
Correct |
947 ms |
100248 KB |
Output is correct |
162 |
Correct |
967 ms |
99964 KB |
Output is correct |
163 |
Correct |
986 ms |
100124 KB |
Output is correct |
164 |
Correct |
999 ms |
100024 KB |
Output is correct |
165 |
Correct |
1014 ms |
99996 KB |
Output is correct |
166 |
Correct |
983 ms |
99856 KB |
Output is correct |
167 |
Correct |
995 ms |
99348 KB |
Output is correct |
168 |
Correct |
1040 ms |
99660 KB |
Output is correct |
169 |
Correct |
1010 ms |
99956 KB |
Output is correct |
170 |
Correct |
1002 ms |
99688 KB |
Output is correct |
171 |
Correct |
1033 ms |
99736 KB |
Output is correct |
172 |
Correct |
1046 ms |
99412 KB |
Output is correct |
173 |
Correct |
1022 ms |
99804 KB |
Output is correct |
174 |
Correct |
1022 ms |
99920 KB |
Output is correct |
175 |
Correct |
989 ms |
100396 KB |
Output is correct |
176 |
Correct |
1030 ms |
100560 KB |
Output is correct |
177 |
Correct |
1068 ms |
100360 KB |
Output is correct |
178 |
Correct |
1027 ms |
100600 KB |
Output is correct |
179 |
Correct |
1028 ms |
100064 KB |
Output is correct |
180 |
Correct |
1025 ms |
100536 KB |
Output is correct |
181 |
Correct |
1056 ms |
101868 KB |
Output is correct |
182 |
Correct |
1063 ms |
103648 KB |
Output is correct |
183 |
Correct |
1928 ms |
129516 KB |
Output is correct |
184 |
Correct |
2171 ms |
121204 KB |
Output is correct |
185 |
Correct |
1893 ms |
124420 KB |
Output is correct |
186 |
Correct |
1094 ms |
102160 KB |
Output is correct |
187 |
Correct |
1097 ms |
104324 KB |
Output is correct |