/*
Mayoeba Yabureru
*/
//#include "closing.h"
#include<bits/stdc++.h>
using namespace std;
long long dp[3003][6003][2][2];
int max_score(int n, int x, int y, long long k, vector<int> U, vector<int> V, vector<int> W) {
x ++, y ++;
vector dis(n + 1, vector<long long>(2));
vector<vector<pair<int, long long>>> gr(n + 1);
for (int i = 0; i < n - 1; i ++) {
int u = U[i] + 1, v = V[i] + 1, w = W[i];
gr[u].push_back({v, w});
gr[v].push_back({u, w});
}
function<void(int, int, int)> dfs = [&] (int v, int p, int wt) {
for (auto [u, w] : gr[v]) {
if (u == p) continue;
dis[u][wt] = dis[v][wt] + w;
dfs(u, v, wt);
}
};
dfs(x, 0, 0), dfs(y, 0, 1);
vector<int> vc, path, onpath(n + 1);
function<void(int, int)> go = [&] (int v, int p) {
vc.push_back(v);
if (v == y) path = vc;
for (auto [u, w] : gr[v]) {
if (u == p) continue;
go(u, v);
}
vc.pop_back();
};
go(x, 0);
long long minstart = 0, mn = 1e15;
for (int i = 1; i <= n; i ++) {
if (max(dis[i][0], dis[i][1]) < mn) {
minstart = i;
mn = max(dis[i][0], dis[i][1]);
}
}
for (auto x : path) {
onpath[x] += 1;
if (x == minstart) break;
}
for (int i = path.size() - 1; i >= 0; i --) {
int x = path[i];
onpath[x] += 2;
if (x == minstart) break;
}
int ans = 0;
function f = [&] {
vector<int> did(n + 1);
multiset<pair<long long, int>> s;
for (int i = 1; i <= n; i ++) {
s.insert({dis[i][0], i});
s.insert({dis[i][1], i});
}
int cnt = 0;
vector<int> v;
while (s.size()) {
auto [x, y] = *s.begin();
s.erase(s.begin());
if (did[y]) continue;
if (x > k) break;
k -= x;
did[y] = 1;
cnt ++;
}
if (k >= 0) return cnt;
return -100000000;
};
long long kk = k;
ans = f();
if (n > 3000) return ans;
k = kk;
for (int i = 1; i <= n; i ++) {
for (int j = 0; j <= 2 * n; j ++) {
dp[i][j][0][0] = dp[i][j][0][1] = dp[i][j][1][0] = dp[i][j][1][1] = 1e16;
}
}
vector dpp(2 * (n + 1), vector (2, vector<long long>(2, 1e16)));
vector<int> siz(n + 1);
function<void(int, int)> calcsiz = [&] (int x, int p) {
siz[x] = 1;
for (auto [u, w] : gr[x]) {
if (u == p) continue;
calcsiz(u, x);
siz[x] += siz[u];
}
};
calcsiz(minstart, 0);
map<vector<int>, int> did;
function<void(int, int, int, int)> calc = [&] (int x, int p, int rx, int ry) {
if (did[{x, rx, ry}]) return;
did[{x, rx, ry}] = 1;
if (rx == 0 && ry == 0) dp[x][0][rx][ry] = 0;
if (rx && ry == 0) dp[x][1][rx][ry] = min(dp[x][1][rx][ry], dis[x][0]);
if (ry && rx == 0) dp[x][1][rx][ry] = min(dp[x][1][rx][ry], dis[x][1]);
if (rx && ry) dp[x][2][rx][ry] = min(dp[x][2][rx][ry], max(dis[x][0], dis[x][1]));
int sumsiz = 1;
for (auto [u, w] : gr[x]) {
if (u == p) continue;
calc(u, x, rx, ry);
if (rx && ry) {
if (onpath[u] == 0) calc(u, x, 0, 0);
if (onpath[u] != 1) calc(u, x, 0, 1);
if (onpath[u] != 2) calc(u, x, 1, 0);
}
else if (rx && onpath[u] != 1) calc(u, x, 0, ry);
else if (ry && onpath[u] != 2) calc(u, x, rx, 0);
for (int i = 0; i <= rx; i ++) {
for (int j = 0; j <= ry; j ++) {
for (int z = 2 * siz[u]; z >= 0; z --) {
for (int k = 2 * sumsiz; k >= 0; k --) {
dpp[k + z][rx][ry] = min(dpp[k + z][rx][ry], dp[x][k][rx][ry] + dp[u][z][i][j]);
}
}
}
}
sumsiz += siz[u];
for (int z = 0; z <= 2 * sumsiz; z ++) {
dp[x][z][rx][ry] = dpp[z][rx][ry];
dpp[z][rx][ry] = 1e16;
}
}
};
calc(minstart, 0, 1, 1);
for (int i = 0; i <= 2 * n; i ++) {
if (k >= dp[minstart][i][1][1]) ans = max(ans, i);
}
return ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
4444 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
277 ms |
71240 KB |
Output is correct |
2 |
Correct |
338 ms |
80572 KB |
Output is correct |
3 |
Execution timed out |
1035 ms |
197184 KB |
Time limit exceeded |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
4440 KB |
Output is correct |
2 |
Correct |
1 ms |
6492 KB |
Output is correct |
3 |
Correct |
1 ms |
6492 KB |
Output is correct |
4 |
Correct |
1 ms |
6492 KB |
Output is correct |
5 |
Correct |
1 ms |
6492 KB |
Output is correct |
6 |
Correct |
2 ms |
12636 KB |
Output is correct |
7 |
Correct |
2 ms |
12632 KB |
Output is correct |
8 |
Correct |
1 ms |
12636 KB |
Output is correct |
9 |
Correct |
2 ms |
12636 KB |
Output is correct |
10 |
Correct |
2 ms |
12636 KB |
Output is correct |
11 |
Correct |
2 ms |
12636 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
4440 KB |
Output is correct |
2 |
Correct |
1 ms |
6492 KB |
Output is correct |
3 |
Correct |
1 ms |
6492 KB |
Output is correct |
4 |
Correct |
1 ms |
6492 KB |
Output is correct |
5 |
Correct |
1 ms |
6492 KB |
Output is correct |
6 |
Correct |
2 ms |
12636 KB |
Output is correct |
7 |
Correct |
2 ms |
12632 KB |
Output is correct |
8 |
Correct |
1 ms |
12636 KB |
Output is correct |
9 |
Correct |
2 ms |
12636 KB |
Output is correct |
10 |
Correct |
2 ms |
12636 KB |
Output is correct |
11 |
Correct |
2 ms |
12636 KB |
Output is correct |
12 |
Correct |
3 ms |
22876 KB |
Output is correct |
13 |
Correct |
3 ms |
20824 KB |
Output is correct |
14 |
Correct |
2 ms |
20828 KB |
Output is correct |
15 |
Correct |
3 ms |
20824 KB |
Output is correct |
16 |
Correct |
3 ms |
22876 KB |
Output is correct |
17 |
Correct |
3 ms |
22876 KB |
Output is correct |
18 |
Correct |
2 ms |
6492 KB |
Output is correct |
19 |
Correct |
21 ms |
97288 KB |
Output is correct |
20 |
Correct |
23 ms |
89180 KB |
Output is correct |
21 |
Correct |
16 ms |
93132 KB |
Output is correct |
22 |
Correct |
20 ms |
97372 KB |
Output is correct |
23 |
Correct |
16 ms |
97116 KB |
Output is correct |
24 |
Correct |
20 ms |
97116 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
4440 KB |
Output is correct |
2 |
Correct |
1 ms |
6492 KB |
Output is correct |
3 |
Correct |
1 ms |
6492 KB |
Output is correct |
4 |
Correct |
1 ms |
6492 KB |
Output is correct |
5 |
Correct |
1 ms |
6492 KB |
Output is correct |
6 |
Correct |
2 ms |
12636 KB |
Output is correct |
7 |
Correct |
2 ms |
12632 KB |
Output is correct |
8 |
Correct |
1 ms |
12636 KB |
Output is correct |
9 |
Correct |
2 ms |
12636 KB |
Output is correct |
10 |
Correct |
2 ms |
12636 KB |
Output is correct |
11 |
Correct |
2 ms |
12636 KB |
Output is correct |
12 |
Correct |
3 ms |
22876 KB |
Output is correct |
13 |
Correct |
3 ms |
20824 KB |
Output is correct |
14 |
Correct |
2 ms |
20828 KB |
Output is correct |
15 |
Correct |
3 ms |
20824 KB |
Output is correct |
16 |
Correct |
3 ms |
22876 KB |
Output is correct |
17 |
Correct |
3 ms |
22876 KB |
Output is correct |
18 |
Correct |
2 ms |
6492 KB |
Output is correct |
19 |
Correct |
21 ms |
97288 KB |
Output is correct |
20 |
Correct |
23 ms |
89180 KB |
Output is correct |
21 |
Correct |
16 ms |
93132 KB |
Output is correct |
22 |
Correct |
20 ms |
97372 KB |
Output is correct |
23 |
Correct |
16 ms |
97116 KB |
Output is correct |
24 |
Correct |
20 ms |
97116 KB |
Output is correct |
25 |
Correct |
11 ms |
12636 KB |
Output is correct |
26 |
Correct |
546 ms |
567932 KB |
Output is correct |
27 |
Correct |
464 ms |
513620 KB |
Output is correct |
28 |
Correct |
359 ms |
518740 KB |
Output is correct |
29 |
Correct |
398 ms |
552184 KB |
Output is correct |
30 |
Correct |
421 ms |
509780 KB |
Output is correct |
31 |
Correct |
406 ms |
567268 KB |
Output is correct |
32 |
Correct |
411 ms |
567120 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
4444 KB |
Output is correct |
2 |
Correct |
1 ms |
4440 KB |
Output is correct |
3 |
Correct |
1 ms |
6492 KB |
Output is correct |
4 |
Correct |
1 ms |
6492 KB |
Output is correct |
5 |
Correct |
1 ms |
6492 KB |
Output is correct |
6 |
Correct |
1 ms |
6492 KB |
Output is correct |
7 |
Correct |
1 ms |
4440 KB |
Output is correct |
8 |
Correct |
1 ms |
4444 KB |
Output is correct |
9 |
Correct |
1 ms |
4444 KB |
Output is correct |
10 |
Correct |
1 ms |
6492 KB |
Output is correct |
11 |
Correct |
1 ms |
6492 KB |
Output is correct |
12 |
Correct |
1 ms |
6492 KB |
Output is correct |
13 |
Correct |
1 ms |
6492 KB |
Output is correct |
14 |
Correct |
1 ms |
6492 KB |
Output is correct |
15 |
Correct |
1 ms |
6492 KB |
Output is correct |
16 |
Correct |
1 ms |
6492 KB |
Output is correct |
17 |
Correct |
1 ms |
6492 KB |
Output is correct |
18 |
Correct |
1 ms |
6492 KB |
Output is correct |
19 |
Correct |
1 ms |
6492 KB |
Output is correct |
20 |
Correct |
1 ms |
6488 KB |
Output is correct |
21 |
Correct |
1 ms |
6492 KB |
Output is correct |
22 |
Correct |
1 ms |
6492 KB |
Output is correct |
23 |
Correct |
1 ms |
6492 KB |
Output is correct |
24 |
Correct |
1 ms |
6488 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
4444 KB |
Output is correct |
2 |
Correct |
1 ms |
4440 KB |
Output is correct |
3 |
Correct |
1 ms |
6492 KB |
Output is correct |
4 |
Correct |
1 ms |
6492 KB |
Output is correct |
5 |
Correct |
1 ms |
6492 KB |
Output is correct |
6 |
Correct |
1 ms |
6492 KB |
Output is correct |
7 |
Correct |
2 ms |
12636 KB |
Output is correct |
8 |
Correct |
2 ms |
12632 KB |
Output is correct |
9 |
Correct |
1 ms |
12636 KB |
Output is correct |
10 |
Correct |
2 ms |
12636 KB |
Output is correct |
11 |
Correct |
2 ms |
12636 KB |
Output is correct |
12 |
Correct |
2 ms |
12636 KB |
Output is correct |
13 |
Correct |
3 ms |
22876 KB |
Output is correct |
14 |
Correct |
3 ms |
20824 KB |
Output is correct |
15 |
Correct |
2 ms |
20828 KB |
Output is correct |
16 |
Correct |
3 ms |
20824 KB |
Output is correct |
17 |
Correct |
3 ms |
22876 KB |
Output is correct |
18 |
Correct |
3 ms |
22876 KB |
Output is correct |
19 |
Correct |
1 ms |
4440 KB |
Output is correct |
20 |
Correct |
1 ms |
4444 KB |
Output is correct |
21 |
Correct |
1 ms |
4444 KB |
Output is correct |
22 |
Correct |
1 ms |
6492 KB |
Output is correct |
23 |
Correct |
1 ms |
6492 KB |
Output is correct |
24 |
Correct |
1 ms |
6492 KB |
Output is correct |
25 |
Correct |
1 ms |
6492 KB |
Output is correct |
26 |
Correct |
1 ms |
6492 KB |
Output is correct |
27 |
Correct |
1 ms |
6492 KB |
Output is correct |
28 |
Correct |
1 ms |
6492 KB |
Output is correct |
29 |
Correct |
1 ms |
6492 KB |
Output is correct |
30 |
Correct |
1 ms |
6492 KB |
Output is correct |
31 |
Correct |
1 ms |
6492 KB |
Output is correct |
32 |
Correct |
1 ms |
6488 KB |
Output is correct |
33 |
Correct |
1 ms |
6492 KB |
Output is correct |
34 |
Correct |
1 ms |
6492 KB |
Output is correct |
35 |
Correct |
1 ms |
6492 KB |
Output is correct |
36 |
Correct |
1 ms |
6488 KB |
Output is correct |
37 |
Correct |
1 ms |
6492 KB |
Output is correct |
38 |
Correct |
1 ms |
10588 KB |
Output is correct |
39 |
Correct |
3 ms |
22876 KB |
Output is correct |
40 |
Correct |
3 ms |
20824 KB |
Output is correct |
41 |
Correct |
3 ms |
22872 KB |
Output is correct |
42 |
Correct |
3 ms |
20828 KB |
Output is correct |
43 |
Correct |
2 ms |
20828 KB |
Output is correct |
44 |
Correct |
2 ms |
20880 KB |
Output is correct |
45 |
Correct |
3 ms |
22872 KB |
Output is correct |
46 |
Correct |
3 ms |
20828 KB |
Output is correct |
47 |
Correct |
3 ms |
22876 KB |
Output is correct |
48 |
Correct |
2 ms |
18780 KB |
Output is correct |
49 |
Correct |
2 ms |
14684 KB |
Output is correct |
50 |
Correct |
1 ms |
8540 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
4444 KB |
Output is correct |
2 |
Correct |
1 ms |
4440 KB |
Output is correct |
3 |
Correct |
1 ms |
6492 KB |
Output is correct |
4 |
Correct |
1 ms |
6492 KB |
Output is correct |
5 |
Correct |
1 ms |
6492 KB |
Output is correct |
6 |
Correct |
1 ms |
6492 KB |
Output is correct |
7 |
Correct |
2 ms |
12636 KB |
Output is correct |
8 |
Correct |
2 ms |
12632 KB |
Output is correct |
9 |
Correct |
1 ms |
12636 KB |
Output is correct |
10 |
Correct |
2 ms |
12636 KB |
Output is correct |
11 |
Correct |
2 ms |
12636 KB |
Output is correct |
12 |
Correct |
2 ms |
12636 KB |
Output is correct |
13 |
Correct |
3 ms |
22876 KB |
Output is correct |
14 |
Correct |
3 ms |
20824 KB |
Output is correct |
15 |
Correct |
2 ms |
20828 KB |
Output is correct |
16 |
Correct |
3 ms |
20824 KB |
Output is correct |
17 |
Correct |
3 ms |
22876 KB |
Output is correct |
18 |
Correct |
3 ms |
22876 KB |
Output is correct |
19 |
Correct |
2 ms |
6492 KB |
Output is correct |
20 |
Correct |
21 ms |
97288 KB |
Output is correct |
21 |
Correct |
23 ms |
89180 KB |
Output is correct |
22 |
Correct |
16 ms |
93132 KB |
Output is correct |
23 |
Correct |
20 ms |
97372 KB |
Output is correct |
24 |
Correct |
16 ms |
97116 KB |
Output is correct |
25 |
Correct |
20 ms |
97116 KB |
Output is correct |
26 |
Correct |
1 ms |
4440 KB |
Output is correct |
27 |
Correct |
1 ms |
4444 KB |
Output is correct |
28 |
Correct |
1 ms |
4444 KB |
Output is correct |
29 |
Correct |
1 ms |
6492 KB |
Output is correct |
30 |
Correct |
1 ms |
6492 KB |
Output is correct |
31 |
Correct |
1 ms |
6492 KB |
Output is correct |
32 |
Correct |
1 ms |
6492 KB |
Output is correct |
33 |
Correct |
1 ms |
6492 KB |
Output is correct |
34 |
Correct |
1 ms |
6492 KB |
Output is correct |
35 |
Correct |
1 ms |
6492 KB |
Output is correct |
36 |
Correct |
1 ms |
6492 KB |
Output is correct |
37 |
Correct |
1 ms |
6492 KB |
Output is correct |
38 |
Correct |
1 ms |
6492 KB |
Output is correct |
39 |
Correct |
1 ms |
6488 KB |
Output is correct |
40 |
Correct |
1 ms |
6492 KB |
Output is correct |
41 |
Correct |
1 ms |
6492 KB |
Output is correct |
42 |
Correct |
1 ms |
6492 KB |
Output is correct |
43 |
Correct |
1 ms |
6488 KB |
Output is correct |
44 |
Correct |
1 ms |
6492 KB |
Output is correct |
45 |
Correct |
1 ms |
10588 KB |
Output is correct |
46 |
Correct |
3 ms |
22876 KB |
Output is correct |
47 |
Correct |
3 ms |
20824 KB |
Output is correct |
48 |
Correct |
3 ms |
22872 KB |
Output is correct |
49 |
Correct |
3 ms |
20828 KB |
Output is correct |
50 |
Correct |
2 ms |
20828 KB |
Output is correct |
51 |
Correct |
2 ms |
20880 KB |
Output is correct |
52 |
Correct |
3 ms |
22872 KB |
Output is correct |
53 |
Correct |
3 ms |
20828 KB |
Output is correct |
54 |
Correct |
3 ms |
22876 KB |
Output is correct |
55 |
Correct |
2 ms |
18780 KB |
Output is correct |
56 |
Correct |
2 ms |
14684 KB |
Output is correct |
57 |
Correct |
1 ms |
8540 KB |
Output is correct |
58 |
Correct |
2 ms |
8540 KB |
Output is correct |
59 |
Correct |
5 ms |
20828 KB |
Output is correct |
60 |
Correct |
5 ms |
22876 KB |
Output is correct |
61 |
Correct |
6 ms |
31196 KB |
Output is correct |
62 |
Correct |
6 ms |
31324 KB |
Output is correct |
63 |
Correct |
18 ms |
97112 KB |
Output is correct |
64 |
Correct |
18 ms |
91080 KB |
Output is correct |
65 |
Correct |
15 ms |
89048 KB |
Output is correct |
66 |
Correct |
16 ms |
90972 KB |
Output is correct |
67 |
Correct |
20 ms |
97116 KB |
Output is correct |
68 |
Correct |
19 ms |
88924 KB |
Output is correct |
69 |
Correct |
16 ms |
97116 KB |
Output is correct |
70 |
Correct |
18 ms |
93200 KB |
Output is correct |
71 |
Correct |
17 ms |
93020 KB |
Output is correct |
72 |
Correct |
17 ms |
95052 KB |
Output is correct |
73 |
Correct |
15 ms |
76616 KB |
Output is correct |
74 |
Correct |
14 ms |
80728 KB |
Output is correct |
75 |
Correct |
6 ms |
22896 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
4444 KB |
Output is correct |
2 |
Correct |
1 ms |
4440 KB |
Output is correct |
3 |
Correct |
1 ms |
6492 KB |
Output is correct |
4 |
Correct |
1 ms |
6492 KB |
Output is correct |
5 |
Correct |
1 ms |
6492 KB |
Output is correct |
6 |
Correct |
1 ms |
6492 KB |
Output is correct |
7 |
Correct |
2 ms |
12636 KB |
Output is correct |
8 |
Correct |
2 ms |
12632 KB |
Output is correct |
9 |
Correct |
1 ms |
12636 KB |
Output is correct |
10 |
Correct |
2 ms |
12636 KB |
Output is correct |
11 |
Correct |
2 ms |
12636 KB |
Output is correct |
12 |
Correct |
2 ms |
12636 KB |
Output is correct |
13 |
Correct |
3 ms |
22876 KB |
Output is correct |
14 |
Correct |
3 ms |
20824 KB |
Output is correct |
15 |
Correct |
2 ms |
20828 KB |
Output is correct |
16 |
Correct |
3 ms |
20824 KB |
Output is correct |
17 |
Correct |
3 ms |
22876 KB |
Output is correct |
18 |
Correct |
3 ms |
22876 KB |
Output is correct |
19 |
Correct |
2 ms |
6492 KB |
Output is correct |
20 |
Correct |
21 ms |
97288 KB |
Output is correct |
21 |
Correct |
23 ms |
89180 KB |
Output is correct |
22 |
Correct |
16 ms |
93132 KB |
Output is correct |
23 |
Correct |
20 ms |
97372 KB |
Output is correct |
24 |
Correct |
16 ms |
97116 KB |
Output is correct |
25 |
Correct |
20 ms |
97116 KB |
Output is correct |
26 |
Correct |
11 ms |
12636 KB |
Output is correct |
27 |
Correct |
546 ms |
567932 KB |
Output is correct |
28 |
Correct |
464 ms |
513620 KB |
Output is correct |
29 |
Correct |
359 ms |
518740 KB |
Output is correct |
30 |
Correct |
398 ms |
552184 KB |
Output is correct |
31 |
Correct |
421 ms |
509780 KB |
Output is correct |
32 |
Correct |
406 ms |
567268 KB |
Output is correct |
33 |
Correct |
411 ms |
567120 KB |
Output is correct |
34 |
Correct |
1 ms |
4440 KB |
Output is correct |
35 |
Correct |
1 ms |
4444 KB |
Output is correct |
36 |
Correct |
1 ms |
4444 KB |
Output is correct |
37 |
Correct |
1 ms |
6492 KB |
Output is correct |
38 |
Correct |
1 ms |
6492 KB |
Output is correct |
39 |
Correct |
1 ms |
6492 KB |
Output is correct |
40 |
Correct |
1 ms |
6492 KB |
Output is correct |
41 |
Correct |
1 ms |
6492 KB |
Output is correct |
42 |
Correct |
1 ms |
6492 KB |
Output is correct |
43 |
Correct |
1 ms |
6492 KB |
Output is correct |
44 |
Correct |
1 ms |
6492 KB |
Output is correct |
45 |
Correct |
1 ms |
6492 KB |
Output is correct |
46 |
Correct |
1 ms |
6492 KB |
Output is correct |
47 |
Correct |
1 ms |
6488 KB |
Output is correct |
48 |
Correct |
1 ms |
6492 KB |
Output is correct |
49 |
Correct |
1 ms |
6492 KB |
Output is correct |
50 |
Correct |
1 ms |
6492 KB |
Output is correct |
51 |
Correct |
1 ms |
6488 KB |
Output is correct |
52 |
Correct |
1 ms |
6492 KB |
Output is correct |
53 |
Correct |
1 ms |
10588 KB |
Output is correct |
54 |
Correct |
3 ms |
22876 KB |
Output is correct |
55 |
Correct |
3 ms |
20824 KB |
Output is correct |
56 |
Correct |
3 ms |
22872 KB |
Output is correct |
57 |
Correct |
3 ms |
20828 KB |
Output is correct |
58 |
Correct |
2 ms |
20828 KB |
Output is correct |
59 |
Correct |
2 ms |
20880 KB |
Output is correct |
60 |
Correct |
3 ms |
22872 KB |
Output is correct |
61 |
Correct |
3 ms |
20828 KB |
Output is correct |
62 |
Correct |
3 ms |
22876 KB |
Output is correct |
63 |
Correct |
2 ms |
18780 KB |
Output is correct |
64 |
Correct |
2 ms |
14684 KB |
Output is correct |
65 |
Correct |
1 ms |
8540 KB |
Output is correct |
66 |
Correct |
2 ms |
8540 KB |
Output is correct |
67 |
Correct |
5 ms |
20828 KB |
Output is correct |
68 |
Correct |
5 ms |
22876 KB |
Output is correct |
69 |
Correct |
6 ms |
31196 KB |
Output is correct |
70 |
Correct |
6 ms |
31324 KB |
Output is correct |
71 |
Correct |
18 ms |
97112 KB |
Output is correct |
72 |
Correct |
18 ms |
91080 KB |
Output is correct |
73 |
Correct |
15 ms |
89048 KB |
Output is correct |
74 |
Correct |
16 ms |
90972 KB |
Output is correct |
75 |
Correct |
20 ms |
97116 KB |
Output is correct |
76 |
Correct |
19 ms |
88924 KB |
Output is correct |
77 |
Correct |
16 ms |
97116 KB |
Output is correct |
78 |
Correct |
18 ms |
93200 KB |
Output is correct |
79 |
Correct |
17 ms |
93020 KB |
Output is correct |
80 |
Correct |
17 ms |
95052 KB |
Output is correct |
81 |
Correct |
15 ms |
76616 KB |
Output is correct |
82 |
Correct |
14 ms |
80728 KB |
Output is correct |
83 |
Correct |
6 ms |
22896 KB |
Output is correct |
84 |
Correct |
11 ms |
12860 KB |
Output is correct |
85 |
Correct |
34 ms |
55908 KB |
Output is correct |
86 |
Correct |
21 ms |
23132 KB |
Output is correct |
87 |
Correct |
24 ms |
31408 KB |
Output is correct |
88 |
Correct |
24 ms |
31200 KB |
Output is correct |
89 |
Correct |
530 ms |
567376 KB |
Output is correct |
90 |
Correct |
429 ms |
492568 KB |
Output is correct |
91 |
Correct |
447 ms |
566240 KB |
Output is correct |
92 |
Correct |
445 ms |
510544 KB |
Output is correct |
93 |
Correct |
369 ms |
519404 KB |
Output is correct |
94 |
Correct |
406 ms |
531548 KB |
Output is correct |
95 |
Correct |
419 ms |
553364 KB |
Output is correct |
96 |
Correct |
351 ms |
498004 KB |
Output is correct |
97 |
Correct |
376 ms |
551252 KB |
Output is correct |
98 |
Correct |
344 ms |
539176 KB |
Output is correct |
99 |
Correct |
631 ms |
567316 KB |
Output is correct |
100 |
Correct |
219 ms |
342352 KB |
Output is correct |
101 |
Correct |
54 ms |
97360 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
4444 KB |
Output is correct |
2 |
Correct |
1 ms |
4440 KB |
Output is correct |
3 |
Correct |
1 ms |
6492 KB |
Output is correct |
4 |
Correct |
1 ms |
6492 KB |
Output is correct |
5 |
Correct |
1 ms |
6492 KB |
Output is correct |
6 |
Correct |
1 ms |
6492 KB |
Output is correct |
7 |
Correct |
2 ms |
12636 KB |
Output is correct |
8 |
Correct |
2 ms |
12632 KB |
Output is correct |
9 |
Correct |
1 ms |
12636 KB |
Output is correct |
10 |
Correct |
2 ms |
12636 KB |
Output is correct |
11 |
Correct |
2 ms |
12636 KB |
Output is correct |
12 |
Correct |
2 ms |
12636 KB |
Output is correct |
13 |
Correct |
3 ms |
22876 KB |
Output is correct |
14 |
Correct |
3 ms |
20824 KB |
Output is correct |
15 |
Correct |
2 ms |
20828 KB |
Output is correct |
16 |
Correct |
3 ms |
20824 KB |
Output is correct |
17 |
Correct |
3 ms |
22876 KB |
Output is correct |
18 |
Correct |
3 ms |
22876 KB |
Output is correct |
19 |
Correct |
2 ms |
6492 KB |
Output is correct |
20 |
Correct |
21 ms |
97288 KB |
Output is correct |
21 |
Correct |
23 ms |
89180 KB |
Output is correct |
22 |
Correct |
16 ms |
93132 KB |
Output is correct |
23 |
Correct |
20 ms |
97372 KB |
Output is correct |
24 |
Correct |
16 ms |
97116 KB |
Output is correct |
25 |
Correct |
20 ms |
97116 KB |
Output is correct |
26 |
Correct |
11 ms |
12636 KB |
Output is correct |
27 |
Correct |
546 ms |
567932 KB |
Output is correct |
28 |
Correct |
464 ms |
513620 KB |
Output is correct |
29 |
Correct |
359 ms |
518740 KB |
Output is correct |
30 |
Correct |
398 ms |
552184 KB |
Output is correct |
31 |
Correct |
421 ms |
509780 KB |
Output is correct |
32 |
Correct |
406 ms |
567268 KB |
Output is correct |
33 |
Correct |
411 ms |
567120 KB |
Output is correct |
34 |
Correct |
1 ms |
4440 KB |
Output is correct |
35 |
Correct |
1 ms |
4444 KB |
Output is correct |
36 |
Correct |
1 ms |
4444 KB |
Output is correct |
37 |
Correct |
1 ms |
6492 KB |
Output is correct |
38 |
Correct |
1 ms |
6492 KB |
Output is correct |
39 |
Correct |
1 ms |
6492 KB |
Output is correct |
40 |
Correct |
1 ms |
6492 KB |
Output is correct |
41 |
Correct |
1 ms |
6492 KB |
Output is correct |
42 |
Correct |
1 ms |
6492 KB |
Output is correct |
43 |
Correct |
1 ms |
6492 KB |
Output is correct |
44 |
Correct |
1 ms |
6492 KB |
Output is correct |
45 |
Correct |
1 ms |
6492 KB |
Output is correct |
46 |
Correct |
1 ms |
6492 KB |
Output is correct |
47 |
Correct |
1 ms |
6488 KB |
Output is correct |
48 |
Correct |
1 ms |
6492 KB |
Output is correct |
49 |
Correct |
1 ms |
6492 KB |
Output is correct |
50 |
Correct |
1 ms |
6492 KB |
Output is correct |
51 |
Correct |
1 ms |
6488 KB |
Output is correct |
52 |
Correct |
1 ms |
6492 KB |
Output is correct |
53 |
Correct |
1 ms |
10588 KB |
Output is correct |
54 |
Correct |
3 ms |
22876 KB |
Output is correct |
55 |
Correct |
3 ms |
20824 KB |
Output is correct |
56 |
Correct |
3 ms |
22872 KB |
Output is correct |
57 |
Correct |
3 ms |
20828 KB |
Output is correct |
58 |
Correct |
2 ms |
20828 KB |
Output is correct |
59 |
Correct |
2 ms |
20880 KB |
Output is correct |
60 |
Correct |
3 ms |
22872 KB |
Output is correct |
61 |
Correct |
3 ms |
20828 KB |
Output is correct |
62 |
Correct |
3 ms |
22876 KB |
Output is correct |
63 |
Correct |
2 ms |
18780 KB |
Output is correct |
64 |
Correct |
2 ms |
14684 KB |
Output is correct |
65 |
Correct |
1 ms |
8540 KB |
Output is correct |
66 |
Correct |
2 ms |
8540 KB |
Output is correct |
67 |
Correct |
5 ms |
20828 KB |
Output is correct |
68 |
Correct |
5 ms |
22876 KB |
Output is correct |
69 |
Correct |
6 ms |
31196 KB |
Output is correct |
70 |
Correct |
6 ms |
31324 KB |
Output is correct |
71 |
Correct |
18 ms |
97112 KB |
Output is correct |
72 |
Correct |
18 ms |
91080 KB |
Output is correct |
73 |
Correct |
15 ms |
89048 KB |
Output is correct |
74 |
Correct |
16 ms |
90972 KB |
Output is correct |
75 |
Correct |
20 ms |
97116 KB |
Output is correct |
76 |
Correct |
19 ms |
88924 KB |
Output is correct |
77 |
Correct |
16 ms |
97116 KB |
Output is correct |
78 |
Correct |
18 ms |
93200 KB |
Output is correct |
79 |
Correct |
17 ms |
93020 KB |
Output is correct |
80 |
Correct |
17 ms |
95052 KB |
Output is correct |
81 |
Correct |
15 ms |
76616 KB |
Output is correct |
82 |
Correct |
14 ms |
80728 KB |
Output is correct |
83 |
Correct |
6 ms |
22896 KB |
Output is correct |
84 |
Correct |
11 ms |
12860 KB |
Output is correct |
85 |
Correct |
34 ms |
55908 KB |
Output is correct |
86 |
Correct |
21 ms |
23132 KB |
Output is correct |
87 |
Correct |
24 ms |
31408 KB |
Output is correct |
88 |
Correct |
24 ms |
31200 KB |
Output is correct |
89 |
Correct |
530 ms |
567376 KB |
Output is correct |
90 |
Correct |
429 ms |
492568 KB |
Output is correct |
91 |
Correct |
447 ms |
566240 KB |
Output is correct |
92 |
Correct |
445 ms |
510544 KB |
Output is correct |
93 |
Correct |
369 ms |
519404 KB |
Output is correct |
94 |
Correct |
406 ms |
531548 KB |
Output is correct |
95 |
Correct |
419 ms |
553364 KB |
Output is correct |
96 |
Correct |
351 ms |
498004 KB |
Output is correct |
97 |
Correct |
376 ms |
551252 KB |
Output is correct |
98 |
Correct |
344 ms |
539176 KB |
Output is correct |
99 |
Correct |
631 ms |
567316 KB |
Output is correct |
100 |
Correct |
219 ms |
342352 KB |
Output is correct |
101 |
Correct |
54 ms |
97360 KB |
Output is correct |
102 |
Correct |
795 ms |
27984 KB |
Output is correct |
103 |
Execution timed out |
1046 ms |
83792 KB |
Time limit exceeded |
104 |
Halted |
0 ms |
0 KB |
- |