#include <stdio.h>
#define N 10000
#define INF 0x3f3f3f3f3f3f3f3fLL
#define MD 1000000007
long long min(long long a, long long b) { return a < b ? a : b; }
int max(int a, int b) { return a > b ? a : b; }
int mem[(N - 1) * 2], *ptr = mem, *ej[N], eo[N], n, k;
int ll[N], jj[N], ta[N], tb[N], kk[N + 1], qu[N * 2];
void dfs1(int p, int i, int d) {
int o;
kk[d + 1]++;
ll[i] = 0, jj[i] = -1;
for (o = eo[i]; o--; ) {
int j = ej[i][o];
if (j != p) {
dfs1(i, j, d + 1);
if (ll[i] < ll[j])
ll[i] = ll[j], jj[i] = j;
}
}
ll[i]++;
}
void dfs2(int p, int i, int d) {
static int time;
int o;
qu[ta[i] = time++] = i, tb[i] = kk[d]++;
if (jj[i] != -1)
dfs2(i, jj[i], d + 1);
else
time++;
for (o = eo[i]; o--; ) {
int j = ej[i][o];
if (j != p && j != jj[i])
dfs2(i, j, d + 1);
}
}
int cnt[N * 2]; long long xx[N + 1];
void get_range(int a, int *l, int *r) {
*l = tb[qu[a]], *r = *l + cnt[a];
}
void dfs3(int p, int i) {
int o, d, l1, r1, l2, r2;
long long c;
for (o = eo[i]; o--; ) {
int j = ej[i][o];
if (j != p)
dfs3(i, j);
}
if (k <= ll[i]) {
get_range(ta[i] + k - 1, &l1, &r1);
xx[l1]++, xx[r1]--;
if (p != -1)
xx[tb[p]] -= r1 - l1, xx[tb[p] + 1] += r1 - l1;
}
cnt[ta[i]]++;
for (o = eo[i]; o--; ) {
int j = ej[i][o];
if (j != p && j != jj[i]) {
for (d = 1; d <= ll[j] && d < k; d++)
if (k - d <= ll[i]) {
get_range(ta[i] + k - d - 1, &l1, &r1), get_range(ta[j] + d - 1, &l2, &r2);
c = (long long) (r1 - l1) * (r2 - l2);
xx[l1] += r2 - l2, xx[r1] -= r2 - l2;
xx[l2] += r1 - l1, xx[r2] -= r1 - l1;
xx[tb[i]] -= c, xx[tb[i] + 1] += c;
if (p != -1)
xx[tb[p]] -= c, xx[tb[p] + 1] += c;
}
for (d = 1; d <= ll[j]; d++)
cnt[ta[i] + d] += cnt[ta[j] + d - 1];
}
}
}
long long ww[N];
void dfs4(int p, int i) {
int o;
ww[i] = xx[tb[i]];
for (o = eo[i]; o--; ) {
int j = ej[i][o];
if (j != p) {
dfs4(i, j);
ww[i] += ww[j];
}
}
}
long long du[N * 2]; int dv[N * 2];
void update(int l, int r, long long u, int v) {
int i;
for (i = l; i <= r; i++) {
du[i] += u, dv[i] = (long long) dv[i] * v % MD;
if (du[i] > INF)
du[i] = INF, dv[i] = 0;
}
}
void query(int l, int r, long long *u_, int *v_) {
int i;
long long u;
int v;
u = INF, v = 0;
for (i = l; i <= r; i++) {
if (u > du[i])
u = du[i], v = 0;
if (u == du[i])
v = (v + dv[i]) % MD;
}
*u_ = u, *v_ = v;
}
void process(int i, int j, int d) {
long long u1, ui, uj, u;
int v1, vi, vj, v;
u1 = INF, v1 = 0;
ui = du[ta[i] + d], vi = dv[ta[i] + d];
query(ta[j], ta[j] + min(ll[j], min(k - d - 1, d - 2)), &uj, &vj);
u = ui + uj;
v = (long long) vi * vj % MD;
if (u1 > u)
u1 = u, v1 = 0;
if (u1 == u)
v1 = (v1 + v) % MD;
if (d - 1 <= ll[j]) {
uj = du[ta[j] + d - 1], vj = dv[ta[j] + d - 1];
query(ta[i] + 1, ta[i] + min(k - d, d), &ui, &vi);
u = ui + uj;
v = (long long) vi * vj % MD;
if (u1 > u)
u1 = u, v1 = 0;
if (u1 == u)
v1 = (v1 + v) % MD;
}
du[ta[i] + d] = u1, dv[ta[i] + d] = v1;
}
void dfs5(int p, int i) {
int o, j, d;
long long u;
int v;
du[ta[i] + 0] = ww[i], dv[ta[i] + 0] = 1;
if (jj[i] == -1)
du[ta[i] + 1] = 0, dv[ta[i] + 1] = 1;
else {
for (o = eo[i]; o--; ) {
j = ej[i][o];
if (j != p)
dfs5(i, j);
}
j = jj[i];
query(ta[j], ta[j] + ll[j], &u, &v);
du[ta[i] + 0] += u, dv[ta[i] + 0] = v;
if (ll[i] >= k)
du[ta[i] + k] = INF, dv[ta[i] + k] = 0;
for (o = eo[i]; o--; ) {
j = ej[i][o];
if (j != p && j != jj[i]) {
int lower, upper;
query(ta[j], ta[j] + ll[j], &u, &v);
du[ta[i] + 0] += u, dv[ta[i] + 0] = (long long) dv[ta[i] + 0] * v % MD;
lower = ll[j] + 2, upper = k - 1 - ll[j];
if (lower > upper)
for (d = min(ll[i], k); d > 0; d--)
process(i, j, d);
else {
for (d = min(ll[i], k); d > upper; d--)
process(i, j, d);
query(ta[j], ta[j] + ll[j], &u, &v);
update(ta[i] + lower, ta[i] + upper, u, v);
for (d = lower - 1; d > 0; d--)
process(i, j, d);
}
}
}
}
}
int main() {
static int ii_[N - 1], jj_[N - 1];
int h, i, j, d, v;
long long w, u;
scanf("%d%d", &n, &k);
for (h = 0; h < n - 1; h++) {
scanf("%d%d", &i, &j), i--, j--;
ii_[h] = i, jj_[h] = j;
eo[i]++, eo[j]++;
}
for (i = 0; i < n; i++) {
ej[i] = ptr, ptr += eo[i];
eo[i] = 0;
}
for (h = 0; h < n - 1; h++) {
i = ii_[h], j = jj_[h];
ej[i][eo[i]++] = j, ej[j][eo[j]++] = i;
}
dfs1(-1, 0, 0);
for (d = 1; d <= n; d++)
kk[d] += kk[d - 1];
dfs2(-1, 0, 0);
dfs3(-1, 0);
for (i = 1; i <= n; i++)
xx[i] += xx[i - 1];
dfs4(-1, 0);
w = 0;
for (i = 0; i < n; i++)
w += ww[i];
w /= k;
dfs5(-1, 0);
query(ta[0], ta[0] + ll[0], &u, &v);
if (u == w)
printf("YES\n%d\n", v);
else
printf("NO\n0\n");
return 0;
}
Compilation message
wells.c: In function 'main':
wells.c:208:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
208 | scanf("%d%d", &n, &k);
| ^~~~~~~~~~~~~~~~~~~~~
wells.c:210:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
210 | scanf("%d%d", &i, &j), i--, j--;
| ^~~~~~~~~~~~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
332 KB |
Output is correct |
2 |
Correct |
1 ms |
332 KB |
Output is correct |
3 |
Partially correct |
1 ms |
332 KB |
Output is partially correct |
4 |
Correct |
1 ms |
332 KB |
Output is correct |
5 |
Correct |
0 ms |
332 KB |
Output is correct |
6 |
Correct |
1 ms |
332 KB |
Output is correct |
7 |
Correct |
0 ms |
332 KB |
Output is correct |
8 |
Correct |
0 ms |
332 KB |
Output is correct |
9 |
Correct |
1 ms |
332 KB |
Output is correct |
10 |
Correct |
0 ms |
332 KB |
Output is correct |
11 |
Correct |
0 ms |
332 KB |
Output is correct |
12 |
Partially correct |
1 ms |
280 KB |
Output is partially correct |
13 |
Correct |
0 ms |
332 KB |
Output is correct |
14 |
Correct |
1 ms |
332 KB |
Output is correct |
15 |
Correct |
0 ms |
332 KB |
Output is correct |
16 |
Partially correct |
1 ms |
280 KB |
Output is partially correct |
17 |
Partially correct |
0 ms |
332 KB |
Output is partially correct |
18 |
Partially correct |
0 ms |
332 KB |
Output is partially correct |
19 |
Correct |
0 ms |
332 KB |
Output is correct |
20 |
Correct |
0 ms |
332 KB |
Output is correct |
21 |
Correct |
1 ms |
332 KB |
Output is correct |
22 |
Correct |
0 ms |
332 KB |
Output is correct |
23 |
Correct |
1 ms |
276 KB |
Output is correct |
24 |
Correct |
1 ms |
332 KB |
Output is correct |
25 |
Correct |
1 ms |
276 KB |
Output is correct |
26 |
Correct |
0 ms |
332 KB |
Output is correct |
27 |
Correct |
0 ms |
332 KB |
Output is correct |
28 |
Correct |
0 ms |
332 KB |
Output is correct |
29 |
Correct |
0 ms |
332 KB |
Output is correct |
30 |
Correct |
0 ms |
332 KB |
Output is correct |
31 |
Correct |
1 ms |
276 KB |
Output is correct |
32 |
Correct |
0 ms |
332 KB |
Output is correct |
33 |
Correct |
0 ms |
332 KB |
Output is correct |
34 |
Correct |
0 ms |
332 KB |
Output is correct |
35 |
Correct |
0 ms |
332 KB |
Output is correct |
36 |
Correct |
0 ms |
332 KB |
Output is correct |
37 |
Correct |
1 ms |
332 KB |
Output is correct |
38 |
Correct |
0 ms |
332 KB |
Output is correct |
39 |
Correct |
0 ms |
332 KB |
Output is correct |
40 |
Correct |
0 ms |
332 KB |
Output is correct |
41 |
Correct |
1 ms |
332 KB |
Output is correct |
42 |
Correct |
0 ms |
332 KB |
Output is correct |
43 |
Correct |
0 ms |
332 KB |
Output is correct |
44 |
Correct |
0 ms |
332 KB |
Output is correct |
45 |
Correct |
1 ms |
332 KB |
Output is correct |
46 |
Correct |
0 ms |
288 KB |
Output is correct |
47 |
Correct |
1 ms |
332 KB |
Output is correct |
48 |
Correct |
1 ms |
332 KB |
Output is correct |
49 |
Partially correct |
1 ms |
280 KB |
Output is partially correct |
50 |
Correct |
1 ms |
332 KB |
Output is correct |
51 |
Partially correct |
1 ms |
332 KB |
Output is partially correct |
52 |
Partially correct |
1 ms |
332 KB |
Output is partially correct |
53 |
Correct |
0 ms |
332 KB |
Output is correct |
54 |
Correct |
1 ms |
332 KB |
Output is correct |
55 |
Correct |
1 ms |
360 KB |
Output is correct |
56 |
Correct |
1 ms |
332 KB |
Output is correct |
57 |
Correct |
1 ms |
332 KB |
Output is correct |
58 |
Correct |
1 ms |
332 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
332 KB |
Output is correct |
2 |
Correct |
1 ms |
332 KB |
Output is correct |
3 |
Partially correct |
1 ms |
332 KB |
Output is partially correct |
4 |
Correct |
1 ms |
332 KB |
Output is correct |
5 |
Correct |
0 ms |
332 KB |
Output is correct |
6 |
Correct |
1 ms |
332 KB |
Output is correct |
7 |
Correct |
0 ms |
332 KB |
Output is correct |
8 |
Correct |
0 ms |
332 KB |
Output is correct |
9 |
Correct |
1 ms |
332 KB |
Output is correct |
10 |
Correct |
0 ms |
332 KB |
Output is correct |
11 |
Correct |
0 ms |
332 KB |
Output is correct |
12 |
Partially correct |
1 ms |
280 KB |
Output is partially correct |
13 |
Correct |
0 ms |
332 KB |
Output is correct |
14 |
Correct |
1 ms |
332 KB |
Output is correct |
15 |
Correct |
0 ms |
332 KB |
Output is correct |
16 |
Partially correct |
1 ms |
280 KB |
Output is partially correct |
17 |
Partially correct |
0 ms |
332 KB |
Output is partially correct |
18 |
Partially correct |
0 ms |
332 KB |
Output is partially correct |
19 |
Correct |
0 ms |
332 KB |
Output is correct |
20 |
Correct |
0 ms |
332 KB |
Output is correct |
21 |
Correct |
1 ms |
332 KB |
Output is correct |
22 |
Correct |
0 ms |
332 KB |
Output is correct |
23 |
Correct |
1 ms |
276 KB |
Output is correct |
24 |
Correct |
1 ms |
332 KB |
Output is correct |
25 |
Correct |
1 ms |
276 KB |
Output is correct |
26 |
Correct |
0 ms |
332 KB |
Output is correct |
27 |
Correct |
0 ms |
332 KB |
Output is correct |
28 |
Correct |
0 ms |
332 KB |
Output is correct |
29 |
Correct |
0 ms |
332 KB |
Output is correct |
30 |
Correct |
0 ms |
332 KB |
Output is correct |
31 |
Correct |
1 ms |
276 KB |
Output is correct |
32 |
Correct |
0 ms |
332 KB |
Output is correct |
33 |
Correct |
0 ms |
332 KB |
Output is correct |
34 |
Correct |
0 ms |
332 KB |
Output is correct |
35 |
Correct |
0 ms |
332 KB |
Output is correct |
36 |
Correct |
0 ms |
332 KB |
Output is correct |
37 |
Correct |
1 ms |
332 KB |
Output is correct |
38 |
Correct |
0 ms |
332 KB |
Output is correct |
39 |
Correct |
0 ms |
332 KB |
Output is correct |
40 |
Correct |
0 ms |
332 KB |
Output is correct |
41 |
Correct |
1 ms |
332 KB |
Output is correct |
42 |
Correct |
0 ms |
332 KB |
Output is correct |
43 |
Correct |
0 ms |
332 KB |
Output is correct |
44 |
Correct |
0 ms |
332 KB |
Output is correct |
45 |
Correct |
1 ms |
332 KB |
Output is correct |
46 |
Correct |
0 ms |
288 KB |
Output is correct |
47 |
Correct |
1 ms |
332 KB |
Output is correct |
48 |
Correct |
1 ms |
332 KB |
Output is correct |
49 |
Partially correct |
1 ms |
280 KB |
Output is partially correct |
50 |
Correct |
1 ms |
332 KB |
Output is correct |
51 |
Partially correct |
1 ms |
332 KB |
Output is partially correct |
52 |
Partially correct |
1 ms |
332 KB |
Output is partially correct |
53 |
Correct |
0 ms |
332 KB |
Output is correct |
54 |
Correct |
1 ms |
332 KB |
Output is correct |
55 |
Correct |
1 ms |
360 KB |
Output is correct |
56 |
Correct |
1 ms |
332 KB |
Output is correct |
57 |
Correct |
1 ms |
332 KB |
Output is correct |
58 |
Correct |
1 ms |
332 KB |
Output is correct |
59 |
Correct |
0 ms |
332 KB |
Output is correct |
60 |
Correct |
3 ms |
716 KB |
Output is correct |
61 |
Correct |
2 ms |
588 KB |
Output is correct |
62 |
Correct |
3 ms |
716 KB |
Output is correct |
63 |
Correct |
12 ms |
1312 KB |
Output is correct |
64 |
Correct |
40 ms |
1988 KB |
Output is correct |
65 |
Correct |
7 ms |
1228 KB |
Output is correct |
66 |
Correct |
6 ms |
1272 KB |
Output is correct |
67 |
Correct |
48 ms |
1932 KB |
Output is correct |
68 |
Correct |
4 ms |
716 KB |
Output is correct |
69 |
Correct |
2 ms |
716 KB |
Output is correct |
70 |
Partially correct |
32 ms |
1480 KB |
Output is partially correct |
71 |
Correct |
4 ms |
844 KB |
Output is correct |
72 |
Correct |
8 ms |
844 KB |
Output is correct |
73 |
Partially correct |
18 ms |
996 KB |
Output is partially correct |
74 |
Partially correct |
44 ms |
1612 KB |
Output is partially correct |
75 |
Partially correct |
22 ms |
1456 KB |
Output is partially correct |
76 |
Correct |
12 ms |
1484 KB |
Output is correct |
77 |
Partially correct |
3 ms |
844 KB |
Output is partially correct |
78 |
Correct |
6 ms |
932 KB |
Output is correct |
79 |
Partially correct |
3 ms |
844 KB |
Output is partially correct |
80 |
Partially correct |
32 ms |
1360 KB |
Output is partially correct |
81 |
Partially correct |
41 ms |
1444 KB |
Output is partially correct |
82 |
Correct |
27 ms |
1356 KB |
Output is correct |
83 |
Correct |
29 ms |
1496 KB |
Output is correct |
84 |
Correct |
7 ms |
1356 KB |
Output is correct |
85 |
Correct |
72 ms |
1716 KB |
Output is correct |
86 |
Correct |
10 ms |
1356 KB |
Output is correct |
87 |
Correct |
18 ms |
1400 KB |
Output is correct |
88 |
Correct |
18 ms |
1356 KB |
Output is correct |
89 |
Correct |
13 ms |
1228 KB |
Output is correct |
90 |
Correct |
8 ms |
716 KB |
Output is correct |
91 |
Correct |
14 ms |
1380 KB |
Output is correct |
92 |
Correct |
31 ms |
1612 KB |
Output is correct |
93 |
Correct |
13 ms |
1608 KB |
Output is correct |
94 |
Partially correct |
5 ms |
1228 KB |
Output is partially correct |
95 |
Partially correct |
8 ms |
1228 KB |
Output is partially correct |
96 |
Correct |
6 ms |
900 KB |
Output is correct |
97 |
Partially correct |
13 ms |
1012 KB |
Output is partially correct |
98 |
Partially correct |
22 ms |
1136 KB |
Output is partially correct |
99 |
Partially correct |
14 ms |
1100 KB |
Output is partially correct |
100 |
Correct |
34 ms |
1484 KB |
Output is correct |
101 |
Correct |
9 ms |
1344 KB |
Output is correct |
102 |
Correct |
18 ms |
1500 KB |
Output is correct |
103 |
Correct |
16 ms |
1512 KB |
Output is correct |
104 |
Correct |
15 ms |
1436 KB |
Output is correct |
105 |
Correct |
20 ms |
1484 KB |
Output is correct |
106 |
Correct |
5 ms |
1100 KB |
Output is correct |
107 |
Correct |
43 ms |
1484 KB |
Output is correct |
108 |
Correct |
9 ms |
1276 KB |
Output is correct |
109 |
Correct |
8 ms |
1228 KB |
Output is correct |
110 |
Correct |
8 ms |
1484 KB |
Output is correct |
111 |
Correct |
23 ms |
1492 KB |
Output is correct |
112 |
Partially correct |
35 ms |
1696 KB |
Output is partially correct |
113 |
Partially correct |
19 ms |
1448 KB |
Output is partially correct |
114 |
Partially correct |
29 ms |
1552 KB |
Output is partially correct |
115 |
Partially correct |
15 ms |
1312 KB |
Output is partially correct |
116 |
Partially correct |
39 ms |
1572 KB |
Output is partially correct |
117 |
Partially correct |
15 ms |
1356 KB |
Output is partially correct |
118 |
Partially correct |
46 ms |
1724 KB |
Output is partially correct |
119 |
Partially correct |
20 ms |
1428 KB |
Output is partially correct |
120 |
Correct |
33 ms |
1612 KB |
Output is correct |
121 |
Correct |
25 ms |
1568 KB |
Output is correct |
122 |
Correct |
28 ms |
1600 KB |
Output is correct |
123 |
Correct |
16 ms |
1372 KB |
Output is correct |
124 |
Correct |
29 ms |
1484 KB |
Output is correct |
125 |
Correct |
18 ms |
1476 KB |
Output is correct |
126 |
Partially correct |
11 ms |
1316 KB |
Output is partially correct |
127 |
Correct |
53 ms |
1612 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
332 KB |
Output is correct |
2 |
Correct |
1 ms |
332 KB |
Output is correct |
3 |
Partially correct |
1 ms |
332 KB |
Output is partially correct |
4 |
Correct |
1 ms |
332 KB |
Output is correct |
5 |
Correct |
0 ms |
332 KB |
Output is correct |
6 |
Correct |
1 ms |
332 KB |
Output is correct |
7 |
Correct |
0 ms |
332 KB |
Output is correct |
8 |
Correct |
0 ms |
332 KB |
Output is correct |
9 |
Correct |
1 ms |
332 KB |
Output is correct |
10 |
Correct |
0 ms |
332 KB |
Output is correct |
11 |
Correct |
0 ms |
332 KB |
Output is correct |
12 |
Partially correct |
1 ms |
280 KB |
Output is partially correct |
13 |
Correct |
0 ms |
332 KB |
Output is correct |
14 |
Correct |
1 ms |
332 KB |
Output is correct |
15 |
Correct |
0 ms |
332 KB |
Output is correct |
16 |
Partially correct |
1 ms |
280 KB |
Output is partially correct |
17 |
Partially correct |
0 ms |
332 KB |
Output is partially correct |
18 |
Partially correct |
0 ms |
332 KB |
Output is partially correct |
19 |
Correct |
0 ms |
332 KB |
Output is correct |
20 |
Correct |
0 ms |
332 KB |
Output is correct |
21 |
Correct |
1 ms |
332 KB |
Output is correct |
22 |
Correct |
0 ms |
332 KB |
Output is correct |
23 |
Correct |
1 ms |
276 KB |
Output is correct |
24 |
Correct |
1 ms |
332 KB |
Output is correct |
25 |
Correct |
1 ms |
276 KB |
Output is correct |
26 |
Correct |
0 ms |
332 KB |
Output is correct |
27 |
Correct |
0 ms |
332 KB |
Output is correct |
28 |
Correct |
0 ms |
332 KB |
Output is correct |
29 |
Correct |
0 ms |
332 KB |
Output is correct |
30 |
Correct |
0 ms |
332 KB |
Output is correct |
31 |
Correct |
1 ms |
276 KB |
Output is correct |
32 |
Correct |
0 ms |
332 KB |
Output is correct |
33 |
Correct |
0 ms |
332 KB |
Output is correct |
34 |
Correct |
0 ms |
332 KB |
Output is correct |
35 |
Correct |
0 ms |
332 KB |
Output is correct |
36 |
Correct |
0 ms |
332 KB |
Output is correct |
37 |
Correct |
1 ms |
332 KB |
Output is correct |
38 |
Correct |
0 ms |
332 KB |
Output is correct |
39 |
Correct |
0 ms |
332 KB |
Output is correct |
40 |
Correct |
0 ms |
332 KB |
Output is correct |
41 |
Correct |
1 ms |
332 KB |
Output is correct |
42 |
Correct |
0 ms |
332 KB |
Output is correct |
43 |
Correct |
0 ms |
332 KB |
Output is correct |
44 |
Correct |
0 ms |
332 KB |
Output is correct |
45 |
Correct |
1 ms |
332 KB |
Output is correct |
46 |
Correct |
0 ms |
288 KB |
Output is correct |
47 |
Correct |
1 ms |
332 KB |
Output is correct |
48 |
Correct |
1 ms |
332 KB |
Output is correct |
49 |
Partially correct |
1 ms |
280 KB |
Output is partially correct |
50 |
Correct |
1 ms |
332 KB |
Output is correct |
51 |
Partially correct |
1 ms |
332 KB |
Output is partially correct |
52 |
Partially correct |
1 ms |
332 KB |
Output is partially correct |
53 |
Correct |
0 ms |
332 KB |
Output is correct |
54 |
Correct |
1 ms |
332 KB |
Output is correct |
55 |
Correct |
1 ms |
360 KB |
Output is correct |
56 |
Correct |
1 ms |
332 KB |
Output is correct |
57 |
Correct |
1 ms |
332 KB |
Output is correct |
58 |
Correct |
1 ms |
332 KB |
Output is correct |
59 |
Correct |
0 ms |
332 KB |
Output is correct |
60 |
Correct |
3 ms |
716 KB |
Output is correct |
61 |
Correct |
2 ms |
588 KB |
Output is correct |
62 |
Correct |
3 ms |
716 KB |
Output is correct |
63 |
Correct |
12 ms |
1312 KB |
Output is correct |
64 |
Correct |
40 ms |
1988 KB |
Output is correct |
65 |
Correct |
7 ms |
1228 KB |
Output is correct |
66 |
Correct |
6 ms |
1272 KB |
Output is correct |
67 |
Correct |
48 ms |
1932 KB |
Output is correct |
68 |
Correct |
4 ms |
716 KB |
Output is correct |
69 |
Correct |
2 ms |
716 KB |
Output is correct |
70 |
Partially correct |
32 ms |
1480 KB |
Output is partially correct |
71 |
Correct |
4 ms |
844 KB |
Output is correct |
72 |
Correct |
8 ms |
844 KB |
Output is correct |
73 |
Partially correct |
18 ms |
996 KB |
Output is partially correct |
74 |
Partially correct |
44 ms |
1612 KB |
Output is partially correct |
75 |
Partially correct |
22 ms |
1456 KB |
Output is partially correct |
76 |
Correct |
12 ms |
1484 KB |
Output is correct |
77 |
Partially correct |
3 ms |
844 KB |
Output is partially correct |
78 |
Correct |
6 ms |
932 KB |
Output is correct |
79 |
Partially correct |
3 ms |
844 KB |
Output is partially correct |
80 |
Partially correct |
32 ms |
1360 KB |
Output is partially correct |
81 |
Partially correct |
41 ms |
1444 KB |
Output is partially correct |
82 |
Correct |
27 ms |
1356 KB |
Output is correct |
83 |
Correct |
29 ms |
1496 KB |
Output is correct |
84 |
Correct |
7 ms |
1356 KB |
Output is correct |
85 |
Correct |
72 ms |
1716 KB |
Output is correct |
86 |
Correct |
10 ms |
1356 KB |
Output is correct |
87 |
Correct |
18 ms |
1400 KB |
Output is correct |
88 |
Correct |
18 ms |
1356 KB |
Output is correct |
89 |
Correct |
13 ms |
1228 KB |
Output is correct |
90 |
Correct |
8 ms |
716 KB |
Output is correct |
91 |
Correct |
14 ms |
1380 KB |
Output is correct |
92 |
Correct |
31 ms |
1612 KB |
Output is correct |
93 |
Correct |
13 ms |
1608 KB |
Output is correct |
94 |
Partially correct |
5 ms |
1228 KB |
Output is partially correct |
95 |
Partially correct |
8 ms |
1228 KB |
Output is partially correct |
96 |
Correct |
6 ms |
900 KB |
Output is correct |
97 |
Partially correct |
13 ms |
1012 KB |
Output is partially correct |
98 |
Partially correct |
22 ms |
1136 KB |
Output is partially correct |
99 |
Partially correct |
14 ms |
1100 KB |
Output is partially correct |
100 |
Correct |
34 ms |
1484 KB |
Output is correct |
101 |
Correct |
9 ms |
1344 KB |
Output is correct |
102 |
Correct |
18 ms |
1500 KB |
Output is correct |
103 |
Correct |
16 ms |
1512 KB |
Output is correct |
104 |
Correct |
15 ms |
1436 KB |
Output is correct |
105 |
Correct |
20 ms |
1484 KB |
Output is correct |
106 |
Correct |
5 ms |
1100 KB |
Output is correct |
107 |
Correct |
43 ms |
1484 KB |
Output is correct |
108 |
Correct |
9 ms |
1276 KB |
Output is correct |
109 |
Correct |
8 ms |
1228 KB |
Output is correct |
110 |
Correct |
8 ms |
1484 KB |
Output is correct |
111 |
Correct |
23 ms |
1492 KB |
Output is correct |
112 |
Partially correct |
35 ms |
1696 KB |
Output is partially correct |
113 |
Partially correct |
19 ms |
1448 KB |
Output is partially correct |
114 |
Partially correct |
29 ms |
1552 KB |
Output is partially correct |
115 |
Partially correct |
15 ms |
1312 KB |
Output is partially correct |
116 |
Partially correct |
39 ms |
1572 KB |
Output is partially correct |
117 |
Partially correct |
15 ms |
1356 KB |
Output is partially correct |
118 |
Partially correct |
46 ms |
1724 KB |
Output is partially correct |
119 |
Partially correct |
20 ms |
1428 KB |
Output is partially correct |
120 |
Correct |
33 ms |
1612 KB |
Output is correct |
121 |
Correct |
25 ms |
1568 KB |
Output is correct |
122 |
Correct |
28 ms |
1600 KB |
Output is correct |
123 |
Correct |
16 ms |
1372 KB |
Output is correct |
124 |
Correct |
29 ms |
1484 KB |
Output is correct |
125 |
Correct |
18 ms |
1476 KB |
Output is correct |
126 |
Partially correct |
11 ms |
1316 KB |
Output is partially correct |
127 |
Correct |
53 ms |
1612 KB |
Output is correct |
128 |
Correct |
0 ms |
332 KB |
Output is correct |
129 |
Runtime error |
1 ms |
332 KB |
Execution killed with signal 11 |
130 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
332 KB |
Output is correct |
2 |
Correct |
1 ms |
332 KB |
Output is correct |
3 |
Partially correct |
1 ms |
332 KB |
Output is partially correct |
4 |
Correct |
1 ms |
332 KB |
Output is correct |
5 |
Correct |
0 ms |
332 KB |
Output is correct |
6 |
Correct |
1 ms |
332 KB |
Output is correct |
7 |
Correct |
0 ms |
332 KB |
Output is correct |
8 |
Correct |
0 ms |
332 KB |
Output is correct |
9 |
Correct |
1 ms |
332 KB |
Output is correct |
10 |
Correct |
0 ms |
332 KB |
Output is correct |
11 |
Correct |
0 ms |
332 KB |
Output is correct |
12 |
Partially correct |
1 ms |
280 KB |
Output is partially correct |
13 |
Correct |
0 ms |
332 KB |
Output is correct |
14 |
Correct |
1 ms |
332 KB |
Output is correct |
15 |
Correct |
0 ms |
332 KB |
Output is correct |
16 |
Partially correct |
1 ms |
280 KB |
Output is partially correct |
17 |
Partially correct |
0 ms |
332 KB |
Output is partially correct |
18 |
Partially correct |
0 ms |
332 KB |
Output is partially correct |
19 |
Correct |
0 ms |
332 KB |
Output is correct |
20 |
Correct |
0 ms |
332 KB |
Output is correct |
21 |
Correct |
1 ms |
332 KB |
Output is correct |
22 |
Correct |
0 ms |
332 KB |
Output is correct |
23 |
Correct |
1 ms |
276 KB |
Output is correct |
24 |
Correct |
1 ms |
332 KB |
Output is correct |
25 |
Correct |
1 ms |
276 KB |
Output is correct |
26 |
Correct |
0 ms |
332 KB |
Output is correct |
27 |
Correct |
0 ms |
332 KB |
Output is correct |
28 |
Correct |
0 ms |
332 KB |
Output is correct |
29 |
Correct |
0 ms |
332 KB |
Output is correct |
30 |
Correct |
0 ms |
332 KB |
Output is correct |
31 |
Correct |
1 ms |
276 KB |
Output is correct |
32 |
Correct |
0 ms |
332 KB |
Output is correct |
33 |
Correct |
0 ms |
332 KB |
Output is correct |
34 |
Correct |
0 ms |
332 KB |
Output is correct |
35 |
Correct |
0 ms |
332 KB |
Output is correct |
36 |
Correct |
0 ms |
332 KB |
Output is correct |
37 |
Correct |
1 ms |
332 KB |
Output is correct |
38 |
Correct |
0 ms |
332 KB |
Output is correct |
39 |
Correct |
0 ms |
332 KB |
Output is correct |
40 |
Correct |
0 ms |
332 KB |
Output is correct |
41 |
Correct |
1 ms |
332 KB |
Output is correct |
42 |
Correct |
0 ms |
332 KB |
Output is correct |
43 |
Correct |
0 ms |
332 KB |
Output is correct |
44 |
Correct |
0 ms |
332 KB |
Output is correct |
45 |
Correct |
1 ms |
332 KB |
Output is correct |
46 |
Correct |
0 ms |
288 KB |
Output is correct |
47 |
Correct |
1 ms |
332 KB |
Output is correct |
48 |
Correct |
1 ms |
332 KB |
Output is correct |
49 |
Partially correct |
1 ms |
280 KB |
Output is partially correct |
50 |
Correct |
1 ms |
332 KB |
Output is correct |
51 |
Partially correct |
1 ms |
332 KB |
Output is partially correct |
52 |
Partially correct |
1 ms |
332 KB |
Output is partially correct |
53 |
Correct |
0 ms |
332 KB |
Output is correct |
54 |
Correct |
1 ms |
332 KB |
Output is correct |
55 |
Correct |
1 ms |
360 KB |
Output is correct |
56 |
Correct |
1 ms |
332 KB |
Output is correct |
57 |
Correct |
1 ms |
332 KB |
Output is correct |
58 |
Correct |
1 ms |
332 KB |
Output is correct |
59 |
Correct |
0 ms |
332 KB |
Output is correct |
60 |
Correct |
3 ms |
716 KB |
Output is correct |
61 |
Correct |
2 ms |
588 KB |
Output is correct |
62 |
Correct |
3 ms |
716 KB |
Output is correct |
63 |
Correct |
12 ms |
1312 KB |
Output is correct |
64 |
Correct |
40 ms |
1988 KB |
Output is correct |
65 |
Correct |
7 ms |
1228 KB |
Output is correct |
66 |
Correct |
6 ms |
1272 KB |
Output is correct |
67 |
Correct |
48 ms |
1932 KB |
Output is correct |
68 |
Correct |
4 ms |
716 KB |
Output is correct |
69 |
Correct |
2 ms |
716 KB |
Output is correct |
70 |
Partially correct |
32 ms |
1480 KB |
Output is partially correct |
71 |
Correct |
4 ms |
844 KB |
Output is correct |
72 |
Correct |
8 ms |
844 KB |
Output is correct |
73 |
Partially correct |
18 ms |
996 KB |
Output is partially correct |
74 |
Partially correct |
44 ms |
1612 KB |
Output is partially correct |
75 |
Partially correct |
22 ms |
1456 KB |
Output is partially correct |
76 |
Correct |
12 ms |
1484 KB |
Output is correct |
77 |
Partially correct |
3 ms |
844 KB |
Output is partially correct |
78 |
Correct |
6 ms |
932 KB |
Output is correct |
79 |
Partially correct |
3 ms |
844 KB |
Output is partially correct |
80 |
Partially correct |
32 ms |
1360 KB |
Output is partially correct |
81 |
Partially correct |
41 ms |
1444 KB |
Output is partially correct |
82 |
Correct |
27 ms |
1356 KB |
Output is correct |
83 |
Correct |
29 ms |
1496 KB |
Output is correct |
84 |
Correct |
7 ms |
1356 KB |
Output is correct |
85 |
Correct |
72 ms |
1716 KB |
Output is correct |
86 |
Correct |
10 ms |
1356 KB |
Output is correct |
87 |
Correct |
18 ms |
1400 KB |
Output is correct |
88 |
Correct |
18 ms |
1356 KB |
Output is correct |
89 |
Correct |
13 ms |
1228 KB |
Output is correct |
90 |
Correct |
8 ms |
716 KB |
Output is correct |
91 |
Correct |
14 ms |
1380 KB |
Output is correct |
92 |
Correct |
31 ms |
1612 KB |
Output is correct |
93 |
Correct |
13 ms |
1608 KB |
Output is correct |
94 |
Partially correct |
5 ms |
1228 KB |
Output is partially correct |
95 |
Partially correct |
8 ms |
1228 KB |
Output is partially correct |
96 |
Correct |
6 ms |
900 KB |
Output is correct |
97 |
Partially correct |
13 ms |
1012 KB |
Output is partially correct |
98 |
Partially correct |
22 ms |
1136 KB |
Output is partially correct |
99 |
Partially correct |
14 ms |
1100 KB |
Output is partially correct |
100 |
Correct |
34 ms |
1484 KB |
Output is correct |
101 |
Correct |
9 ms |
1344 KB |
Output is correct |
102 |
Correct |
18 ms |
1500 KB |
Output is correct |
103 |
Correct |
16 ms |
1512 KB |
Output is correct |
104 |
Correct |
15 ms |
1436 KB |
Output is correct |
105 |
Correct |
20 ms |
1484 KB |
Output is correct |
106 |
Correct |
5 ms |
1100 KB |
Output is correct |
107 |
Correct |
43 ms |
1484 KB |
Output is correct |
108 |
Correct |
9 ms |
1276 KB |
Output is correct |
109 |
Correct |
8 ms |
1228 KB |
Output is correct |
110 |
Correct |
8 ms |
1484 KB |
Output is correct |
111 |
Correct |
23 ms |
1492 KB |
Output is correct |
112 |
Partially correct |
35 ms |
1696 KB |
Output is partially correct |
113 |
Partially correct |
19 ms |
1448 KB |
Output is partially correct |
114 |
Partially correct |
29 ms |
1552 KB |
Output is partially correct |
115 |
Partially correct |
15 ms |
1312 KB |
Output is partially correct |
116 |
Partially correct |
39 ms |
1572 KB |
Output is partially correct |
117 |
Partially correct |
15 ms |
1356 KB |
Output is partially correct |
118 |
Partially correct |
46 ms |
1724 KB |
Output is partially correct |
119 |
Partially correct |
20 ms |
1428 KB |
Output is partially correct |
120 |
Correct |
33 ms |
1612 KB |
Output is correct |
121 |
Correct |
25 ms |
1568 KB |
Output is correct |
122 |
Correct |
28 ms |
1600 KB |
Output is correct |
123 |
Correct |
16 ms |
1372 KB |
Output is correct |
124 |
Correct |
29 ms |
1484 KB |
Output is correct |
125 |
Correct |
18 ms |
1476 KB |
Output is correct |
126 |
Partially correct |
11 ms |
1316 KB |
Output is partially correct |
127 |
Correct |
53 ms |
1612 KB |
Output is correct |
128 |
Correct |
0 ms |
332 KB |
Output is correct |
129 |
Runtime error |
1 ms |
332 KB |
Execution killed with signal 11 |
130 |
Halted |
0 ms |
0 KB |
- |