#include <bits/stdc++.h>
using namespace std;
const int maxn = 5010;
int n, m, par[maxn][maxn], len[maxn], suf[maxn], mx[maxn];
bool mark[maxn];
vector<int> G[maxn];
int main() {
ios::sync_with_stdio(0), cin.tie(0);
cin >> n >> m;
vector<array<int, 3>> E;
while (m--) {
int u, v, w;
cin >> u >> v >> w;
if (w == 1) G[u].push_back(v), G[v].push_back(u);
else if (w < (n + 1) / 2) E.push_back({u, v, w});
}
int diam = 0;
for (int i = 0; i < n; i++) {
auto dfs = [&](auto self, int u, int fa, int d) -> void {
diam = max(diam, d), par[i][u] = fa;
for (int v : G[u]) if (v ^ fa) self(self, v, u, d + 1);
};
dfs(dfs, i, -1, 0);
}
int ans = 2 * (n - 1) - diam;
for (auto &e : E) {
int u = e[0], v = e[1], mn = INT_MAX;
memset(mark, 0, sizeof(mark));
vector<int> path;
for (int i = u; ; i = par[v][i]) {
path.push_back(i), mark[i] = 1;
if (i == v) break;
}
for (int i = 0; i < path.size(); i++) {
auto dfs = [&](auto self, int u, int fa) -> void {
mx[u] = 0;
int sec = 0;
for (int v : G[u]) if (!mark[v] && v ^ fa) {
self(self, v, u);
if (mx[v] + 1 > mx[u]) sec = mx[u], mx[u] = mx[v] + 1;
else if (mx[v] + 1 > sec) sec = mx[v] + 1;
}
mn = min(mn, 2 * (n - 2) - (int)path.size() + 3 - mx[u] - sec);
};
dfs(dfs, path[i], -1), len[i] = mx[path[i]];
}
for (int i = path.size() - 1; ~i; i--) {
suf[i] = max((int)path.size() - i - 1 + len[i], i + 1 == path.size() ? 0 : suf[i + 1]);
}
for (int i = 0, mx = 0; i + 1 < path.size(); i++) {
mx = max(mx, i + len[i]);
mn = min(mn, 2 * (n - 2) - mx - suf[i + 1]);
}
ans = min(ans, mn + e[2]);
}
cout << ans << "\n";
return 0;
}
Compilation message
Main.cpp: In function 'int main()':
Main.cpp:36:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
36 | for (int i = 0; i < path.size(); i++) {
| ~~^~~~~~~~~~~~~
Main.cpp:50:67: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
50 | suf[i] = max((int)path.size() - i - 1 + len[i], i + 1 == path.size() ? 0 : suf[i + 1]);
| ~~~~~~^~~~~~~~~~~~~~
Main.cpp:52:39: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
52 | for (int i = 0, mx = 0; i + 1 < path.size(); i++) {
| ~~~~~~^~~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
340 KB |
Output is correct |
2 |
Correct |
0 ms |
468 KB |
Output is correct |
3 |
Correct |
0 ms |
444 KB |
Output is correct |
4 |
Correct |
1 ms |
468 KB |
Output is correct |
5 |
Correct |
1 ms |
444 KB |
Output is correct |
6 |
Correct |
1 ms |
448 KB |
Output is correct |
7 |
Correct |
1 ms |
468 KB |
Output is correct |
8 |
Correct |
0 ms |
468 KB |
Output is correct |
9 |
Correct |
1 ms |
468 KB |
Output is correct |
10 |
Correct |
1 ms |
468 KB |
Output is correct |
11 |
Correct |
0 ms |
468 KB |
Output is correct |
12 |
Correct |
0 ms |
468 KB |
Output is correct |
13 |
Correct |
1 ms |
468 KB |
Output is correct |
14 |
Correct |
1 ms |
468 KB |
Output is correct |
15 |
Correct |
1 ms |
440 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
340 KB |
Output is correct |
2 |
Correct |
0 ms |
468 KB |
Output is correct |
3 |
Correct |
0 ms |
444 KB |
Output is correct |
4 |
Correct |
1 ms |
468 KB |
Output is correct |
5 |
Correct |
1 ms |
444 KB |
Output is correct |
6 |
Correct |
1 ms |
448 KB |
Output is correct |
7 |
Correct |
1 ms |
468 KB |
Output is correct |
8 |
Correct |
0 ms |
468 KB |
Output is correct |
9 |
Correct |
1 ms |
468 KB |
Output is correct |
10 |
Correct |
1 ms |
468 KB |
Output is correct |
11 |
Correct |
0 ms |
468 KB |
Output is correct |
12 |
Correct |
0 ms |
468 KB |
Output is correct |
13 |
Correct |
1 ms |
468 KB |
Output is correct |
14 |
Correct |
1 ms |
468 KB |
Output is correct |
15 |
Correct |
1 ms |
440 KB |
Output is correct |
16 |
Correct |
1 ms |
404 KB |
Output is correct |
17 |
Correct |
1 ms |
448 KB |
Output is correct |
18 |
Correct |
1 ms |
468 KB |
Output is correct |
19 |
Correct |
1 ms |
468 KB |
Output is correct |
20 |
Correct |
1 ms |
468 KB |
Output is correct |
21 |
Correct |
1 ms |
468 KB |
Output is correct |
22 |
Correct |
1 ms |
444 KB |
Output is correct |
23 |
Correct |
1 ms |
468 KB |
Output is correct |
24 |
Correct |
1 ms |
468 KB |
Output is correct |
25 |
Correct |
1 ms |
468 KB |
Output is correct |
26 |
Correct |
0 ms |
468 KB |
Output is correct |
27 |
Correct |
1 ms |
444 KB |
Output is correct |
28 |
Correct |
1 ms |
468 KB |
Output is correct |
29 |
Correct |
1 ms |
468 KB |
Output is correct |
30 |
Correct |
1 ms |
468 KB |
Output is correct |
31 |
Correct |
0 ms |
468 KB |
Output is correct |
32 |
Correct |
0 ms |
468 KB |
Output is correct |
33 |
Correct |
1 ms |
468 KB |
Output is correct |
34 |
Correct |
1 ms |
468 KB |
Output is correct |
35 |
Correct |
1 ms |
468 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
666 ms |
98736 KB |
Output is correct |
2 |
Correct |
674 ms |
98820 KB |
Output is correct |
3 |
Correct |
679 ms |
98676 KB |
Output is correct |
4 |
Correct |
634 ms |
98540 KB |
Output is correct |
5 |
Correct |
633 ms |
98700 KB |
Output is correct |
6 |
Correct |
229 ms |
98636 KB |
Output is correct |
7 |
Correct |
648 ms |
98768 KB |
Output is correct |
8 |
Correct |
703 ms |
98700 KB |
Output is correct |
9 |
Correct |
666 ms |
98640 KB |
Output is correct |
10 |
Correct |
645 ms |
98560 KB |
Output is correct |
11 |
Correct |
633 ms |
98548 KB |
Output is correct |
12 |
Correct |
628 ms |
98548 KB |
Output is correct |
13 |
Correct |
640 ms |
98600 KB |
Output is correct |
14 |
Correct |
663 ms |
98600 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
340 KB |
Output is correct |
2 |
Correct |
0 ms |
468 KB |
Output is correct |
3 |
Correct |
0 ms |
444 KB |
Output is correct |
4 |
Correct |
1 ms |
468 KB |
Output is correct |
5 |
Correct |
1 ms |
444 KB |
Output is correct |
6 |
Correct |
1 ms |
448 KB |
Output is correct |
7 |
Correct |
1 ms |
468 KB |
Output is correct |
8 |
Correct |
0 ms |
468 KB |
Output is correct |
9 |
Correct |
1 ms |
468 KB |
Output is correct |
10 |
Correct |
1 ms |
468 KB |
Output is correct |
11 |
Correct |
0 ms |
468 KB |
Output is correct |
12 |
Correct |
0 ms |
468 KB |
Output is correct |
13 |
Correct |
1 ms |
468 KB |
Output is correct |
14 |
Correct |
1 ms |
468 KB |
Output is correct |
15 |
Correct |
1 ms |
440 KB |
Output is correct |
16 |
Correct |
1 ms |
404 KB |
Output is correct |
17 |
Correct |
1 ms |
448 KB |
Output is correct |
18 |
Correct |
1 ms |
468 KB |
Output is correct |
19 |
Correct |
1 ms |
468 KB |
Output is correct |
20 |
Correct |
1 ms |
468 KB |
Output is correct |
21 |
Correct |
1 ms |
468 KB |
Output is correct |
22 |
Correct |
1 ms |
444 KB |
Output is correct |
23 |
Correct |
1 ms |
468 KB |
Output is correct |
24 |
Correct |
1 ms |
468 KB |
Output is correct |
25 |
Correct |
1 ms |
468 KB |
Output is correct |
26 |
Correct |
0 ms |
468 KB |
Output is correct |
27 |
Correct |
1 ms |
444 KB |
Output is correct |
28 |
Correct |
1 ms |
468 KB |
Output is correct |
29 |
Correct |
1 ms |
468 KB |
Output is correct |
30 |
Correct |
1 ms |
468 KB |
Output is correct |
31 |
Correct |
0 ms |
468 KB |
Output is correct |
32 |
Correct |
0 ms |
468 KB |
Output is correct |
33 |
Correct |
1 ms |
468 KB |
Output is correct |
34 |
Correct |
1 ms |
468 KB |
Output is correct |
35 |
Correct |
1 ms |
468 KB |
Output is correct |
36 |
Correct |
1 ms |
852 KB |
Output is correct |
37 |
Correct |
1 ms |
852 KB |
Output is correct |
38 |
Correct |
2 ms |
852 KB |
Output is correct |
39 |
Correct |
1 ms |
852 KB |
Output is correct |
40 |
Correct |
1 ms |
980 KB |
Output is correct |
41 |
Correct |
1 ms |
852 KB |
Output is correct |
42 |
Correct |
1 ms |
852 KB |
Output is correct |
43 |
Correct |
1 ms |
832 KB |
Output is correct |
44 |
Correct |
1 ms |
852 KB |
Output is correct |
45 |
Correct |
1 ms |
852 KB |
Output is correct |
46 |
Correct |
1 ms |
852 KB |
Output is correct |
47 |
Correct |
1 ms |
852 KB |
Output is correct |
48 |
Correct |
1 ms |
852 KB |
Output is correct |
49 |
Correct |
1 ms |
852 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
340 KB |
Output is correct |
2 |
Correct |
0 ms |
468 KB |
Output is correct |
3 |
Correct |
0 ms |
444 KB |
Output is correct |
4 |
Correct |
1 ms |
468 KB |
Output is correct |
5 |
Correct |
1 ms |
444 KB |
Output is correct |
6 |
Correct |
1 ms |
448 KB |
Output is correct |
7 |
Correct |
1 ms |
468 KB |
Output is correct |
8 |
Correct |
0 ms |
468 KB |
Output is correct |
9 |
Correct |
1 ms |
468 KB |
Output is correct |
10 |
Correct |
1 ms |
468 KB |
Output is correct |
11 |
Correct |
0 ms |
468 KB |
Output is correct |
12 |
Correct |
0 ms |
468 KB |
Output is correct |
13 |
Correct |
1 ms |
468 KB |
Output is correct |
14 |
Correct |
1 ms |
468 KB |
Output is correct |
15 |
Correct |
1 ms |
440 KB |
Output is correct |
16 |
Correct |
1 ms |
404 KB |
Output is correct |
17 |
Correct |
1 ms |
448 KB |
Output is correct |
18 |
Correct |
1 ms |
468 KB |
Output is correct |
19 |
Correct |
1 ms |
468 KB |
Output is correct |
20 |
Correct |
1 ms |
468 KB |
Output is correct |
21 |
Correct |
1 ms |
468 KB |
Output is correct |
22 |
Correct |
1 ms |
444 KB |
Output is correct |
23 |
Correct |
1 ms |
468 KB |
Output is correct |
24 |
Correct |
1 ms |
468 KB |
Output is correct |
25 |
Correct |
1 ms |
468 KB |
Output is correct |
26 |
Correct |
0 ms |
468 KB |
Output is correct |
27 |
Correct |
1 ms |
444 KB |
Output is correct |
28 |
Correct |
1 ms |
468 KB |
Output is correct |
29 |
Correct |
1 ms |
468 KB |
Output is correct |
30 |
Correct |
1 ms |
468 KB |
Output is correct |
31 |
Correct |
0 ms |
468 KB |
Output is correct |
32 |
Correct |
0 ms |
468 KB |
Output is correct |
33 |
Correct |
1 ms |
468 KB |
Output is correct |
34 |
Correct |
1 ms |
468 KB |
Output is correct |
35 |
Correct |
1 ms |
468 KB |
Output is correct |
36 |
Correct |
1 ms |
852 KB |
Output is correct |
37 |
Correct |
1 ms |
852 KB |
Output is correct |
38 |
Correct |
2 ms |
852 KB |
Output is correct |
39 |
Correct |
1 ms |
852 KB |
Output is correct |
40 |
Correct |
1 ms |
980 KB |
Output is correct |
41 |
Correct |
1 ms |
852 KB |
Output is correct |
42 |
Correct |
1 ms |
852 KB |
Output is correct |
43 |
Correct |
1 ms |
832 KB |
Output is correct |
44 |
Correct |
1 ms |
852 KB |
Output is correct |
45 |
Correct |
1 ms |
852 KB |
Output is correct |
46 |
Correct |
1 ms |
852 KB |
Output is correct |
47 |
Correct |
1 ms |
852 KB |
Output is correct |
48 |
Correct |
1 ms |
852 KB |
Output is correct |
49 |
Correct |
1 ms |
852 KB |
Output is correct |
50 |
Correct |
10 ms |
3488 KB |
Output is correct |
51 |
Correct |
9 ms |
3412 KB |
Output is correct |
52 |
Correct |
10 ms |
3492 KB |
Output is correct |
53 |
Correct |
11 ms |
3480 KB |
Output is correct |
54 |
Correct |
10 ms |
3432 KB |
Output is correct |
55 |
Correct |
4 ms |
3412 KB |
Output is correct |
56 |
Correct |
12 ms |
3412 KB |
Output is correct |
57 |
Correct |
10 ms |
3412 KB |
Output is correct |
58 |
Correct |
11 ms |
3412 KB |
Output is correct |
59 |
Correct |
11 ms |
3412 KB |
Output is correct |
60 |
Correct |
10 ms |
3448 KB |
Output is correct |
61 |
Correct |
10 ms |
3332 KB |
Output is correct |
62 |
Correct |
6 ms |
3412 KB |
Output is correct |
63 |
Correct |
6 ms |
3412 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
340 KB |
Output is correct |
2 |
Correct |
0 ms |
468 KB |
Output is correct |
3 |
Correct |
0 ms |
444 KB |
Output is correct |
4 |
Correct |
1 ms |
468 KB |
Output is correct |
5 |
Correct |
1 ms |
444 KB |
Output is correct |
6 |
Correct |
1 ms |
448 KB |
Output is correct |
7 |
Correct |
1 ms |
468 KB |
Output is correct |
8 |
Correct |
0 ms |
468 KB |
Output is correct |
9 |
Correct |
1 ms |
468 KB |
Output is correct |
10 |
Correct |
1 ms |
468 KB |
Output is correct |
11 |
Correct |
0 ms |
468 KB |
Output is correct |
12 |
Correct |
0 ms |
468 KB |
Output is correct |
13 |
Correct |
1 ms |
468 KB |
Output is correct |
14 |
Correct |
1 ms |
468 KB |
Output is correct |
15 |
Correct |
1 ms |
440 KB |
Output is correct |
16 |
Correct |
1 ms |
404 KB |
Output is correct |
17 |
Correct |
1 ms |
448 KB |
Output is correct |
18 |
Correct |
1 ms |
468 KB |
Output is correct |
19 |
Correct |
1 ms |
468 KB |
Output is correct |
20 |
Correct |
1 ms |
468 KB |
Output is correct |
21 |
Correct |
1 ms |
468 KB |
Output is correct |
22 |
Correct |
1 ms |
444 KB |
Output is correct |
23 |
Correct |
1 ms |
468 KB |
Output is correct |
24 |
Correct |
1 ms |
468 KB |
Output is correct |
25 |
Correct |
1 ms |
468 KB |
Output is correct |
26 |
Correct |
0 ms |
468 KB |
Output is correct |
27 |
Correct |
1 ms |
444 KB |
Output is correct |
28 |
Correct |
1 ms |
468 KB |
Output is correct |
29 |
Correct |
1 ms |
468 KB |
Output is correct |
30 |
Correct |
1 ms |
468 KB |
Output is correct |
31 |
Correct |
0 ms |
468 KB |
Output is correct |
32 |
Correct |
0 ms |
468 KB |
Output is correct |
33 |
Correct |
1 ms |
468 KB |
Output is correct |
34 |
Correct |
1 ms |
468 KB |
Output is correct |
35 |
Correct |
1 ms |
468 KB |
Output is correct |
36 |
Correct |
666 ms |
98736 KB |
Output is correct |
37 |
Correct |
674 ms |
98820 KB |
Output is correct |
38 |
Correct |
679 ms |
98676 KB |
Output is correct |
39 |
Correct |
634 ms |
98540 KB |
Output is correct |
40 |
Correct |
633 ms |
98700 KB |
Output is correct |
41 |
Correct |
229 ms |
98636 KB |
Output is correct |
42 |
Correct |
648 ms |
98768 KB |
Output is correct |
43 |
Correct |
703 ms |
98700 KB |
Output is correct |
44 |
Correct |
666 ms |
98640 KB |
Output is correct |
45 |
Correct |
645 ms |
98560 KB |
Output is correct |
46 |
Correct |
633 ms |
98548 KB |
Output is correct |
47 |
Correct |
628 ms |
98548 KB |
Output is correct |
48 |
Correct |
640 ms |
98600 KB |
Output is correct |
49 |
Correct |
663 ms |
98600 KB |
Output is correct |
50 |
Correct |
1 ms |
852 KB |
Output is correct |
51 |
Correct |
1 ms |
852 KB |
Output is correct |
52 |
Correct |
2 ms |
852 KB |
Output is correct |
53 |
Correct |
1 ms |
852 KB |
Output is correct |
54 |
Correct |
1 ms |
980 KB |
Output is correct |
55 |
Correct |
1 ms |
852 KB |
Output is correct |
56 |
Correct |
1 ms |
852 KB |
Output is correct |
57 |
Correct |
1 ms |
832 KB |
Output is correct |
58 |
Correct |
1 ms |
852 KB |
Output is correct |
59 |
Correct |
1 ms |
852 KB |
Output is correct |
60 |
Correct |
1 ms |
852 KB |
Output is correct |
61 |
Correct |
1 ms |
852 KB |
Output is correct |
62 |
Correct |
1 ms |
852 KB |
Output is correct |
63 |
Correct |
1 ms |
852 KB |
Output is correct |
64 |
Correct |
10 ms |
3488 KB |
Output is correct |
65 |
Correct |
9 ms |
3412 KB |
Output is correct |
66 |
Correct |
10 ms |
3492 KB |
Output is correct |
67 |
Correct |
11 ms |
3480 KB |
Output is correct |
68 |
Correct |
10 ms |
3432 KB |
Output is correct |
69 |
Correct |
4 ms |
3412 KB |
Output is correct |
70 |
Correct |
12 ms |
3412 KB |
Output is correct |
71 |
Correct |
10 ms |
3412 KB |
Output is correct |
72 |
Correct |
11 ms |
3412 KB |
Output is correct |
73 |
Correct |
11 ms |
3412 KB |
Output is correct |
74 |
Correct |
10 ms |
3448 KB |
Output is correct |
75 |
Correct |
10 ms |
3332 KB |
Output is correct |
76 |
Correct |
6 ms |
3412 KB |
Output is correct |
77 |
Correct |
6 ms |
3412 KB |
Output is correct |
78 |
Correct |
1192 ms |
99236 KB |
Output is correct |
79 |
Correct |
1000 ms |
99120 KB |
Output is correct |
80 |
Correct |
1280 ms |
99076 KB |
Output is correct |
81 |
Correct |
1267 ms |
99000 KB |
Output is correct |
82 |
Correct |
1203 ms |
98916 KB |
Output is correct |
83 |
Correct |
298 ms |
98812 KB |
Output is correct |
84 |
Correct |
1133 ms |
99152 KB |
Output is correct |
85 |
Correct |
1475 ms |
98960 KB |
Output is correct |
86 |
Correct |
1266 ms |
99016 KB |
Output is correct |
87 |
Correct |
1372 ms |
98872 KB |
Output is correct |
88 |
Correct |
1454 ms |
98852 KB |
Output is correct |
89 |
Correct |
1234 ms |
98756 KB |
Output is correct |
90 |
Correct |
734 ms |
98844 KB |
Output is correct |
91 |
Correct |
750 ms |
98932 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
340 KB |
Output is correct |
2 |
Correct |
0 ms |
468 KB |
Output is correct |
3 |
Correct |
0 ms |
444 KB |
Output is correct |
4 |
Correct |
1 ms |
468 KB |
Output is correct |
5 |
Correct |
1 ms |
444 KB |
Output is correct |
6 |
Correct |
1 ms |
448 KB |
Output is correct |
7 |
Correct |
1 ms |
468 KB |
Output is correct |
8 |
Correct |
0 ms |
468 KB |
Output is correct |
9 |
Correct |
1 ms |
468 KB |
Output is correct |
10 |
Correct |
1 ms |
468 KB |
Output is correct |
11 |
Correct |
0 ms |
468 KB |
Output is correct |
12 |
Correct |
0 ms |
468 KB |
Output is correct |
13 |
Correct |
1 ms |
468 KB |
Output is correct |
14 |
Correct |
1 ms |
468 KB |
Output is correct |
15 |
Correct |
1 ms |
440 KB |
Output is correct |
16 |
Correct |
1 ms |
404 KB |
Output is correct |
17 |
Correct |
1 ms |
448 KB |
Output is correct |
18 |
Correct |
1 ms |
468 KB |
Output is correct |
19 |
Correct |
1 ms |
468 KB |
Output is correct |
20 |
Correct |
1 ms |
468 KB |
Output is correct |
21 |
Correct |
1 ms |
468 KB |
Output is correct |
22 |
Correct |
1 ms |
444 KB |
Output is correct |
23 |
Correct |
1 ms |
468 KB |
Output is correct |
24 |
Correct |
1 ms |
468 KB |
Output is correct |
25 |
Correct |
1 ms |
468 KB |
Output is correct |
26 |
Correct |
0 ms |
468 KB |
Output is correct |
27 |
Correct |
1 ms |
444 KB |
Output is correct |
28 |
Correct |
1 ms |
468 KB |
Output is correct |
29 |
Correct |
1 ms |
468 KB |
Output is correct |
30 |
Correct |
1 ms |
468 KB |
Output is correct |
31 |
Correct |
0 ms |
468 KB |
Output is correct |
32 |
Correct |
0 ms |
468 KB |
Output is correct |
33 |
Correct |
1 ms |
468 KB |
Output is correct |
34 |
Correct |
1 ms |
468 KB |
Output is correct |
35 |
Correct |
1 ms |
468 KB |
Output is correct |
36 |
Correct |
666 ms |
98736 KB |
Output is correct |
37 |
Correct |
674 ms |
98820 KB |
Output is correct |
38 |
Correct |
679 ms |
98676 KB |
Output is correct |
39 |
Correct |
634 ms |
98540 KB |
Output is correct |
40 |
Correct |
633 ms |
98700 KB |
Output is correct |
41 |
Correct |
229 ms |
98636 KB |
Output is correct |
42 |
Correct |
648 ms |
98768 KB |
Output is correct |
43 |
Correct |
703 ms |
98700 KB |
Output is correct |
44 |
Correct |
666 ms |
98640 KB |
Output is correct |
45 |
Correct |
645 ms |
98560 KB |
Output is correct |
46 |
Correct |
633 ms |
98548 KB |
Output is correct |
47 |
Correct |
628 ms |
98548 KB |
Output is correct |
48 |
Correct |
640 ms |
98600 KB |
Output is correct |
49 |
Correct |
663 ms |
98600 KB |
Output is correct |
50 |
Correct |
1 ms |
852 KB |
Output is correct |
51 |
Correct |
1 ms |
852 KB |
Output is correct |
52 |
Correct |
2 ms |
852 KB |
Output is correct |
53 |
Correct |
1 ms |
852 KB |
Output is correct |
54 |
Correct |
1 ms |
980 KB |
Output is correct |
55 |
Correct |
1 ms |
852 KB |
Output is correct |
56 |
Correct |
1 ms |
852 KB |
Output is correct |
57 |
Correct |
1 ms |
832 KB |
Output is correct |
58 |
Correct |
1 ms |
852 KB |
Output is correct |
59 |
Correct |
1 ms |
852 KB |
Output is correct |
60 |
Correct |
1 ms |
852 KB |
Output is correct |
61 |
Correct |
1 ms |
852 KB |
Output is correct |
62 |
Correct |
1 ms |
852 KB |
Output is correct |
63 |
Correct |
1 ms |
852 KB |
Output is correct |
64 |
Correct |
10 ms |
3488 KB |
Output is correct |
65 |
Correct |
9 ms |
3412 KB |
Output is correct |
66 |
Correct |
10 ms |
3492 KB |
Output is correct |
67 |
Correct |
11 ms |
3480 KB |
Output is correct |
68 |
Correct |
10 ms |
3432 KB |
Output is correct |
69 |
Correct |
4 ms |
3412 KB |
Output is correct |
70 |
Correct |
12 ms |
3412 KB |
Output is correct |
71 |
Correct |
10 ms |
3412 KB |
Output is correct |
72 |
Correct |
11 ms |
3412 KB |
Output is correct |
73 |
Correct |
11 ms |
3412 KB |
Output is correct |
74 |
Correct |
10 ms |
3448 KB |
Output is correct |
75 |
Correct |
10 ms |
3332 KB |
Output is correct |
76 |
Correct |
6 ms |
3412 KB |
Output is correct |
77 |
Correct |
6 ms |
3412 KB |
Output is correct |
78 |
Correct |
1192 ms |
99236 KB |
Output is correct |
79 |
Correct |
1000 ms |
99120 KB |
Output is correct |
80 |
Correct |
1280 ms |
99076 KB |
Output is correct |
81 |
Correct |
1267 ms |
99000 KB |
Output is correct |
82 |
Correct |
1203 ms |
98916 KB |
Output is correct |
83 |
Correct |
298 ms |
98812 KB |
Output is correct |
84 |
Correct |
1133 ms |
99152 KB |
Output is correct |
85 |
Correct |
1475 ms |
98960 KB |
Output is correct |
86 |
Correct |
1266 ms |
99016 KB |
Output is correct |
87 |
Correct |
1372 ms |
98872 KB |
Output is correct |
88 |
Correct |
1454 ms |
98852 KB |
Output is correct |
89 |
Correct |
1234 ms |
98756 KB |
Output is correct |
90 |
Correct |
734 ms |
98844 KB |
Output is correct |
91 |
Correct |
750 ms |
98932 KB |
Output is correct |
92 |
Runtime error |
60 ms |
13672 KB |
Execution killed with signal 11 |
93 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
340 KB |
Output is correct |
2 |
Correct |
0 ms |
468 KB |
Output is correct |
3 |
Correct |
0 ms |
444 KB |
Output is correct |
4 |
Correct |
1 ms |
468 KB |
Output is correct |
5 |
Correct |
1 ms |
444 KB |
Output is correct |
6 |
Correct |
1 ms |
448 KB |
Output is correct |
7 |
Correct |
1 ms |
468 KB |
Output is correct |
8 |
Correct |
0 ms |
468 KB |
Output is correct |
9 |
Correct |
1 ms |
468 KB |
Output is correct |
10 |
Correct |
1 ms |
468 KB |
Output is correct |
11 |
Correct |
0 ms |
468 KB |
Output is correct |
12 |
Correct |
0 ms |
468 KB |
Output is correct |
13 |
Correct |
1 ms |
468 KB |
Output is correct |
14 |
Correct |
1 ms |
468 KB |
Output is correct |
15 |
Correct |
1 ms |
440 KB |
Output is correct |
16 |
Correct |
1 ms |
404 KB |
Output is correct |
17 |
Correct |
1 ms |
448 KB |
Output is correct |
18 |
Correct |
1 ms |
468 KB |
Output is correct |
19 |
Correct |
1 ms |
468 KB |
Output is correct |
20 |
Correct |
1 ms |
468 KB |
Output is correct |
21 |
Correct |
1 ms |
468 KB |
Output is correct |
22 |
Correct |
1 ms |
444 KB |
Output is correct |
23 |
Correct |
1 ms |
468 KB |
Output is correct |
24 |
Correct |
1 ms |
468 KB |
Output is correct |
25 |
Correct |
1 ms |
468 KB |
Output is correct |
26 |
Correct |
0 ms |
468 KB |
Output is correct |
27 |
Correct |
1 ms |
444 KB |
Output is correct |
28 |
Correct |
1 ms |
468 KB |
Output is correct |
29 |
Correct |
1 ms |
468 KB |
Output is correct |
30 |
Correct |
1 ms |
468 KB |
Output is correct |
31 |
Correct |
0 ms |
468 KB |
Output is correct |
32 |
Correct |
0 ms |
468 KB |
Output is correct |
33 |
Correct |
1 ms |
468 KB |
Output is correct |
34 |
Correct |
1 ms |
468 KB |
Output is correct |
35 |
Correct |
1 ms |
468 KB |
Output is correct |
36 |
Correct |
666 ms |
98736 KB |
Output is correct |
37 |
Correct |
674 ms |
98820 KB |
Output is correct |
38 |
Correct |
679 ms |
98676 KB |
Output is correct |
39 |
Correct |
634 ms |
98540 KB |
Output is correct |
40 |
Correct |
633 ms |
98700 KB |
Output is correct |
41 |
Correct |
229 ms |
98636 KB |
Output is correct |
42 |
Correct |
648 ms |
98768 KB |
Output is correct |
43 |
Correct |
703 ms |
98700 KB |
Output is correct |
44 |
Correct |
666 ms |
98640 KB |
Output is correct |
45 |
Correct |
645 ms |
98560 KB |
Output is correct |
46 |
Correct |
633 ms |
98548 KB |
Output is correct |
47 |
Correct |
628 ms |
98548 KB |
Output is correct |
48 |
Correct |
640 ms |
98600 KB |
Output is correct |
49 |
Correct |
663 ms |
98600 KB |
Output is correct |
50 |
Correct |
1 ms |
852 KB |
Output is correct |
51 |
Correct |
1 ms |
852 KB |
Output is correct |
52 |
Correct |
2 ms |
852 KB |
Output is correct |
53 |
Correct |
1 ms |
852 KB |
Output is correct |
54 |
Correct |
1 ms |
980 KB |
Output is correct |
55 |
Correct |
1 ms |
852 KB |
Output is correct |
56 |
Correct |
1 ms |
852 KB |
Output is correct |
57 |
Correct |
1 ms |
832 KB |
Output is correct |
58 |
Correct |
1 ms |
852 KB |
Output is correct |
59 |
Correct |
1 ms |
852 KB |
Output is correct |
60 |
Correct |
1 ms |
852 KB |
Output is correct |
61 |
Correct |
1 ms |
852 KB |
Output is correct |
62 |
Correct |
1 ms |
852 KB |
Output is correct |
63 |
Correct |
1 ms |
852 KB |
Output is correct |
64 |
Correct |
10 ms |
3488 KB |
Output is correct |
65 |
Correct |
9 ms |
3412 KB |
Output is correct |
66 |
Correct |
10 ms |
3492 KB |
Output is correct |
67 |
Correct |
11 ms |
3480 KB |
Output is correct |
68 |
Correct |
10 ms |
3432 KB |
Output is correct |
69 |
Correct |
4 ms |
3412 KB |
Output is correct |
70 |
Correct |
12 ms |
3412 KB |
Output is correct |
71 |
Correct |
10 ms |
3412 KB |
Output is correct |
72 |
Correct |
11 ms |
3412 KB |
Output is correct |
73 |
Correct |
11 ms |
3412 KB |
Output is correct |
74 |
Correct |
10 ms |
3448 KB |
Output is correct |
75 |
Correct |
10 ms |
3332 KB |
Output is correct |
76 |
Correct |
6 ms |
3412 KB |
Output is correct |
77 |
Correct |
6 ms |
3412 KB |
Output is correct |
78 |
Correct |
1192 ms |
99236 KB |
Output is correct |
79 |
Correct |
1000 ms |
99120 KB |
Output is correct |
80 |
Correct |
1280 ms |
99076 KB |
Output is correct |
81 |
Correct |
1267 ms |
99000 KB |
Output is correct |
82 |
Correct |
1203 ms |
98916 KB |
Output is correct |
83 |
Correct |
298 ms |
98812 KB |
Output is correct |
84 |
Correct |
1133 ms |
99152 KB |
Output is correct |
85 |
Correct |
1475 ms |
98960 KB |
Output is correct |
86 |
Correct |
1266 ms |
99016 KB |
Output is correct |
87 |
Correct |
1372 ms |
98872 KB |
Output is correct |
88 |
Correct |
1454 ms |
98852 KB |
Output is correct |
89 |
Correct |
1234 ms |
98756 KB |
Output is correct |
90 |
Correct |
734 ms |
98844 KB |
Output is correct |
91 |
Correct |
750 ms |
98932 KB |
Output is correct |
92 |
Runtime error |
60 ms |
13672 KB |
Execution killed with signal 11 |
93 |
Halted |
0 ms |
0 KB |
- |