#include <cstdio>
#include <vector>
#include <utility>
#include <algorithm>
using namespace std;
int n, m, dp[20][20971520];
vector<int> tree[200006];
vector<pair<int, int>> adj[200006];
int f(int x, int y) {
if (dp[x][y] + 1) return dp[x][y];
if (!y) return dp[x][y] = 0;
dp[x][y] = (int)1e9;
for (auto &i: adj[x]) dp[x][y] = min(dp[x][y], i.second + f(i.first, y & ~(1 << i.first)));
for (auto &i: tree[x]) dp[x][y] = min(dp[x][y], 1 + f(i, y & ~(1 << i)));
return dp[x][y];
}
int lt[5006][5006], dist[200006], par[200006], sz[200006];
bool cl[200006];
void dfs_lt(int x, int y, int dist = 0, int prev = -1) {
lt[y][x] = dist;
for (auto &i: tree[x]) if (i != prev) dfs_lt(i, y, dist + 1, x);
}
int dfs(int x, int prev = -1) {
par[x] = prev;
sz[x] = 1;
for (auto &i: tree[x]) if (i != prev) {
sz[x] = max(sz[x], dfs(i, x) + 1);
}
return sz[x];
}
int dfs_dist(int x, int prev = -1) {
int ret = x;
for (auto &i: tree[x]) if (i != prev) {
dist[i] = 1 + dist[x];
int t = dfs_dist(i, x);
if (dist[t] > dist[ret]) ret = t;
}
return ret;
}
int main() {
scanf("%d%d", &n, &m);
while (m--) {
int x, y, w;
scanf("%d%d%d", &x, &y, &w);
if (w == 1) {
tree[x].push_back(y);
tree[y].push_back(x);
} else {
adj[x].push_back({ y, w });
adj[y].push_back({ x, w });
}
}
if (n <= 20) {
for (int i = 0; i < n; i++) for (int j = 0; j < 1 << n; j++) dp[i][j] = -1;
int res = (int)1e9;
for (int i = 0; i < n; i++) res = min(res, f(i, (1 << n) - 1 ^ 1 << i));
printf("%d", res);
return 0;
}
for (int i = 0; i < n; i++) dfs_lt(i, i);
int t = dfs_dist(dist[0] = 0);
dist[t] = 0;
int s = dfs_dist(t);
int zero = 2 * (n - 1) - dist[s], one = (int)1e9;
if (n <= 1000) for (int i = 0; i < n; i++) for (auto &j: adj[i]) if (i < j.first) {
int curr = j.second + 2 * (n - 1) - lt[i][j.first] - 1;
dfs(j.first);
int x = i, pv = -1;
vector<int> v;
int y = -1;
while (x != -1) {
v.emplace_back();
vector<int> curr;
for (auto &i: tree[x]) if (i != pv && i != par[x]) {
v.back() = max(v.back(), sz[i]);
curr.push_back(sz[i]);
}
sort(curr.rbegin(), curr.rend());
if (!curr.empty()) y = max(y, curr[0]);
if ((int)curr.size() > 1) y = max(y, curr[0] + curr[1] - 1);
pv = x;
x = par[x];
}
for (int i = 0; i < (int)v.size(); i++) for (int j = i + 1; j < (int)v.size(); j++) y = max(y, v[i] + v[j] - (j - i - 1));
curr -= y;
one = min(one, curr);
}
printf("%d", min(zero, one));
}
Compilation message
Main.cpp: In function 'int main()':
Main.cpp:63:66: warning: suggest parentheses around arithmetic in operand of '^' [-Wparentheses]
63 | for (int i = 0; i < n; i++) res = min(res, f(i, (1 << n) - 1 ^ 1 << i));
| ~~~~~~~~~^~~
Main.cpp:48:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
48 | scanf("%d%d", &n, &m);
| ~~~~~^~~~~~~~~~~~~~~~
Main.cpp:51:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
51 | scanf("%d%d%d", &x, &y, &w);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
9676 KB |
Output is correct |
2 |
Correct |
5 ms |
9676 KB |
Output is correct |
3 |
Correct |
5 ms |
9676 KB |
Output is correct |
4 |
Correct |
4 ms |
9676 KB |
Output is correct |
5 |
Correct |
5 ms |
9676 KB |
Output is correct |
6 |
Correct |
5 ms |
9676 KB |
Output is correct |
7 |
Correct |
5 ms |
9676 KB |
Output is correct |
8 |
Correct |
4 ms |
9676 KB |
Output is correct |
9 |
Correct |
5 ms |
9708 KB |
Output is correct |
10 |
Correct |
5 ms |
9692 KB |
Output is correct |
11 |
Correct |
5 ms |
9676 KB |
Output is correct |
12 |
Correct |
4 ms |
9676 KB |
Output is correct |
13 |
Correct |
4 ms |
9676 KB |
Output is correct |
14 |
Correct |
4 ms |
9676 KB |
Output is correct |
15 |
Correct |
4 ms |
9676 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
9676 KB |
Output is correct |
2 |
Correct |
5 ms |
9676 KB |
Output is correct |
3 |
Correct |
5 ms |
9676 KB |
Output is correct |
4 |
Correct |
4 ms |
9676 KB |
Output is correct |
5 |
Correct |
5 ms |
9676 KB |
Output is correct |
6 |
Correct |
5 ms |
9676 KB |
Output is correct |
7 |
Correct |
5 ms |
9676 KB |
Output is correct |
8 |
Correct |
4 ms |
9676 KB |
Output is correct |
9 |
Correct |
5 ms |
9708 KB |
Output is correct |
10 |
Correct |
5 ms |
9692 KB |
Output is correct |
11 |
Correct |
5 ms |
9676 KB |
Output is correct |
12 |
Correct |
4 ms |
9676 KB |
Output is correct |
13 |
Correct |
4 ms |
9676 KB |
Output is correct |
14 |
Correct |
4 ms |
9676 KB |
Output is correct |
15 |
Correct |
4 ms |
9676 KB |
Output is correct |
16 |
Correct |
5 ms |
9700 KB |
Output is correct |
17 |
Correct |
4 ms |
9676 KB |
Output is correct |
18 |
Correct |
5 ms |
9676 KB |
Output is correct |
19 |
Correct |
5 ms |
9932 KB |
Output is correct |
20 |
Correct |
6 ms |
11724 KB |
Output is correct |
21 |
Correct |
6 ms |
11724 KB |
Output is correct |
22 |
Correct |
183 ms |
91908 KB |
Output is correct |
23 |
Correct |
43 ms |
48828 KB |
Output is correct |
24 |
Correct |
38 ms |
48832 KB |
Output is correct |
25 |
Correct |
31 ms |
28212 KB |
Output is correct |
26 |
Correct |
54 ms |
28236 KB |
Output is correct |
27 |
Correct |
275 ms |
91912 KB |
Output is correct |
28 |
Correct |
19 ms |
28264 KB |
Output is correct |
29 |
Correct |
29 ms |
28236 KB |
Output is correct |
30 |
Correct |
21 ms |
28184 KB |
Output is correct |
31 |
Correct |
25 ms |
28236 KB |
Output is correct |
32 |
Correct |
11 ms |
11724 KB |
Output is correct |
33 |
Correct |
5 ms |
9676 KB |
Output is correct |
34 |
Correct |
12 ms |
28168 KB |
Output is correct |
35 |
Correct |
12 ms |
28236 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
670 ms |
108484 KB |
Output is correct |
2 |
Correct |
630 ms |
108264 KB |
Output is correct |
3 |
Correct |
683 ms |
108084 KB |
Output is correct |
4 |
Correct |
659 ms |
108216 KB |
Output is correct |
5 |
Correct |
655 ms |
107972 KB |
Output is correct |
6 |
Correct |
245 ms |
107972 KB |
Output is correct |
7 |
Correct |
685 ms |
108312 KB |
Output is correct |
8 |
Correct |
695 ms |
108204 KB |
Output is correct |
9 |
Correct |
673 ms |
108228 KB |
Output is correct |
10 |
Correct |
699 ms |
108072 KB |
Output is correct |
11 |
Correct |
661 ms |
108096 KB |
Output is correct |
12 |
Correct |
623 ms |
107844 KB |
Output is correct |
13 |
Correct |
660 ms |
108356 KB |
Output is correct |
14 |
Correct |
664 ms |
108068 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
9676 KB |
Output is correct |
2 |
Correct |
5 ms |
9676 KB |
Output is correct |
3 |
Correct |
5 ms |
9676 KB |
Output is correct |
4 |
Correct |
4 ms |
9676 KB |
Output is correct |
5 |
Correct |
5 ms |
9676 KB |
Output is correct |
6 |
Correct |
5 ms |
9676 KB |
Output is correct |
7 |
Correct |
5 ms |
9676 KB |
Output is correct |
8 |
Correct |
4 ms |
9676 KB |
Output is correct |
9 |
Correct |
5 ms |
9708 KB |
Output is correct |
10 |
Correct |
5 ms |
9692 KB |
Output is correct |
11 |
Correct |
5 ms |
9676 KB |
Output is correct |
12 |
Correct |
4 ms |
9676 KB |
Output is correct |
13 |
Correct |
4 ms |
9676 KB |
Output is correct |
14 |
Correct |
4 ms |
9676 KB |
Output is correct |
15 |
Correct |
4 ms |
9676 KB |
Output is correct |
16 |
Correct |
5 ms |
9700 KB |
Output is correct |
17 |
Correct |
4 ms |
9676 KB |
Output is correct |
18 |
Correct |
5 ms |
9676 KB |
Output is correct |
19 |
Correct |
5 ms |
9932 KB |
Output is correct |
20 |
Correct |
6 ms |
11724 KB |
Output is correct |
21 |
Correct |
6 ms |
11724 KB |
Output is correct |
22 |
Correct |
183 ms |
91908 KB |
Output is correct |
23 |
Correct |
43 ms |
48828 KB |
Output is correct |
24 |
Correct |
38 ms |
48832 KB |
Output is correct |
25 |
Correct |
31 ms |
28212 KB |
Output is correct |
26 |
Correct |
54 ms |
28236 KB |
Output is correct |
27 |
Correct |
275 ms |
91912 KB |
Output is correct |
28 |
Correct |
19 ms |
28264 KB |
Output is correct |
29 |
Correct |
29 ms |
28236 KB |
Output is correct |
30 |
Correct |
21 ms |
28184 KB |
Output is correct |
31 |
Correct |
25 ms |
28236 KB |
Output is correct |
32 |
Correct |
11 ms |
11724 KB |
Output is correct |
33 |
Correct |
5 ms |
9676 KB |
Output is correct |
34 |
Correct |
12 ms |
28168 KB |
Output is correct |
35 |
Correct |
12 ms |
28236 KB |
Output is correct |
36 |
Correct |
5 ms |
10060 KB |
Output is correct |
37 |
Correct |
8 ms |
10060 KB |
Output is correct |
38 |
Correct |
5 ms |
10060 KB |
Output is correct |
39 |
Correct |
5 ms |
10064 KB |
Output is correct |
40 |
Correct |
6 ms |
10132 KB |
Output is correct |
41 |
Correct |
6 ms |
10060 KB |
Output is correct |
42 |
Correct |
6 ms |
10060 KB |
Output is correct |
43 |
Correct |
5 ms |
10060 KB |
Output is correct |
44 |
Correct |
5 ms |
10060 KB |
Output is correct |
45 |
Correct |
5 ms |
10060 KB |
Output is correct |
46 |
Correct |
5 ms |
10060 KB |
Output is correct |
47 |
Correct |
5 ms |
10060 KB |
Output is correct |
48 |
Correct |
5 ms |
10060 KB |
Output is correct |
49 |
Correct |
5 ms |
10060 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
9676 KB |
Output is correct |
2 |
Correct |
5 ms |
9676 KB |
Output is correct |
3 |
Correct |
5 ms |
9676 KB |
Output is correct |
4 |
Correct |
4 ms |
9676 KB |
Output is correct |
5 |
Correct |
5 ms |
9676 KB |
Output is correct |
6 |
Correct |
5 ms |
9676 KB |
Output is correct |
7 |
Correct |
5 ms |
9676 KB |
Output is correct |
8 |
Correct |
4 ms |
9676 KB |
Output is correct |
9 |
Correct |
5 ms |
9708 KB |
Output is correct |
10 |
Correct |
5 ms |
9692 KB |
Output is correct |
11 |
Correct |
5 ms |
9676 KB |
Output is correct |
12 |
Correct |
4 ms |
9676 KB |
Output is correct |
13 |
Correct |
4 ms |
9676 KB |
Output is correct |
14 |
Correct |
4 ms |
9676 KB |
Output is correct |
15 |
Correct |
4 ms |
9676 KB |
Output is correct |
16 |
Correct |
5 ms |
9700 KB |
Output is correct |
17 |
Correct |
4 ms |
9676 KB |
Output is correct |
18 |
Correct |
5 ms |
9676 KB |
Output is correct |
19 |
Correct |
5 ms |
9932 KB |
Output is correct |
20 |
Correct |
6 ms |
11724 KB |
Output is correct |
21 |
Correct |
6 ms |
11724 KB |
Output is correct |
22 |
Correct |
183 ms |
91908 KB |
Output is correct |
23 |
Correct |
43 ms |
48828 KB |
Output is correct |
24 |
Correct |
38 ms |
48832 KB |
Output is correct |
25 |
Correct |
31 ms |
28212 KB |
Output is correct |
26 |
Correct |
54 ms |
28236 KB |
Output is correct |
27 |
Correct |
275 ms |
91912 KB |
Output is correct |
28 |
Correct |
19 ms |
28264 KB |
Output is correct |
29 |
Correct |
29 ms |
28236 KB |
Output is correct |
30 |
Correct |
21 ms |
28184 KB |
Output is correct |
31 |
Correct |
25 ms |
28236 KB |
Output is correct |
32 |
Correct |
11 ms |
11724 KB |
Output is correct |
33 |
Correct |
5 ms |
9676 KB |
Output is correct |
34 |
Correct |
12 ms |
28168 KB |
Output is correct |
35 |
Correct |
12 ms |
28236 KB |
Output is correct |
36 |
Correct |
5 ms |
10060 KB |
Output is correct |
37 |
Correct |
8 ms |
10060 KB |
Output is correct |
38 |
Correct |
5 ms |
10060 KB |
Output is correct |
39 |
Correct |
5 ms |
10064 KB |
Output is correct |
40 |
Correct |
6 ms |
10132 KB |
Output is correct |
41 |
Correct |
6 ms |
10060 KB |
Output is correct |
42 |
Correct |
6 ms |
10060 KB |
Output is correct |
43 |
Correct |
5 ms |
10060 KB |
Output is correct |
44 |
Correct |
5 ms |
10060 KB |
Output is correct |
45 |
Correct |
5 ms |
10060 KB |
Output is correct |
46 |
Correct |
5 ms |
10060 KB |
Output is correct |
47 |
Correct |
5 ms |
10060 KB |
Output is correct |
48 |
Correct |
5 ms |
10060 KB |
Output is correct |
49 |
Correct |
5 ms |
10060 KB |
Output is correct |
50 |
Correct |
31 ms |
12784 KB |
Output is correct |
51 |
Correct |
54 ms |
12748 KB |
Output is correct |
52 |
Correct |
35 ms |
12748 KB |
Output is correct |
53 |
Correct |
28 ms |
12792 KB |
Output is correct |
54 |
Correct |
23 ms |
12764 KB |
Output is correct |
55 |
Correct |
12 ms |
12748 KB |
Output is correct |
56 |
Correct |
34 ms |
12644 KB |
Output is correct |
57 |
Correct |
30 ms |
12728 KB |
Output is correct |
58 |
Correct |
34 ms |
12748 KB |
Output is correct |
59 |
Correct |
25 ms |
12740 KB |
Output is correct |
60 |
Incorrect |
29 ms |
12620 KB |
Output isn't correct |
61 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
9676 KB |
Output is correct |
2 |
Correct |
5 ms |
9676 KB |
Output is correct |
3 |
Correct |
5 ms |
9676 KB |
Output is correct |
4 |
Correct |
4 ms |
9676 KB |
Output is correct |
5 |
Correct |
5 ms |
9676 KB |
Output is correct |
6 |
Correct |
5 ms |
9676 KB |
Output is correct |
7 |
Correct |
5 ms |
9676 KB |
Output is correct |
8 |
Correct |
4 ms |
9676 KB |
Output is correct |
9 |
Correct |
5 ms |
9708 KB |
Output is correct |
10 |
Correct |
5 ms |
9692 KB |
Output is correct |
11 |
Correct |
5 ms |
9676 KB |
Output is correct |
12 |
Correct |
4 ms |
9676 KB |
Output is correct |
13 |
Correct |
4 ms |
9676 KB |
Output is correct |
14 |
Correct |
4 ms |
9676 KB |
Output is correct |
15 |
Correct |
4 ms |
9676 KB |
Output is correct |
16 |
Correct |
5 ms |
9700 KB |
Output is correct |
17 |
Correct |
4 ms |
9676 KB |
Output is correct |
18 |
Correct |
5 ms |
9676 KB |
Output is correct |
19 |
Correct |
5 ms |
9932 KB |
Output is correct |
20 |
Correct |
6 ms |
11724 KB |
Output is correct |
21 |
Correct |
6 ms |
11724 KB |
Output is correct |
22 |
Correct |
183 ms |
91908 KB |
Output is correct |
23 |
Correct |
43 ms |
48828 KB |
Output is correct |
24 |
Correct |
38 ms |
48832 KB |
Output is correct |
25 |
Correct |
31 ms |
28212 KB |
Output is correct |
26 |
Correct |
54 ms |
28236 KB |
Output is correct |
27 |
Correct |
275 ms |
91912 KB |
Output is correct |
28 |
Correct |
19 ms |
28264 KB |
Output is correct |
29 |
Correct |
29 ms |
28236 KB |
Output is correct |
30 |
Correct |
21 ms |
28184 KB |
Output is correct |
31 |
Correct |
25 ms |
28236 KB |
Output is correct |
32 |
Correct |
11 ms |
11724 KB |
Output is correct |
33 |
Correct |
5 ms |
9676 KB |
Output is correct |
34 |
Correct |
12 ms |
28168 KB |
Output is correct |
35 |
Correct |
12 ms |
28236 KB |
Output is correct |
36 |
Correct |
670 ms |
108484 KB |
Output is correct |
37 |
Correct |
630 ms |
108264 KB |
Output is correct |
38 |
Correct |
683 ms |
108084 KB |
Output is correct |
39 |
Correct |
659 ms |
108216 KB |
Output is correct |
40 |
Correct |
655 ms |
107972 KB |
Output is correct |
41 |
Correct |
245 ms |
107972 KB |
Output is correct |
42 |
Correct |
685 ms |
108312 KB |
Output is correct |
43 |
Correct |
695 ms |
108204 KB |
Output is correct |
44 |
Correct |
673 ms |
108228 KB |
Output is correct |
45 |
Correct |
699 ms |
108072 KB |
Output is correct |
46 |
Correct |
661 ms |
108096 KB |
Output is correct |
47 |
Correct |
623 ms |
107844 KB |
Output is correct |
48 |
Correct |
660 ms |
108356 KB |
Output is correct |
49 |
Correct |
664 ms |
108068 KB |
Output is correct |
50 |
Correct |
5 ms |
10060 KB |
Output is correct |
51 |
Correct |
8 ms |
10060 KB |
Output is correct |
52 |
Correct |
5 ms |
10060 KB |
Output is correct |
53 |
Correct |
5 ms |
10064 KB |
Output is correct |
54 |
Correct |
6 ms |
10132 KB |
Output is correct |
55 |
Correct |
6 ms |
10060 KB |
Output is correct |
56 |
Correct |
6 ms |
10060 KB |
Output is correct |
57 |
Correct |
5 ms |
10060 KB |
Output is correct |
58 |
Correct |
5 ms |
10060 KB |
Output is correct |
59 |
Correct |
5 ms |
10060 KB |
Output is correct |
60 |
Correct |
5 ms |
10060 KB |
Output is correct |
61 |
Correct |
5 ms |
10060 KB |
Output is correct |
62 |
Correct |
5 ms |
10060 KB |
Output is correct |
63 |
Correct |
5 ms |
10060 KB |
Output is correct |
64 |
Correct |
31 ms |
12784 KB |
Output is correct |
65 |
Correct |
54 ms |
12748 KB |
Output is correct |
66 |
Correct |
35 ms |
12748 KB |
Output is correct |
67 |
Correct |
28 ms |
12792 KB |
Output is correct |
68 |
Correct |
23 ms |
12764 KB |
Output is correct |
69 |
Correct |
12 ms |
12748 KB |
Output is correct |
70 |
Correct |
34 ms |
12644 KB |
Output is correct |
71 |
Correct |
30 ms |
12728 KB |
Output is correct |
72 |
Correct |
34 ms |
12748 KB |
Output is correct |
73 |
Correct |
25 ms |
12740 KB |
Output is correct |
74 |
Incorrect |
29 ms |
12620 KB |
Output isn't correct |
75 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
9676 KB |
Output is correct |
2 |
Correct |
5 ms |
9676 KB |
Output is correct |
3 |
Correct |
5 ms |
9676 KB |
Output is correct |
4 |
Correct |
4 ms |
9676 KB |
Output is correct |
5 |
Correct |
5 ms |
9676 KB |
Output is correct |
6 |
Correct |
5 ms |
9676 KB |
Output is correct |
7 |
Correct |
5 ms |
9676 KB |
Output is correct |
8 |
Correct |
4 ms |
9676 KB |
Output is correct |
9 |
Correct |
5 ms |
9708 KB |
Output is correct |
10 |
Correct |
5 ms |
9692 KB |
Output is correct |
11 |
Correct |
5 ms |
9676 KB |
Output is correct |
12 |
Correct |
4 ms |
9676 KB |
Output is correct |
13 |
Correct |
4 ms |
9676 KB |
Output is correct |
14 |
Correct |
4 ms |
9676 KB |
Output is correct |
15 |
Correct |
4 ms |
9676 KB |
Output is correct |
16 |
Correct |
5 ms |
9700 KB |
Output is correct |
17 |
Correct |
4 ms |
9676 KB |
Output is correct |
18 |
Correct |
5 ms |
9676 KB |
Output is correct |
19 |
Correct |
5 ms |
9932 KB |
Output is correct |
20 |
Correct |
6 ms |
11724 KB |
Output is correct |
21 |
Correct |
6 ms |
11724 KB |
Output is correct |
22 |
Correct |
183 ms |
91908 KB |
Output is correct |
23 |
Correct |
43 ms |
48828 KB |
Output is correct |
24 |
Correct |
38 ms |
48832 KB |
Output is correct |
25 |
Correct |
31 ms |
28212 KB |
Output is correct |
26 |
Correct |
54 ms |
28236 KB |
Output is correct |
27 |
Correct |
275 ms |
91912 KB |
Output is correct |
28 |
Correct |
19 ms |
28264 KB |
Output is correct |
29 |
Correct |
29 ms |
28236 KB |
Output is correct |
30 |
Correct |
21 ms |
28184 KB |
Output is correct |
31 |
Correct |
25 ms |
28236 KB |
Output is correct |
32 |
Correct |
11 ms |
11724 KB |
Output is correct |
33 |
Correct |
5 ms |
9676 KB |
Output is correct |
34 |
Correct |
12 ms |
28168 KB |
Output is correct |
35 |
Correct |
12 ms |
28236 KB |
Output is correct |
36 |
Correct |
670 ms |
108484 KB |
Output is correct |
37 |
Correct |
630 ms |
108264 KB |
Output is correct |
38 |
Correct |
683 ms |
108084 KB |
Output is correct |
39 |
Correct |
659 ms |
108216 KB |
Output is correct |
40 |
Correct |
655 ms |
107972 KB |
Output is correct |
41 |
Correct |
245 ms |
107972 KB |
Output is correct |
42 |
Correct |
685 ms |
108312 KB |
Output is correct |
43 |
Correct |
695 ms |
108204 KB |
Output is correct |
44 |
Correct |
673 ms |
108228 KB |
Output is correct |
45 |
Correct |
699 ms |
108072 KB |
Output is correct |
46 |
Correct |
661 ms |
108096 KB |
Output is correct |
47 |
Correct |
623 ms |
107844 KB |
Output is correct |
48 |
Correct |
660 ms |
108356 KB |
Output is correct |
49 |
Correct |
664 ms |
108068 KB |
Output is correct |
50 |
Correct |
5 ms |
10060 KB |
Output is correct |
51 |
Correct |
8 ms |
10060 KB |
Output is correct |
52 |
Correct |
5 ms |
10060 KB |
Output is correct |
53 |
Correct |
5 ms |
10064 KB |
Output is correct |
54 |
Correct |
6 ms |
10132 KB |
Output is correct |
55 |
Correct |
6 ms |
10060 KB |
Output is correct |
56 |
Correct |
6 ms |
10060 KB |
Output is correct |
57 |
Correct |
5 ms |
10060 KB |
Output is correct |
58 |
Correct |
5 ms |
10060 KB |
Output is correct |
59 |
Correct |
5 ms |
10060 KB |
Output is correct |
60 |
Correct |
5 ms |
10060 KB |
Output is correct |
61 |
Correct |
5 ms |
10060 KB |
Output is correct |
62 |
Correct |
5 ms |
10060 KB |
Output is correct |
63 |
Correct |
5 ms |
10060 KB |
Output is correct |
64 |
Correct |
31 ms |
12784 KB |
Output is correct |
65 |
Correct |
54 ms |
12748 KB |
Output is correct |
66 |
Correct |
35 ms |
12748 KB |
Output is correct |
67 |
Correct |
28 ms |
12792 KB |
Output is correct |
68 |
Correct |
23 ms |
12764 KB |
Output is correct |
69 |
Correct |
12 ms |
12748 KB |
Output is correct |
70 |
Correct |
34 ms |
12644 KB |
Output is correct |
71 |
Correct |
30 ms |
12728 KB |
Output is correct |
72 |
Correct |
34 ms |
12748 KB |
Output is correct |
73 |
Correct |
25 ms |
12740 KB |
Output is correct |
74 |
Incorrect |
29 ms |
12620 KB |
Output isn't correct |
75 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
9676 KB |
Output is correct |
2 |
Correct |
5 ms |
9676 KB |
Output is correct |
3 |
Correct |
5 ms |
9676 KB |
Output is correct |
4 |
Correct |
4 ms |
9676 KB |
Output is correct |
5 |
Correct |
5 ms |
9676 KB |
Output is correct |
6 |
Correct |
5 ms |
9676 KB |
Output is correct |
7 |
Correct |
5 ms |
9676 KB |
Output is correct |
8 |
Correct |
4 ms |
9676 KB |
Output is correct |
9 |
Correct |
5 ms |
9708 KB |
Output is correct |
10 |
Correct |
5 ms |
9692 KB |
Output is correct |
11 |
Correct |
5 ms |
9676 KB |
Output is correct |
12 |
Correct |
4 ms |
9676 KB |
Output is correct |
13 |
Correct |
4 ms |
9676 KB |
Output is correct |
14 |
Correct |
4 ms |
9676 KB |
Output is correct |
15 |
Correct |
4 ms |
9676 KB |
Output is correct |
16 |
Correct |
5 ms |
9700 KB |
Output is correct |
17 |
Correct |
4 ms |
9676 KB |
Output is correct |
18 |
Correct |
5 ms |
9676 KB |
Output is correct |
19 |
Correct |
5 ms |
9932 KB |
Output is correct |
20 |
Correct |
6 ms |
11724 KB |
Output is correct |
21 |
Correct |
6 ms |
11724 KB |
Output is correct |
22 |
Correct |
183 ms |
91908 KB |
Output is correct |
23 |
Correct |
43 ms |
48828 KB |
Output is correct |
24 |
Correct |
38 ms |
48832 KB |
Output is correct |
25 |
Correct |
31 ms |
28212 KB |
Output is correct |
26 |
Correct |
54 ms |
28236 KB |
Output is correct |
27 |
Correct |
275 ms |
91912 KB |
Output is correct |
28 |
Correct |
19 ms |
28264 KB |
Output is correct |
29 |
Correct |
29 ms |
28236 KB |
Output is correct |
30 |
Correct |
21 ms |
28184 KB |
Output is correct |
31 |
Correct |
25 ms |
28236 KB |
Output is correct |
32 |
Correct |
11 ms |
11724 KB |
Output is correct |
33 |
Correct |
5 ms |
9676 KB |
Output is correct |
34 |
Correct |
12 ms |
28168 KB |
Output is correct |
35 |
Correct |
12 ms |
28236 KB |
Output is correct |
36 |
Correct |
670 ms |
108484 KB |
Output is correct |
37 |
Correct |
630 ms |
108264 KB |
Output is correct |
38 |
Correct |
683 ms |
108084 KB |
Output is correct |
39 |
Correct |
659 ms |
108216 KB |
Output is correct |
40 |
Correct |
655 ms |
107972 KB |
Output is correct |
41 |
Correct |
245 ms |
107972 KB |
Output is correct |
42 |
Correct |
685 ms |
108312 KB |
Output is correct |
43 |
Correct |
695 ms |
108204 KB |
Output is correct |
44 |
Correct |
673 ms |
108228 KB |
Output is correct |
45 |
Correct |
699 ms |
108072 KB |
Output is correct |
46 |
Correct |
661 ms |
108096 KB |
Output is correct |
47 |
Correct |
623 ms |
107844 KB |
Output is correct |
48 |
Correct |
660 ms |
108356 KB |
Output is correct |
49 |
Correct |
664 ms |
108068 KB |
Output is correct |
50 |
Correct |
5 ms |
10060 KB |
Output is correct |
51 |
Correct |
8 ms |
10060 KB |
Output is correct |
52 |
Correct |
5 ms |
10060 KB |
Output is correct |
53 |
Correct |
5 ms |
10064 KB |
Output is correct |
54 |
Correct |
6 ms |
10132 KB |
Output is correct |
55 |
Correct |
6 ms |
10060 KB |
Output is correct |
56 |
Correct |
6 ms |
10060 KB |
Output is correct |
57 |
Correct |
5 ms |
10060 KB |
Output is correct |
58 |
Correct |
5 ms |
10060 KB |
Output is correct |
59 |
Correct |
5 ms |
10060 KB |
Output is correct |
60 |
Correct |
5 ms |
10060 KB |
Output is correct |
61 |
Correct |
5 ms |
10060 KB |
Output is correct |
62 |
Correct |
5 ms |
10060 KB |
Output is correct |
63 |
Correct |
5 ms |
10060 KB |
Output is correct |
64 |
Correct |
31 ms |
12784 KB |
Output is correct |
65 |
Correct |
54 ms |
12748 KB |
Output is correct |
66 |
Correct |
35 ms |
12748 KB |
Output is correct |
67 |
Correct |
28 ms |
12792 KB |
Output is correct |
68 |
Correct |
23 ms |
12764 KB |
Output is correct |
69 |
Correct |
12 ms |
12748 KB |
Output is correct |
70 |
Correct |
34 ms |
12644 KB |
Output is correct |
71 |
Correct |
30 ms |
12728 KB |
Output is correct |
72 |
Correct |
34 ms |
12748 KB |
Output is correct |
73 |
Correct |
25 ms |
12740 KB |
Output is correct |
74 |
Incorrect |
29 ms |
12620 KB |
Output isn't correct |
75 |
Halted |
0 ms |
0 KB |
- |