#include <stdio.h>
#include <string.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], *p = 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 dp[N][N + 1]; int dq[N][N + 1], sz[N + 1];
void dfs5(int p, int i) {
int o, di, dj;
dp[i][0] = ww[i], dq[i][0] = 1, dp[i][1] = 0, dq[i][1] = 1, sz[i] = 1;
for (o = eo[i]; o--; ) {
int j = ej[i][o];
if (j != p) {
dfs5(i, j);
memset(dp[i] + sz[i] + 1, 0x3f, sz[j] * sizeof *dp[i]);
memset(dq[i] + sz[i] + 1, 0, sz[j] * sizeof *dq[i]);
for (di = sz[i]; di >= 0; di--) {
long long pi = dp[i][di];
int qi = dq[i][di];
dp[i][di] = INF, dq[i][di] = 0;
for (dj = sz[j]; dj >= 0; dj--) {
long long pj = dp[j][dj];
int qj = dq[j][dj];
if (di + dj < k) {
int d = di == 0 ? 0 : max(di, dj + 1);
long long p = pi + pj;
int q = (long long) qi * qj % MD;
if (dp[i][d] > p)
dp[i][d] = p, dq[i][d] = 0;
if (dp[i][d] == p)
dq[i][d] = (dq[i][d] + q) % MD;
}
}
}
sz[i] += sz[j];
}
}
}
int main() {
static int uu[N - 1], vv[N - 1];
int h, i, j, d, yes, q;
long long w;
scanf("%d%d", &n, &k);
for (h = 0; h < n - 1; h++) {
scanf("%d%d", &i, &j), i--, j--;
uu[h] = i, vv[h] = j;
eo[i]++, eo[j]++;
}
for (i = 0; i < n; i++) {
ej[i] = p, p += eo[i];
eo[i] = 0;
}
for (h = 0; h < n - 1; h++) {
i = uu[h], j = vv[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];
memset(qu, -1, n * 2 * sizeof *qu);
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);
yes = 0, q = 0;
for (d = 0; d < n; d++)
if (dp[0][d] == w)
yes = 1, q = (q + dq[0][d]) % MD;
printf(yes ? "YES\n" : "NO\n");
printf("%d\n", q);
return 0;
}
Compilation message
wells.c: In function 'main':
wells.c:152:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
152 | scanf("%d%d", &n, &k);
| ^~~~~~~~~~~~~~~~~~~~~
wells.c:154:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
154 | scanf("%d%d", &i, &j), i--, j--;
| ^~~~~~~~~~~~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
332 KB |
Output is correct |
2 |
Correct |
1 ms |
1996 KB |
Output is correct |
3 |
Correct |
1 ms |
2124 KB |
Output is correct |
4 |
Correct |
1 ms |
2076 KB |
Output is correct |
5 |
Correct |
1 ms |
1996 KB |
Output is correct |
6 |
Correct |
1 ms |
2124 KB |
Output is correct |
7 |
Correct |
1 ms |
1996 KB |
Output is correct |
8 |
Correct |
1 ms |
1996 KB |
Output is correct |
9 |
Correct |
1 ms |
1996 KB |
Output is correct |
10 |
Correct |
1 ms |
1996 KB |
Output is correct |
11 |
Correct |
1 ms |
1948 KB |
Output is correct |
12 |
Correct |
1 ms |
2080 KB |
Output is correct |
13 |
Correct |
1 ms |
1996 KB |
Output is correct |
14 |
Correct |
1 ms |
2124 KB |
Output is correct |
15 |
Correct |
1 ms |
2076 KB |
Output is correct |
16 |
Correct |
1 ms |
1948 KB |
Output is correct |
17 |
Correct |
1 ms |
1996 KB |
Output is correct |
18 |
Correct |
1 ms |
1996 KB |
Output is correct |
19 |
Correct |
1 ms |
1996 KB |
Output is correct |
20 |
Correct |
1 ms |
1996 KB |
Output is correct |
21 |
Correct |
2 ms |
1948 KB |
Output is correct |
22 |
Correct |
1 ms |
1996 KB |
Output is correct |
23 |
Correct |
1 ms |
2084 KB |
Output is correct |
24 |
Correct |
1 ms |
1996 KB |
Output is correct |
25 |
Correct |
1 ms |
1948 KB |
Output is correct |
26 |
Correct |
1 ms |
1996 KB |
Output is correct |
27 |
Correct |
1 ms |
1996 KB |
Output is correct |
28 |
Correct |
1 ms |
1996 KB |
Output is correct |
29 |
Correct |
1 ms |
1996 KB |
Output is correct |
30 |
Correct |
1 ms |
1996 KB |
Output is correct |
31 |
Correct |
1 ms |
1944 KB |
Output is correct |
32 |
Correct |
1 ms |
1996 KB |
Output is correct |
33 |
Correct |
1 ms |
1996 KB |
Output is correct |
34 |
Correct |
1 ms |
1996 KB |
Output is correct |
35 |
Correct |
1 ms |
1952 KB |
Output is correct |
36 |
Correct |
1 ms |
1996 KB |
Output is correct |
37 |
Correct |
1 ms |
2124 KB |
Output is correct |
38 |
Correct |
1 ms |
1996 KB |
Output is correct |
39 |
Correct |
1 ms |
1996 KB |
Output is correct |
40 |
Correct |
1 ms |
1996 KB |
Output is correct |
41 |
Correct |
1 ms |
1996 KB |
Output is correct |
42 |
Correct |
1 ms |
1952 KB |
Output is correct |
43 |
Correct |
1 ms |
1996 KB |
Output is correct |
44 |
Correct |
1 ms |
1996 KB |
Output is correct |
45 |
Correct |
2 ms |
1948 KB |
Output is correct |
46 |
Correct |
1 ms |
2080 KB |
Output is correct |
47 |
Correct |
1 ms |
2124 KB |
Output is correct |
48 |
Correct |
1 ms |
1996 KB |
Output is correct |
49 |
Correct |
1 ms |
1996 KB |
Output is correct |
50 |
Correct |
1 ms |
1996 KB |
Output is correct |
51 |
Correct |
1 ms |
2076 KB |
Output is correct |
52 |
Correct |
1 ms |
1996 KB |
Output is correct |
53 |
Correct |
1 ms |
1996 KB |
Output is correct |
54 |
Correct |
1 ms |
1996 KB |
Output is correct |
55 |
Correct |
1 ms |
1948 KB |
Output is correct |
56 |
Correct |
1 ms |
1996 KB |
Output is correct |
57 |
Correct |
1 ms |
1996 KB |
Output is correct |
58 |
Correct |
1 ms |
1996 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
332 KB |
Output is correct |
2 |
Correct |
1 ms |
1996 KB |
Output is correct |
3 |
Correct |
1 ms |
2124 KB |
Output is correct |
4 |
Correct |
1 ms |
2076 KB |
Output is correct |
5 |
Correct |
1 ms |
1996 KB |
Output is correct |
6 |
Correct |
1 ms |
2124 KB |
Output is correct |
7 |
Correct |
1 ms |
1996 KB |
Output is correct |
8 |
Correct |
1 ms |
1996 KB |
Output is correct |
9 |
Correct |
1 ms |
1996 KB |
Output is correct |
10 |
Correct |
1 ms |
1996 KB |
Output is correct |
11 |
Correct |
1 ms |
1948 KB |
Output is correct |
12 |
Correct |
1 ms |
2080 KB |
Output is correct |
13 |
Correct |
1 ms |
1996 KB |
Output is correct |
14 |
Correct |
1 ms |
2124 KB |
Output is correct |
15 |
Correct |
1 ms |
2076 KB |
Output is correct |
16 |
Correct |
1 ms |
1948 KB |
Output is correct |
17 |
Correct |
1 ms |
1996 KB |
Output is correct |
18 |
Correct |
1 ms |
1996 KB |
Output is correct |
19 |
Correct |
1 ms |
1996 KB |
Output is correct |
20 |
Correct |
1 ms |
1996 KB |
Output is correct |
21 |
Correct |
2 ms |
1948 KB |
Output is correct |
22 |
Correct |
1 ms |
1996 KB |
Output is correct |
23 |
Correct |
1 ms |
2084 KB |
Output is correct |
24 |
Correct |
1 ms |
1996 KB |
Output is correct |
25 |
Correct |
1 ms |
1948 KB |
Output is correct |
26 |
Correct |
1 ms |
1996 KB |
Output is correct |
27 |
Correct |
1 ms |
1996 KB |
Output is correct |
28 |
Correct |
1 ms |
1996 KB |
Output is correct |
29 |
Correct |
1 ms |
1996 KB |
Output is correct |
30 |
Correct |
1 ms |
1996 KB |
Output is correct |
31 |
Correct |
1 ms |
1944 KB |
Output is correct |
32 |
Correct |
1 ms |
1996 KB |
Output is correct |
33 |
Correct |
1 ms |
1996 KB |
Output is correct |
34 |
Correct |
1 ms |
1996 KB |
Output is correct |
35 |
Correct |
1 ms |
1952 KB |
Output is correct |
36 |
Correct |
1 ms |
1996 KB |
Output is correct |
37 |
Correct |
1 ms |
2124 KB |
Output is correct |
38 |
Correct |
1 ms |
1996 KB |
Output is correct |
39 |
Correct |
1 ms |
1996 KB |
Output is correct |
40 |
Correct |
1 ms |
1996 KB |
Output is correct |
41 |
Correct |
1 ms |
1996 KB |
Output is correct |
42 |
Correct |
1 ms |
1952 KB |
Output is correct |
43 |
Correct |
1 ms |
1996 KB |
Output is correct |
44 |
Correct |
1 ms |
1996 KB |
Output is correct |
45 |
Correct |
2 ms |
1948 KB |
Output is correct |
46 |
Correct |
1 ms |
2080 KB |
Output is correct |
47 |
Correct |
1 ms |
2124 KB |
Output is correct |
48 |
Correct |
1 ms |
1996 KB |
Output is correct |
49 |
Correct |
1 ms |
1996 KB |
Output is correct |
50 |
Correct |
1 ms |
1996 KB |
Output is correct |
51 |
Correct |
1 ms |
2076 KB |
Output is correct |
52 |
Correct |
1 ms |
1996 KB |
Output is correct |
53 |
Correct |
1 ms |
1996 KB |
Output is correct |
54 |
Correct |
1 ms |
1996 KB |
Output is correct |
55 |
Correct |
1 ms |
1948 KB |
Output is correct |
56 |
Correct |
1 ms |
1996 KB |
Output is correct |
57 |
Correct |
1 ms |
1996 KB |
Output is correct |
58 |
Correct |
1 ms |
1996 KB |
Output is correct |
59 |
Correct |
0 ms |
332 KB |
Output is correct |
60 |
Correct |
28 ms |
43360 KB |
Output is correct |
61 |
Correct |
16 ms |
27456 KB |
Output is correct |
62 |
Correct |
31 ms |
44252 KB |
Output is correct |
63 |
Correct |
126 ms |
139972 KB |
Output is correct |
64 |
Correct |
388 ms |
503908 KB |
Output is correct |
65 |
Correct |
85 ms |
106820 KB |
Output is correct |
66 |
Correct |
79 ms |
87812 KB |
Output is correct |
67 |
Correct |
349 ms |
449824 KB |
Output is correct |
68 |
Correct |
42 ms |
61664 KB |
Output is correct |
69 |
Correct |
26 ms |
33984 KB |
Output is correct |
70 |
Correct |
208 ms |
144200 KB |
Output is correct |
71 |
Correct |
39 ms |
52988 KB |
Output is correct |
72 |
Correct |
51 ms |
67884 KB |
Output is correct |
73 |
Correct |
84 ms |
82300 KB |
Output is correct |
74 |
Correct |
219 ms |
232260 KB |
Output is correct |
75 |
Correct |
180 ms |
122424 KB |
Output is correct |
76 |
Correct |
174 ms |
169544 KB |
Output is correct |
77 |
Correct |
39 ms |
45636 KB |
Output is correct |
78 |
Correct |
63 ms |
50904 KB |
Output is correct |
79 |
Correct |
44 ms |
43332 KB |
Output is correct |
80 |
Correct |
151 ms |
156712 KB |
Output is correct |
81 |
Correct |
188 ms |
182680 KB |
Output is correct |
82 |
Correct |
189 ms |
140996 KB |
Output is correct |
83 |
Correct |
179 ms |
156584 KB |
Output is correct |
84 |
Correct |
147 ms |
131488 KB |
Output is correct |
85 |
Correct |
319 ms |
310348 KB |
Output is correct |
86 |
Correct |
192 ms |
109512 KB |
Output is correct |
87 |
Correct |
140 ms |
157604 KB |
Output is correct |
88 |
Correct |
148 ms |
154328 KB |
Output is correct |
89 |
Correct |
103 ms |
132292 KB |
Output is correct |
90 |
Correct |
42 ms |
47812 KB |
Output is correct |
91 |
Correct |
125 ms |
121924 KB |
Output is correct |
92 |
Correct |
216 ms |
207648 KB |
Output is correct |
93 |
Correct |
149 ms |
218044 KB |
Output is correct |
94 |
Correct |
74 ms |
87136 KB |
Output is correct |
95 |
Correct |
89 ms |
105032 KB |
Output is correct |
96 |
Correct |
48 ms |
55492 KB |
Output is correct |
97 |
Correct |
80 ms |
86208 KB |
Output is correct |
98 |
Correct |
101 ms |
108740 KB |
Output is correct |
99 |
Correct |
97 ms |
96324 KB |
Output is correct |
100 |
Correct |
204 ms |
155292 KB |
Output is correct |
101 |
Correct |
138 ms |
111440 KB |
Output is correct |
102 |
Correct |
175 ms |
206840 KB |
Output is correct |
103 |
Correct |
187 ms |
168876 KB |
Output is correct |
104 |
Correct |
147 ms |
187844 KB |
Output is correct |
105 |
Correct |
182 ms |
243960 KB |
Output is correct |
106 |
Correct |
101 ms |
89116 KB |
Output is correct |
107 |
Correct |
198 ms |
244936 KB |
Output is correct |
108 |
Correct |
105 ms |
140308 KB |
Output is correct |
109 |
Correct |
105 ms |
147564 KB |
Output is correct |
110 |
Correct |
133 ms |
177812 KB |
Output is correct |
111 |
Correct |
174 ms |
229448 KB |
Output is correct |
112 |
Correct |
218 ms |
265324 KB |
Output is correct |
113 |
Correct |
151 ms |
157124 KB |
Output is correct |
114 |
Correct |
209 ms |
230672 KB |
Output is correct |
115 |
Correct |
121 ms |
125476 KB |
Output is correct |
116 |
Correct |
203 ms |
189844 KB |
Output is correct |
117 |
Correct |
156 ms |
168372 KB |
Output is correct |
118 |
Correct |
259 ms |
278484 KB |
Output is correct |
119 |
Correct |
145 ms |
153088 KB |
Output is correct |
120 |
Correct |
210 ms |
208580 KB |
Output is correct |
121 |
Correct |
274 ms |
163596 KB |
Output is correct |
122 |
Correct |
209 ms |
163268 KB |
Output is correct |
123 |
Correct |
115 ms |
109156 KB |
Output is correct |
124 |
Correct |
175 ms |
188732 KB |
Output is correct |
125 |
Correct |
162 ms |
174772 KB |
Output is correct |
126 |
Correct |
90 ms |
89500 KB |
Output is correct |
127 |
Correct |
199 ms |
210752 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
332 KB |
Output is correct |
2 |
Correct |
1 ms |
1996 KB |
Output is correct |
3 |
Correct |
1 ms |
2124 KB |
Output is correct |
4 |
Correct |
1 ms |
2076 KB |
Output is correct |
5 |
Correct |
1 ms |
1996 KB |
Output is correct |
6 |
Correct |
1 ms |
2124 KB |
Output is correct |
7 |
Correct |
1 ms |
1996 KB |
Output is correct |
8 |
Correct |
1 ms |
1996 KB |
Output is correct |
9 |
Correct |
1 ms |
1996 KB |
Output is correct |
10 |
Correct |
1 ms |
1996 KB |
Output is correct |
11 |
Correct |
1 ms |
1948 KB |
Output is correct |
12 |
Correct |
1 ms |
2080 KB |
Output is correct |
13 |
Correct |
1 ms |
1996 KB |
Output is correct |
14 |
Correct |
1 ms |
2124 KB |
Output is correct |
15 |
Correct |
1 ms |
2076 KB |
Output is correct |
16 |
Correct |
1 ms |
1948 KB |
Output is correct |
17 |
Correct |
1 ms |
1996 KB |
Output is correct |
18 |
Correct |
1 ms |
1996 KB |
Output is correct |
19 |
Correct |
1 ms |
1996 KB |
Output is correct |
20 |
Correct |
1 ms |
1996 KB |
Output is correct |
21 |
Correct |
2 ms |
1948 KB |
Output is correct |
22 |
Correct |
1 ms |
1996 KB |
Output is correct |
23 |
Correct |
1 ms |
2084 KB |
Output is correct |
24 |
Correct |
1 ms |
1996 KB |
Output is correct |
25 |
Correct |
1 ms |
1948 KB |
Output is correct |
26 |
Correct |
1 ms |
1996 KB |
Output is correct |
27 |
Correct |
1 ms |
1996 KB |
Output is correct |
28 |
Correct |
1 ms |
1996 KB |
Output is correct |
29 |
Correct |
1 ms |
1996 KB |
Output is correct |
30 |
Correct |
1 ms |
1996 KB |
Output is correct |
31 |
Correct |
1 ms |
1944 KB |
Output is correct |
32 |
Correct |
1 ms |
1996 KB |
Output is correct |
33 |
Correct |
1 ms |
1996 KB |
Output is correct |
34 |
Correct |
1 ms |
1996 KB |
Output is correct |
35 |
Correct |
1 ms |
1952 KB |
Output is correct |
36 |
Correct |
1 ms |
1996 KB |
Output is correct |
37 |
Correct |
1 ms |
2124 KB |
Output is correct |
38 |
Correct |
1 ms |
1996 KB |
Output is correct |
39 |
Correct |
1 ms |
1996 KB |
Output is correct |
40 |
Correct |
1 ms |
1996 KB |
Output is correct |
41 |
Correct |
1 ms |
1996 KB |
Output is correct |
42 |
Correct |
1 ms |
1952 KB |
Output is correct |
43 |
Correct |
1 ms |
1996 KB |
Output is correct |
44 |
Correct |
1 ms |
1996 KB |
Output is correct |
45 |
Correct |
2 ms |
1948 KB |
Output is correct |
46 |
Correct |
1 ms |
2080 KB |
Output is correct |
47 |
Correct |
1 ms |
2124 KB |
Output is correct |
48 |
Correct |
1 ms |
1996 KB |
Output is correct |
49 |
Correct |
1 ms |
1996 KB |
Output is correct |
50 |
Correct |
1 ms |
1996 KB |
Output is correct |
51 |
Correct |
1 ms |
2076 KB |
Output is correct |
52 |
Correct |
1 ms |
1996 KB |
Output is correct |
53 |
Correct |
1 ms |
1996 KB |
Output is correct |
54 |
Correct |
1 ms |
1996 KB |
Output is correct |
55 |
Correct |
1 ms |
1948 KB |
Output is correct |
56 |
Correct |
1 ms |
1996 KB |
Output is correct |
57 |
Correct |
1 ms |
1996 KB |
Output is correct |
58 |
Correct |
1 ms |
1996 KB |
Output is correct |
59 |
Correct |
0 ms |
332 KB |
Output is correct |
60 |
Correct |
28 ms |
43360 KB |
Output is correct |
61 |
Correct |
16 ms |
27456 KB |
Output is correct |
62 |
Correct |
31 ms |
44252 KB |
Output is correct |
63 |
Correct |
126 ms |
139972 KB |
Output is correct |
64 |
Correct |
388 ms |
503908 KB |
Output is correct |
65 |
Correct |
85 ms |
106820 KB |
Output is correct |
66 |
Correct |
79 ms |
87812 KB |
Output is correct |
67 |
Correct |
349 ms |
449824 KB |
Output is correct |
68 |
Correct |
42 ms |
61664 KB |
Output is correct |
69 |
Correct |
26 ms |
33984 KB |
Output is correct |
70 |
Correct |
208 ms |
144200 KB |
Output is correct |
71 |
Correct |
39 ms |
52988 KB |
Output is correct |
72 |
Correct |
51 ms |
67884 KB |
Output is correct |
73 |
Correct |
84 ms |
82300 KB |
Output is correct |
74 |
Correct |
219 ms |
232260 KB |
Output is correct |
75 |
Correct |
180 ms |
122424 KB |
Output is correct |
76 |
Correct |
174 ms |
169544 KB |
Output is correct |
77 |
Correct |
39 ms |
45636 KB |
Output is correct |
78 |
Correct |
63 ms |
50904 KB |
Output is correct |
79 |
Correct |
44 ms |
43332 KB |
Output is correct |
80 |
Correct |
151 ms |
156712 KB |
Output is correct |
81 |
Correct |
188 ms |
182680 KB |
Output is correct |
82 |
Correct |
189 ms |
140996 KB |
Output is correct |
83 |
Correct |
179 ms |
156584 KB |
Output is correct |
84 |
Correct |
147 ms |
131488 KB |
Output is correct |
85 |
Correct |
319 ms |
310348 KB |
Output is correct |
86 |
Correct |
192 ms |
109512 KB |
Output is correct |
87 |
Correct |
140 ms |
157604 KB |
Output is correct |
88 |
Correct |
148 ms |
154328 KB |
Output is correct |
89 |
Correct |
103 ms |
132292 KB |
Output is correct |
90 |
Correct |
42 ms |
47812 KB |
Output is correct |
91 |
Correct |
125 ms |
121924 KB |
Output is correct |
92 |
Correct |
216 ms |
207648 KB |
Output is correct |
93 |
Correct |
149 ms |
218044 KB |
Output is correct |
94 |
Correct |
74 ms |
87136 KB |
Output is correct |
95 |
Correct |
89 ms |
105032 KB |
Output is correct |
96 |
Correct |
48 ms |
55492 KB |
Output is correct |
97 |
Correct |
80 ms |
86208 KB |
Output is correct |
98 |
Correct |
101 ms |
108740 KB |
Output is correct |
99 |
Correct |
97 ms |
96324 KB |
Output is correct |
100 |
Correct |
204 ms |
155292 KB |
Output is correct |
101 |
Correct |
138 ms |
111440 KB |
Output is correct |
102 |
Correct |
175 ms |
206840 KB |
Output is correct |
103 |
Correct |
187 ms |
168876 KB |
Output is correct |
104 |
Correct |
147 ms |
187844 KB |
Output is correct |
105 |
Correct |
182 ms |
243960 KB |
Output is correct |
106 |
Correct |
101 ms |
89116 KB |
Output is correct |
107 |
Correct |
198 ms |
244936 KB |
Output is correct |
108 |
Correct |
105 ms |
140308 KB |
Output is correct |
109 |
Correct |
105 ms |
147564 KB |
Output is correct |
110 |
Correct |
133 ms |
177812 KB |
Output is correct |
111 |
Correct |
174 ms |
229448 KB |
Output is correct |
112 |
Correct |
218 ms |
265324 KB |
Output is correct |
113 |
Correct |
151 ms |
157124 KB |
Output is correct |
114 |
Correct |
209 ms |
230672 KB |
Output is correct |
115 |
Correct |
121 ms |
125476 KB |
Output is correct |
116 |
Correct |
203 ms |
189844 KB |
Output is correct |
117 |
Correct |
156 ms |
168372 KB |
Output is correct |
118 |
Correct |
259 ms |
278484 KB |
Output is correct |
119 |
Correct |
145 ms |
153088 KB |
Output is correct |
120 |
Correct |
210 ms |
208580 KB |
Output is correct |
121 |
Correct |
274 ms |
163596 KB |
Output is correct |
122 |
Correct |
209 ms |
163268 KB |
Output is correct |
123 |
Correct |
115 ms |
109156 KB |
Output is correct |
124 |
Correct |
175 ms |
188732 KB |
Output is correct |
125 |
Correct |
162 ms |
174772 KB |
Output is correct |
126 |
Correct |
90 ms |
89500 KB |
Output is correct |
127 |
Correct |
199 ms |
210752 KB |
Output is correct |
128 |
Correct |
0 ms |
340 KB |
Output is correct |
129 |
Runtime error |
16 ms |
300 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 |
1996 KB |
Output is correct |
3 |
Correct |
1 ms |
2124 KB |
Output is correct |
4 |
Correct |
1 ms |
2076 KB |
Output is correct |
5 |
Correct |
1 ms |
1996 KB |
Output is correct |
6 |
Correct |
1 ms |
2124 KB |
Output is correct |
7 |
Correct |
1 ms |
1996 KB |
Output is correct |
8 |
Correct |
1 ms |
1996 KB |
Output is correct |
9 |
Correct |
1 ms |
1996 KB |
Output is correct |
10 |
Correct |
1 ms |
1996 KB |
Output is correct |
11 |
Correct |
1 ms |
1948 KB |
Output is correct |
12 |
Correct |
1 ms |
2080 KB |
Output is correct |
13 |
Correct |
1 ms |
1996 KB |
Output is correct |
14 |
Correct |
1 ms |
2124 KB |
Output is correct |
15 |
Correct |
1 ms |
2076 KB |
Output is correct |
16 |
Correct |
1 ms |
1948 KB |
Output is correct |
17 |
Correct |
1 ms |
1996 KB |
Output is correct |
18 |
Correct |
1 ms |
1996 KB |
Output is correct |
19 |
Correct |
1 ms |
1996 KB |
Output is correct |
20 |
Correct |
1 ms |
1996 KB |
Output is correct |
21 |
Correct |
2 ms |
1948 KB |
Output is correct |
22 |
Correct |
1 ms |
1996 KB |
Output is correct |
23 |
Correct |
1 ms |
2084 KB |
Output is correct |
24 |
Correct |
1 ms |
1996 KB |
Output is correct |
25 |
Correct |
1 ms |
1948 KB |
Output is correct |
26 |
Correct |
1 ms |
1996 KB |
Output is correct |
27 |
Correct |
1 ms |
1996 KB |
Output is correct |
28 |
Correct |
1 ms |
1996 KB |
Output is correct |
29 |
Correct |
1 ms |
1996 KB |
Output is correct |
30 |
Correct |
1 ms |
1996 KB |
Output is correct |
31 |
Correct |
1 ms |
1944 KB |
Output is correct |
32 |
Correct |
1 ms |
1996 KB |
Output is correct |
33 |
Correct |
1 ms |
1996 KB |
Output is correct |
34 |
Correct |
1 ms |
1996 KB |
Output is correct |
35 |
Correct |
1 ms |
1952 KB |
Output is correct |
36 |
Correct |
1 ms |
1996 KB |
Output is correct |
37 |
Correct |
1 ms |
2124 KB |
Output is correct |
38 |
Correct |
1 ms |
1996 KB |
Output is correct |
39 |
Correct |
1 ms |
1996 KB |
Output is correct |
40 |
Correct |
1 ms |
1996 KB |
Output is correct |
41 |
Correct |
1 ms |
1996 KB |
Output is correct |
42 |
Correct |
1 ms |
1952 KB |
Output is correct |
43 |
Correct |
1 ms |
1996 KB |
Output is correct |
44 |
Correct |
1 ms |
1996 KB |
Output is correct |
45 |
Correct |
2 ms |
1948 KB |
Output is correct |
46 |
Correct |
1 ms |
2080 KB |
Output is correct |
47 |
Correct |
1 ms |
2124 KB |
Output is correct |
48 |
Correct |
1 ms |
1996 KB |
Output is correct |
49 |
Correct |
1 ms |
1996 KB |
Output is correct |
50 |
Correct |
1 ms |
1996 KB |
Output is correct |
51 |
Correct |
1 ms |
2076 KB |
Output is correct |
52 |
Correct |
1 ms |
1996 KB |
Output is correct |
53 |
Correct |
1 ms |
1996 KB |
Output is correct |
54 |
Correct |
1 ms |
1996 KB |
Output is correct |
55 |
Correct |
1 ms |
1948 KB |
Output is correct |
56 |
Correct |
1 ms |
1996 KB |
Output is correct |
57 |
Correct |
1 ms |
1996 KB |
Output is correct |
58 |
Correct |
1 ms |
1996 KB |
Output is correct |
59 |
Correct |
0 ms |
332 KB |
Output is correct |
60 |
Correct |
28 ms |
43360 KB |
Output is correct |
61 |
Correct |
16 ms |
27456 KB |
Output is correct |
62 |
Correct |
31 ms |
44252 KB |
Output is correct |
63 |
Correct |
126 ms |
139972 KB |
Output is correct |
64 |
Correct |
388 ms |
503908 KB |
Output is correct |
65 |
Correct |
85 ms |
106820 KB |
Output is correct |
66 |
Correct |
79 ms |
87812 KB |
Output is correct |
67 |
Correct |
349 ms |
449824 KB |
Output is correct |
68 |
Correct |
42 ms |
61664 KB |
Output is correct |
69 |
Correct |
26 ms |
33984 KB |
Output is correct |
70 |
Correct |
208 ms |
144200 KB |
Output is correct |
71 |
Correct |
39 ms |
52988 KB |
Output is correct |
72 |
Correct |
51 ms |
67884 KB |
Output is correct |
73 |
Correct |
84 ms |
82300 KB |
Output is correct |
74 |
Correct |
219 ms |
232260 KB |
Output is correct |
75 |
Correct |
180 ms |
122424 KB |
Output is correct |
76 |
Correct |
174 ms |
169544 KB |
Output is correct |
77 |
Correct |
39 ms |
45636 KB |
Output is correct |
78 |
Correct |
63 ms |
50904 KB |
Output is correct |
79 |
Correct |
44 ms |
43332 KB |
Output is correct |
80 |
Correct |
151 ms |
156712 KB |
Output is correct |
81 |
Correct |
188 ms |
182680 KB |
Output is correct |
82 |
Correct |
189 ms |
140996 KB |
Output is correct |
83 |
Correct |
179 ms |
156584 KB |
Output is correct |
84 |
Correct |
147 ms |
131488 KB |
Output is correct |
85 |
Correct |
319 ms |
310348 KB |
Output is correct |
86 |
Correct |
192 ms |
109512 KB |
Output is correct |
87 |
Correct |
140 ms |
157604 KB |
Output is correct |
88 |
Correct |
148 ms |
154328 KB |
Output is correct |
89 |
Correct |
103 ms |
132292 KB |
Output is correct |
90 |
Correct |
42 ms |
47812 KB |
Output is correct |
91 |
Correct |
125 ms |
121924 KB |
Output is correct |
92 |
Correct |
216 ms |
207648 KB |
Output is correct |
93 |
Correct |
149 ms |
218044 KB |
Output is correct |
94 |
Correct |
74 ms |
87136 KB |
Output is correct |
95 |
Correct |
89 ms |
105032 KB |
Output is correct |
96 |
Correct |
48 ms |
55492 KB |
Output is correct |
97 |
Correct |
80 ms |
86208 KB |
Output is correct |
98 |
Correct |
101 ms |
108740 KB |
Output is correct |
99 |
Correct |
97 ms |
96324 KB |
Output is correct |
100 |
Correct |
204 ms |
155292 KB |
Output is correct |
101 |
Correct |
138 ms |
111440 KB |
Output is correct |
102 |
Correct |
175 ms |
206840 KB |
Output is correct |
103 |
Correct |
187 ms |
168876 KB |
Output is correct |
104 |
Correct |
147 ms |
187844 KB |
Output is correct |
105 |
Correct |
182 ms |
243960 KB |
Output is correct |
106 |
Correct |
101 ms |
89116 KB |
Output is correct |
107 |
Correct |
198 ms |
244936 KB |
Output is correct |
108 |
Correct |
105 ms |
140308 KB |
Output is correct |
109 |
Correct |
105 ms |
147564 KB |
Output is correct |
110 |
Correct |
133 ms |
177812 KB |
Output is correct |
111 |
Correct |
174 ms |
229448 KB |
Output is correct |
112 |
Correct |
218 ms |
265324 KB |
Output is correct |
113 |
Correct |
151 ms |
157124 KB |
Output is correct |
114 |
Correct |
209 ms |
230672 KB |
Output is correct |
115 |
Correct |
121 ms |
125476 KB |
Output is correct |
116 |
Correct |
203 ms |
189844 KB |
Output is correct |
117 |
Correct |
156 ms |
168372 KB |
Output is correct |
118 |
Correct |
259 ms |
278484 KB |
Output is correct |
119 |
Correct |
145 ms |
153088 KB |
Output is correct |
120 |
Correct |
210 ms |
208580 KB |
Output is correct |
121 |
Correct |
274 ms |
163596 KB |
Output is correct |
122 |
Correct |
209 ms |
163268 KB |
Output is correct |
123 |
Correct |
115 ms |
109156 KB |
Output is correct |
124 |
Correct |
175 ms |
188732 KB |
Output is correct |
125 |
Correct |
162 ms |
174772 KB |
Output is correct |
126 |
Correct |
90 ms |
89500 KB |
Output is correct |
127 |
Correct |
199 ms |
210752 KB |
Output is correct |
128 |
Correct |
0 ms |
340 KB |
Output is correct |
129 |
Runtime error |
16 ms |
300 KB |
Execution killed with signal 11 |
130 |
Halted |
0 ms |
0 KB |
- |