#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
struct Edge{
int v, w, i;
Edge(){}
Edge(int _v, int _w, int _i): v(_v), w(_w), i(_i) {}
};
vector<Edge> adj[500500];
int on[2002000], W[2002000], dist[500500];
vector<Edge> E;
vector<int> P, cyc;
bool dfs0(int s, int e, int pa = -1){
cyc.push_back(s);
if (s==e) return 1;
for (auto &v:adj[s]) if (v.v!=pa && on[v.i]){
P.push_back(v.i);
if (dfs0(v.v, e, s)) return 1;
P.pop_back();
cyc.pop_back();
}
return 0;
}
int MX, IDX;
void dfs(int s, int pa = -1, int w = 0){
if (pa==-1) dist[s] = 0;
else dist[s] = dist[pa] + w;
if (dist[s]>MX){
MX = dist[s], IDX = s;
}
for (auto &v:adj[s]) if (v.v!=pa && on[v.i]) dfs(v.v, s, v.w);
}
int cur = 0, ans = 1e9;
int calc(int s, int n){
MX = 0, IDX = s;
dfs(s);
if (MX==0) return 0;
MX = 0;
dfs(IDX);
return MX;
}
int main(){
int n, m;
scanf("%d %d", &n, &m);
for (int i=1;i<=m;i++){
int x, y, z;
scanf("%d %d %d", &x, &y, &z);
adj[x].emplace_back(y, z, i);
adj[y].emplace_back(x, z, i);
W[i] = z;
if (z==1) on[i] = 1, cur++;
else E.emplace_back(x, y, i);
}
ans = min(ans, cur*2 - calc(0, n));
//if (n>500) {printf("%d\n", ans); return 0;}
for (auto &e:E){
P.clear();
cyc.clear();
assert(dfs0(e.v, e.w));
cur += W[e.i];
int len = W[e.i] + P.size();
for (auto &x:P) on[x] = 0;
///cycle
for (auto &x:cyc) ans = min(ans, cur*2 - len - calc(x, n));
///tree
vector<int> deep, mx(cyc.size(), -1e9);
for (auto &x:cyc){
MX = 0, IDX = x;
dfs(x);
deep.push_back(MX);
}
for (int i=(int)cyc.size()-1;i>=0;i--){
if (i+1<(int)cyc.size()) mx[i] = mx[i+1];
mx[i] = max(mx[i], deep[i]-i);
}
for (int i=0;i<(int)cyc.size()-1;i++){
ans = min(ans, (cur-1)*2 - (len + deep[i] + i + mx[i+1]));
}
///
for (auto &x:P) on[x] = 1;
cur -= W[e.i];
}
printf("%d\n", ans);
return 0;
}
Compilation message
Main.cpp: In function 'int main()':
Main.cpp:52:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
52 | scanf("%d %d", &n, &m);
| ~~~~~^~~~~~~~~~~~~~~~~
Main.cpp:55:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
55 | scanf("%d %d %d", &x, &y, &z);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
11980 KB |
Output is correct |
2 |
Correct |
6 ms |
11980 KB |
Output is correct |
3 |
Correct |
6 ms |
11980 KB |
Output is correct |
4 |
Correct |
6 ms |
11980 KB |
Output is correct |
5 |
Correct |
6 ms |
11980 KB |
Output is correct |
6 |
Correct |
6 ms |
11980 KB |
Output is correct |
7 |
Correct |
7 ms |
11980 KB |
Output is correct |
8 |
Correct |
6 ms |
12072 KB |
Output is correct |
9 |
Correct |
6 ms |
12036 KB |
Output is correct |
10 |
Correct |
6 ms |
11980 KB |
Output is correct |
11 |
Correct |
7 ms |
11980 KB |
Output is correct |
12 |
Correct |
6 ms |
12076 KB |
Output is correct |
13 |
Correct |
6 ms |
11980 KB |
Output is correct |
14 |
Correct |
7 ms |
12076 KB |
Output is correct |
15 |
Correct |
6 ms |
11980 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
11980 KB |
Output is correct |
2 |
Correct |
6 ms |
11980 KB |
Output is correct |
3 |
Correct |
6 ms |
11980 KB |
Output is correct |
4 |
Correct |
6 ms |
11980 KB |
Output is correct |
5 |
Correct |
6 ms |
11980 KB |
Output is correct |
6 |
Correct |
6 ms |
11980 KB |
Output is correct |
7 |
Correct |
7 ms |
11980 KB |
Output is correct |
8 |
Correct |
6 ms |
12072 KB |
Output is correct |
9 |
Correct |
6 ms |
12036 KB |
Output is correct |
10 |
Correct |
6 ms |
11980 KB |
Output is correct |
11 |
Correct |
7 ms |
11980 KB |
Output is correct |
12 |
Correct |
6 ms |
12076 KB |
Output is correct |
13 |
Correct |
6 ms |
11980 KB |
Output is correct |
14 |
Correct |
7 ms |
12076 KB |
Output is correct |
15 |
Correct |
6 ms |
11980 KB |
Output is correct |
16 |
Correct |
6 ms |
11980 KB |
Output is correct |
17 |
Correct |
6 ms |
11980 KB |
Output is correct |
18 |
Correct |
6 ms |
11980 KB |
Output is correct |
19 |
Correct |
6 ms |
12064 KB |
Output is correct |
20 |
Correct |
6 ms |
12072 KB |
Output is correct |
21 |
Correct |
6 ms |
11980 KB |
Output is correct |
22 |
Correct |
7 ms |
12032 KB |
Output is correct |
23 |
Correct |
6 ms |
11980 KB |
Output is correct |
24 |
Correct |
6 ms |
11980 KB |
Output is correct |
25 |
Correct |
6 ms |
11980 KB |
Output is correct |
26 |
Correct |
6 ms |
11980 KB |
Output is correct |
27 |
Correct |
6 ms |
11980 KB |
Output is correct |
28 |
Correct |
7 ms |
12008 KB |
Output is correct |
29 |
Correct |
6 ms |
11980 KB |
Output is correct |
30 |
Correct |
6 ms |
11976 KB |
Output is correct |
31 |
Correct |
6 ms |
12068 KB |
Output is correct |
32 |
Correct |
7 ms |
11980 KB |
Output is correct |
33 |
Correct |
7 ms |
11980 KB |
Output is correct |
34 |
Correct |
6 ms |
11980 KB |
Output is correct |
35 |
Correct |
6 ms |
12032 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2806 ms |
13060 KB |
Output is correct |
2 |
Correct |
2435 ms |
13048 KB |
Output is correct |
3 |
Correct |
2538 ms |
12852 KB |
Output is correct |
4 |
Correct |
2739 ms |
12868 KB |
Output is correct |
5 |
Correct |
2624 ms |
12876 KB |
Output is correct |
6 |
Correct |
2267 ms |
12620 KB |
Output is correct |
7 |
Correct |
2084 ms |
13020 KB |
Output is correct |
8 |
Correct |
2566 ms |
12748 KB |
Output is correct |
9 |
Correct |
2451 ms |
12956 KB |
Output is correct |
10 |
Correct |
2889 ms |
13000 KB |
Output is correct |
11 |
Correct |
2747 ms |
13004 KB |
Output is correct |
12 |
Correct |
2023 ms |
12748 KB |
Output is correct |
13 |
Correct |
2776 ms |
12996 KB |
Output is correct |
14 |
Correct |
2782 ms |
12892 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
11980 KB |
Output is correct |
2 |
Correct |
6 ms |
11980 KB |
Output is correct |
3 |
Correct |
6 ms |
11980 KB |
Output is correct |
4 |
Correct |
6 ms |
11980 KB |
Output is correct |
5 |
Correct |
6 ms |
11980 KB |
Output is correct |
6 |
Correct |
6 ms |
11980 KB |
Output is correct |
7 |
Correct |
7 ms |
11980 KB |
Output is correct |
8 |
Correct |
6 ms |
12072 KB |
Output is correct |
9 |
Correct |
6 ms |
12036 KB |
Output is correct |
10 |
Correct |
6 ms |
11980 KB |
Output is correct |
11 |
Correct |
7 ms |
11980 KB |
Output is correct |
12 |
Correct |
6 ms |
12076 KB |
Output is correct |
13 |
Correct |
6 ms |
11980 KB |
Output is correct |
14 |
Correct |
7 ms |
12076 KB |
Output is correct |
15 |
Correct |
6 ms |
11980 KB |
Output is correct |
16 |
Correct |
6 ms |
11980 KB |
Output is correct |
17 |
Correct |
6 ms |
11980 KB |
Output is correct |
18 |
Correct |
6 ms |
11980 KB |
Output is correct |
19 |
Correct |
6 ms |
12064 KB |
Output is correct |
20 |
Correct |
6 ms |
12072 KB |
Output is correct |
21 |
Correct |
6 ms |
11980 KB |
Output is correct |
22 |
Correct |
7 ms |
12032 KB |
Output is correct |
23 |
Correct |
6 ms |
11980 KB |
Output is correct |
24 |
Correct |
6 ms |
11980 KB |
Output is correct |
25 |
Correct |
6 ms |
11980 KB |
Output is correct |
26 |
Correct |
6 ms |
11980 KB |
Output is correct |
27 |
Correct |
6 ms |
11980 KB |
Output is correct |
28 |
Correct |
7 ms |
12008 KB |
Output is correct |
29 |
Correct |
6 ms |
11980 KB |
Output is correct |
30 |
Correct |
6 ms |
11976 KB |
Output is correct |
31 |
Correct |
6 ms |
12068 KB |
Output is correct |
32 |
Correct |
7 ms |
11980 KB |
Output is correct |
33 |
Correct |
7 ms |
11980 KB |
Output is correct |
34 |
Correct |
6 ms |
11980 KB |
Output is correct |
35 |
Correct |
6 ms |
12032 KB |
Output is correct |
36 |
Correct |
7 ms |
11980 KB |
Output is correct |
37 |
Correct |
7 ms |
11980 KB |
Output is correct |
38 |
Correct |
7 ms |
11980 KB |
Output is correct |
39 |
Correct |
7 ms |
12032 KB |
Output is correct |
40 |
Correct |
7 ms |
11980 KB |
Output is correct |
41 |
Correct |
8 ms |
11980 KB |
Output is correct |
42 |
Correct |
8 ms |
11980 KB |
Output is correct |
43 |
Correct |
8 ms |
12076 KB |
Output is correct |
44 |
Correct |
7 ms |
11980 KB |
Output is correct |
45 |
Correct |
7 ms |
11980 KB |
Output is correct |
46 |
Correct |
8 ms |
11980 KB |
Output is correct |
47 |
Correct |
7 ms |
11980 KB |
Output is correct |
48 |
Correct |
7 ms |
11980 KB |
Output is correct |
49 |
Correct |
7 ms |
12032 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
11980 KB |
Output is correct |
2 |
Correct |
6 ms |
11980 KB |
Output is correct |
3 |
Correct |
6 ms |
11980 KB |
Output is correct |
4 |
Correct |
6 ms |
11980 KB |
Output is correct |
5 |
Correct |
6 ms |
11980 KB |
Output is correct |
6 |
Correct |
6 ms |
11980 KB |
Output is correct |
7 |
Correct |
7 ms |
11980 KB |
Output is correct |
8 |
Correct |
6 ms |
12072 KB |
Output is correct |
9 |
Correct |
6 ms |
12036 KB |
Output is correct |
10 |
Correct |
6 ms |
11980 KB |
Output is correct |
11 |
Correct |
7 ms |
11980 KB |
Output is correct |
12 |
Correct |
6 ms |
12076 KB |
Output is correct |
13 |
Correct |
6 ms |
11980 KB |
Output is correct |
14 |
Correct |
7 ms |
12076 KB |
Output is correct |
15 |
Correct |
6 ms |
11980 KB |
Output is correct |
16 |
Correct |
6 ms |
11980 KB |
Output is correct |
17 |
Correct |
6 ms |
11980 KB |
Output is correct |
18 |
Correct |
6 ms |
11980 KB |
Output is correct |
19 |
Correct |
6 ms |
12064 KB |
Output is correct |
20 |
Correct |
6 ms |
12072 KB |
Output is correct |
21 |
Correct |
6 ms |
11980 KB |
Output is correct |
22 |
Correct |
7 ms |
12032 KB |
Output is correct |
23 |
Correct |
6 ms |
11980 KB |
Output is correct |
24 |
Correct |
6 ms |
11980 KB |
Output is correct |
25 |
Correct |
6 ms |
11980 KB |
Output is correct |
26 |
Correct |
6 ms |
11980 KB |
Output is correct |
27 |
Correct |
6 ms |
11980 KB |
Output is correct |
28 |
Correct |
7 ms |
12008 KB |
Output is correct |
29 |
Correct |
6 ms |
11980 KB |
Output is correct |
30 |
Correct |
6 ms |
11976 KB |
Output is correct |
31 |
Correct |
6 ms |
12068 KB |
Output is correct |
32 |
Correct |
7 ms |
11980 KB |
Output is correct |
33 |
Correct |
7 ms |
11980 KB |
Output is correct |
34 |
Correct |
6 ms |
11980 KB |
Output is correct |
35 |
Correct |
6 ms |
12032 KB |
Output is correct |
36 |
Correct |
7 ms |
11980 KB |
Output is correct |
37 |
Correct |
7 ms |
11980 KB |
Output is correct |
38 |
Correct |
7 ms |
11980 KB |
Output is correct |
39 |
Correct |
7 ms |
12032 KB |
Output is correct |
40 |
Correct |
7 ms |
11980 KB |
Output is correct |
41 |
Correct |
8 ms |
11980 KB |
Output is correct |
42 |
Correct |
8 ms |
11980 KB |
Output is correct |
43 |
Correct |
8 ms |
12076 KB |
Output is correct |
44 |
Correct |
7 ms |
11980 KB |
Output is correct |
45 |
Correct |
7 ms |
11980 KB |
Output is correct |
46 |
Correct |
8 ms |
11980 KB |
Output is correct |
47 |
Correct |
7 ms |
11980 KB |
Output is correct |
48 |
Correct |
7 ms |
11980 KB |
Output is correct |
49 |
Correct |
7 ms |
12032 KB |
Output is correct |
50 |
Correct |
26 ms |
12184 KB |
Output is correct |
51 |
Correct |
22 ms |
12108 KB |
Output is correct |
52 |
Correct |
22 ms |
12164 KB |
Output is correct |
53 |
Correct |
24 ms |
12108 KB |
Output is correct |
54 |
Correct |
23 ms |
12136 KB |
Output is correct |
55 |
Correct |
19 ms |
12052 KB |
Output is correct |
56 |
Correct |
22 ms |
12168 KB |
Output is correct |
57 |
Correct |
27 ms |
12112 KB |
Output is correct |
58 |
Correct |
24 ms |
12168 KB |
Output is correct |
59 |
Correct |
23 ms |
12160 KB |
Output is correct |
60 |
Correct |
23 ms |
12108 KB |
Output is correct |
61 |
Correct |
22 ms |
12140 KB |
Output is correct |
62 |
Correct |
9 ms |
12108 KB |
Output is correct |
63 |
Correct |
8 ms |
12124 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
11980 KB |
Output is correct |
2 |
Correct |
6 ms |
11980 KB |
Output is correct |
3 |
Correct |
6 ms |
11980 KB |
Output is correct |
4 |
Correct |
6 ms |
11980 KB |
Output is correct |
5 |
Correct |
6 ms |
11980 KB |
Output is correct |
6 |
Correct |
6 ms |
11980 KB |
Output is correct |
7 |
Correct |
7 ms |
11980 KB |
Output is correct |
8 |
Correct |
6 ms |
12072 KB |
Output is correct |
9 |
Correct |
6 ms |
12036 KB |
Output is correct |
10 |
Correct |
6 ms |
11980 KB |
Output is correct |
11 |
Correct |
7 ms |
11980 KB |
Output is correct |
12 |
Correct |
6 ms |
12076 KB |
Output is correct |
13 |
Correct |
6 ms |
11980 KB |
Output is correct |
14 |
Correct |
7 ms |
12076 KB |
Output is correct |
15 |
Correct |
6 ms |
11980 KB |
Output is correct |
16 |
Correct |
6 ms |
11980 KB |
Output is correct |
17 |
Correct |
6 ms |
11980 KB |
Output is correct |
18 |
Correct |
6 ms |
11980 KB |
Output is correct |
19 |
Correct |
6 ms |
12064 KB |
Output is correct |
20 |
Correct |
6 ms |
12072 KB |
Output is correct |
21 |
Correct |
6 ms |
11980 KB |
Output is correct |
22 |
Correct |
7 ms |
12032 KB |
Output is correct |
23 |
Correct |
6 ms |
11980 KB |
Output is correct |
24 |
Correct |
6 ms |
11980 KB |
Output is correct |
25 |
Correct |
6 ms |
11980 KB |
Output is correct |
26 |
Correct |
6 ms |
11980 KB |
Output is correct |
27 |
Correct |
6 ms |
11980 KB |
Output is correct |
28 |
Correct |
7 ms |
12008 KB |
Output is correct |
29 |
Correct |
6 ms |
11980 KB |
Output is correct |
30 |
Correct |
6 ms |
11976 KB |
Output is correct |
31 |
Correct |
6 ms |
12068 KB |
Output is correct |
32 |
Correct |
7 ms |
11980 KB |
Output is correct |
33 |
Correct |
7 ms |
11980 KB |
Output is correct |
34 |
Correct |
6 ms |
11980 KB |
Output is correct |
35 |
Correct |
6 ms |
12032 KB |
Output is correct |
36 |
Correct |
2806 ms |
13060 KB |
Output is correct |
37 |
Correct |
2435 ms |
13048 KB |
Output is correct |
38 |
Correct |
2538 ms |
12852 KB |
Output is correct |
39 |
Correct |
2739 ms |
12868 KB |
Output is correct |
40 |
Correct |
2624 ms |
12876 KB |
Output is correct |
41 |
Correct |
2267 ms |
12620 KB |
Output is correct |
42 |
Correct |
2084 ms |
13020 KB |
Output is correct |
43 |
Correct |
2566 ms |
12748 KB |
Output is correct |
44 |
Correct |
2451 ms |
12956 KB |
Output is correct |
45 |
Correct |
2889 ms |
13000 KB |
Output is correct |
46 |
Correct |
2747 ms |
13004 KB |
Output is correct |
47 |
Correct |
2023 ms |
12748 KB |
Output is correct |
48 |
Correct |
2776 ms |
12996 KB |
Output is correct |
49 |
Correct |
2782 ms |
12892 KB |
Output is correct |
50 |
Correct |
7 ms |
11980 KB |
Output is correct |
51 |
Correct |
7 ms |
11980 KB |
Output is correct |
52 |
Correct |
7 ms |
11980 KB |
Output is correct |
53 |
Correct |
7 ms |
12032 KB |
Output is correct |
54 |
Correct |
7 ms |
11980 KB |
Output is correct |
55 |
Correct |
8 ms |
11980 KB |
Output is correct |
56 |
Correct |
8 ms |
11980 KB |
Output is correct |
57 |
Correct |
8 ms |
12076 KB |
Output is correct |
58 |
Correct |
7 ms |
11980 KB |
Output is correct |
59 |
Correct |
7 ms |
11980 KB |
Output is correct |
60 |
Correct |
8 ms |
11980 KB |
Output is correct |
61 |
Correct |
7 ms |
11980 KB |
Output is correct |
62 |
Correct |
7 ms |
11980 KB |
Output is correct |
63 |
Correct |
7 ms |
12032 KB |
Output is correct |
64 |
Correct |
26 ms |
12184 KB |
Output is correct |
65 |
Correct |
22 ms |
12108 KB |
Output is correct |
66 |
Correct |
22 ms |
12164 KB |
Output is correct |
67 |
Correct |
24 ms |
12108 KB |
Output is correct |
68 |
Correct |
23 ms |
12136 KB |
Output is correct |
69 |
Correct |
19 ms |
12052 KB |
Output is correct |
70 |
Correct |
22 ms |
12168 KB |
Output is correct |
71 |
Correct |
27 ms |
12112 KB |
Output is correct |
72 |
Correct |
24 ms |
12168 KB |
Output is correct |
73 |
Correct |
23 ms |
12160 KB |
Output is correct |
74 |
Correct |
23 ms |
12108 KB |
Output is correct |
75 |
Correct |
22 ms |
12140 KB |
Output is correct |
76 |
Correct |
9 ms |
12108 KB |
Output is correct |
77 |
Correct |
8 ms |
12124 KB |
Output is correct |
78 |
Correct |
3069 ms |
13076 KB |
Output is correct |
79 |
Correct |
2454 ms |
13036 KB |
Output is correct |
80 |
Correct |
2652 ms |
12876 KB |
Output is correct |
81 |
Correct |
2668 ms |
12924 KB |
Output is correct |
82 |
Correct |
2631 ms |
12864 KB |
Output is correct |
83 |
Correct |
2189 ms |
12868 KB |
Output is correct |
84 |
Correct |
2121 ms |
13296 KB |
Output is correct |
85 |
Correct |
3208 ms |
12992 KB |
Output is correct |
86 |
Correct |
2666 ms |
13188 KB |
Output is correct |
87 |
Correct |
2656 ms |
12916 KB |
Output is correct |
88 |
Correct |
2721 ms |
12976 KB |
Output is correct |
89 |
Correct |
1964 ms |
12932 KB |
Output is correct |
90 |
Correct |
279 ms |
12628 KB |
Output is correct |
91 |
Correct |
296 ms |
12580 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
11980 KB |
Output is correct |
2 |
Correct |
6 ms |
11980 KB |
Output is correct |
3 |
Correct |
6 ms |
11980 KB |
Output is correct |
4 |
Correct |
6 ms |
11980 KB |
Output is correct |
5 |
Correct |
6 ms |
11980 KB |
Output is correct |
6 |
Correct |
6 ms |
11980 KB |
Output is correct |
7 |
Correct |
7 ms |
11980 KB |
Output is correct |
8 |
Correct |
6 ms |
12072 KB |
Output is correct |
9 |
Correct |
6 ms |
12036 KB |
Output is correct |
10 |
Correct |
6 ms |
11980 KB |
Output is correct |
11 |
Correct |
7 ms |
11980 KB |
Output is correct |
12 |
Correct |
6 ms |
12076 KB |
Output is correct |
13 |
Correct |
6 ms |
11980 KB |
Output is correct |
14 |
Correct |
7 ms |
12076 KB |
Output is correct |
15 |
Correct |
6 ms |
11980 KB |
Output is correct |
16 |
Correct |
6 ms |
11980 KB |
Output is correct |
17 |
Correct |
6 ms |
11980 KB |
Output is correct |
18 |
Correct |
6 ms |
11980 KB |
Output is correct |
19 |
Correct |
6 ms |
12064 KB |
Output is correct |
20 |
Correct |
6 ms |
12072 KB |
Output is correct |
21 |
Correct |
6 ms |
11980 KB |
Output is correct |
22 |
Correct |
7 ms |
12032 KB |
Output is correct |
23 |
Correct |
6 ms |
11980 KB |
Output is correct |
24 |
Correct |
6 ms |
11980 KB |
Output is correct |
25 |
Correct |
6 ms |
11980 KB |
Output is correct |
26 |
Correct |
6 ms |
11980 KB |
Output is correct |
27 |
Correct |
6 ms |
11980 KB |
Output is correct |
28 |
Correct |
7 ms |
12008 KB |
Output is correct |
29 |
Correct |
6 ms |
11980 KB |
Output is correct |
30 |
Correct |
6 ms |
11976 KB |
Output is correct |
31 |
Correct |
6 ms |
12068 KB |
Output is correct |
32 |
Correct |
7 ms |
11980 KB |
Output is correct |
33 |
Correct |
7 ms |
11980 KB |
Output is correct |
34 |
Correct |
6 ms |
11980 KB |
Output is correct |
35 |
Correct |
6 ms |
12032 KB |
Output is correct |
36 |
Correct |
2806 ms |
13060 KB |
Output is correct |
37 |
Correct |
2435 ms |
13048 KB |
Output is correct |
38 |
Correct |
2538 ms |
12852 KB |
Output is correct |
39 |
Correct |
2739 ms |
12868 KB |
Output is correct |
40 |
Correct |
2624 ms |
12876 KB |
Output is correct |
41 |
Correct |
2267 ms |
12620 KB |
Output is correct |
42 |
Correct |
2084 ms |
13020 KB |
Output is correct |
43 |
Correct |
2566 ms |
12748 KB |
Output is correct |
44 |
Correct |
2451 ms |
12956 KB |
Output is correct |
45 |
Correct |
2889 ms |
13000 KB |
Output is correct |
46 |
Correct |
2747 ms |
13004 KB |
Output is correct |
47 |
Correct |
2023 ms |
12748 KB |
Output is correct |
48 |
Correct |
2776 ms |
12996 KB |
Output is correct |
49 |
Correct |
2782 ms |
12892 KB |
Output is correct |
50 |
Correct |
7 ms |
11980 KB |
Output is correct |
51 |
Correct |
7 ms |
11980 KB |
Output is correct |
52 |
Correct |
7 ms |
11980 KB |
Output is correct |
53 |
Correct |
7 ms |
12032 KB |
Output is correct |
54 |
Correct |
7 ms |
11980 KB |
Output is correct |
55 |
Correct |
8 ms |
11980 KB |
Output is correct |
56 |
Correct |
8 ms |
11980 KB |
Output is correct |
57 |
Correct |
8 ms |
12076 KB |
Output is correct |
58 |
Correct |
7 ms |
11980 KB |
Output is correct |
59 |
Correct |
7 ms |
11980 KB |
Output is correct |
60 |
Correct |
8 ms |
11980 KB |
Output is correct |
61 |
Correct |
7 ms |
11980 KB |
Output is correct |
62 |
Correct |
7 ms |
11980 KB |
Output is correct |
63 |
Correct |
7 ms |
12032 KB |
Output is correct |
64 |
Correct |
26 ms |
12184 KB |
Output is correct |
65 |
Correct |
22 ms |
12108 KB |
Output is correct |
66 |
Correct |
22 ms |
12164 KB |
Output is correct |
67 |
Correct |
24 ms |
12108 KB |
Output is correct |
68 |
Correct |
23 ms |
12136 KB |
Output is correct |
69 |
Correct |
19 ms |
12052 KB |
Output is correct |
70 |
Correct |
22 ms |
12168 KB |
Output is correct |
71 |
Correct |
27 ms |
12112 KB |
Output is correct |
72 |
Correct |
24 ms |
12168 KB |
Output is correct |
73 |
Correct |
23 ms |
12160 KB |
Output is correct |
74 |
Correct |
23 ms |
12108 KB |
Output is correct |
75 |
Correct |
22 ms |
12140 KB |
Output is correct |
76 |
Correct |
9 ms |
12108 KB |
Output is correct |
77 |
Correct |
8 ms |
12124 KB |
Output is correct |
78 |
Correct |
3069 ms |
13076 KB |
Output is correct |
79 |
Correct |
2454 ms |
13036 KB |
Output is correct |
80 |
Correct |
2652 ms |
12876 KB |
Output is correct |
81 |
Correct |
2668 ms |
12924 KB |
Output is correct |
82 |
Correct |
2631 ms |
12864 KB |
Output is correct |
83 |
Correct |
2189 ms |
12868 KB |
Output is correct |
84 |
Correct |
2121 ms |
13296 KB |
Output is correct |
85 |
Correct |
3208 ms |
12992 KB |
Output is correct |
86 |
Correct |
2666 ms |
13188 KB |
Output is correct |
87 |
Correct |
2656 ms |
12916 KB |
Output is correct |
88 |
Correct |
2721 ms |
12976 KB |
Output is correct |
89 |
Correct |
1964 ms |
12932 KB |
Output is correct |
90 |
Correct |
279 ms |
12628 KB |
Output is correct |
91 |
Correct |
296 ms |
12580 KB |
Output is correct |
92 |
Execution timed out |
7066 ms |
26156 KB |
Time limit exceeded |
93 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
11980 KB |
Output is correct |
2 |
Correct |
6 ms |
11980 KB |
Output is correct |
3 |
Correct |
6 ms |
11980 KB |
Output is correct |
4 |
Correct |
6 ms |
11980 KB |
Output is correct |
5 |
Correct |
6 ms |
11980 KB |
Output is correct |
6 |
Correct |
6 ms |
11980 KB |
Output is correct |
7 |
Correct |
7 ms |
11980 KB |
Output is correct |
8 |
Correct |
6 ms |
12072 KB |
Output is correct |
9 |
Correct |
6 ms |
12036 KB |
Output is correct |
10 |
Correct |
6 ms |
11980 KB |
Output is correct |
11 |
Correct |
7 ms |
11980 KB |
Output is correct |
12 |
Correct |
6 ms |
12076 KB |
Output is correct |
13 |
Correct |
6 ms |
11980 KB |
Output is correct |
14 |
Correct |
7 ms |
12076 KB |
Output is correct |
15 |
Correct |
6 ms |
11980 KB |
Output is correct |
16 |
Correct |
6 ms |
11980 KB |
Output is correct |
17 |
Correct |
6 ms |
11980 KB |
Output is correct |
18 |
Correct |
6 ms |
11980 KB |
Output is correct |
19 |
Correct |
6 ms |
12064 KB |
Output is correct |
20 |
Correct |
6 ms |
12072 KB |
Output is correct |
21 |
Correct |
6 ms |
11980 KB |
Output is correct |
22 |
Correct |
7 ms |
12032 KB |
Output is correct |
23 |
Correct |
6 ms |
11980 KB |
Output is correct |
24 |
Correct |
6 ms |
11980 KB |
Output is correct |
25 |
Correct |
6 ms |
11980 KB |
Output is correct |
26 |
Correct |
6 ms |
11980 KB |
Output is correct |
27 |
Correct |
6 ms |
11980 KB |
Output is correct |
28 |
Correct |
7 ms |
12008 KB |
Output is correct |
29 |
Correct |
6 ms |
11980 KB |
Output is correct |
30 |
Correct |
6 ms |
11976 KB |
Output is correct |
31 |
Correct |
6 ms |
12068 KB |
Output is correct |
32 |
Correct |
7 ms |
11980 KB |
Output is correct |
33 |
Correct |
7 ms |
11980 KB |
Output is correct |
34 |
Correct |
6 ms |
11980 KB |
Output is correct |
35 |
Correct |
6 ms |
12032 KB |
Output is correct |
36 |
Correct |
2806 ms |
13060 KB |
Output is correct |
37 |
Correct |
2435 ms |
13048 KB |
Output is correct |
38 |
Correct |
2538 ms |
12852 KB |
Output is correct |
39 |
Correct |
2739 ms |
12868 KB |
Output is correct |
40 |
Correct |
2624 ms |
12876 KB |
Output is correct |
41 |
Correct |
2267 ms |
12620 KB |
Output is correct |
42 |
Correct |
2084 ms |
13020 KB |
Output is correct |
43 |
Correct |
2566 ms |
12748 KB |
Output is correct |
44 |
Correct |
2451 ms |
12956 KB |
Output is correct |
45 |
Correct |
2889 ms |
13000 KB |
Output is correct |
46 |
Correct |
2747 ms |
13004 KB |
Output is correct |
47 |
Correct |
2023 ms |
12748 KB |
Output is correct |
48 |
Correct |
2776 ms |
12996 KB |
Output is correct |
49 |
Correct |
2782 ms |
12892 KB |
Output is correct |
50 |
Correct |
7 ms |
11980 KB |
Output is correct |
51 |
Correct |
7 ms |
11980 KB |
Output is correct |
52 |
Correct |
7 ms |
11980 KB |
Output is correct |
53 |
Correct |
7 ms |
12032 KB |
Output is correct |
54 |
Correct |
7 ms |
11980 KB |
Output is correct |
55 |
Correct |
8 ms |
11980 KB |
Output is correct |
56 |
Correct |
8 ms |
11980 KB |
Output is correct |
57 |
Correct |
8 ms |
12076 KB |
Output is correct |
58 |
Correct |
7 ms |
11980 KB |
Output is correct |
59 |
Correct |
7 ms |
11980 KB |
Output is correct |
60 |
Correct |
8 ms |
11980 KB |
Output is correct |
61 |
Correct |
7 ms |
11980 KB |
Output is correct |
62 |
Correct |
7 ms |
11980 KB |
Output is correct |
63 |
Correct |
7 ms |
12032 KB |
Output is correct |
64 |
Correct |
26 ms |
12184 KB |
Output is correct |
65 |
Correct |
22 ms |
12108 KB |
Output is correct |
66 |
Correct |
22 ms |
12164 KB |
Output is correct |
67 |
Correct |
24 ms |
12108 KB |
Output is correct |
68 |
Correct |
23 ms |
12136 KB |
Output is correct |
69 |
Correct |
19 ms |
12052 KB |
Output is correct |
70 |
Correct |
22 ms |
12168 KB |
Output is correct |
71 |
Correct |
27 ms |
12112 KB |
Output is correct |
72 |
Correct |
24 ms |
12168 KB |
Output is correct |
73 |
Correct |
23 ms |
12160 KB |
Output is correct |
74 |
Correct |
23 ms |
12108 KB |
Output is correct |
75 |
Correct |
22 ms |
12140 KB |
Output is correct |
76 |
Correct |
9 ms |
12108 KB |
Output is correct |
77 |
Correct |
8 ms |
12124 KB |
Output is correct |
78 |
Correct |
3069 ms |
13076 KB |
Output is correct |
79 |
Correct |
2454 ms |
13036 KB |
Output is correct |
80 |
Correct |
2652 ms |
12876 KB |
Output is correct |
81 |
Correct |
2668 ms |
12924 KB |
Output is correct |
82 |
Correct |
2631 ms |
12864 KB |
Output is correct |
83 |
Correct |
2189 ms |
12868 KB |
Output is correct |
84 |
Correct |
2121 ms |
13296 KB |
Output is correct |
85 |
Correct |
3208 ms |
12992 KB |
Output is correct |
86 |
Correct |
2666 ms |
13188 KB |
Output is correct |
87 |
Correct |
2656 ms |
12916 KB |
Output is correct |
88 |
Correct |
2721 ms |
12976 KB |
Output is correct |
89 |
Correct |
1964 ms |
12932 KB |
Output is correct |
90 |
Correct |
279 ms |
12628 KB |
Output is correct |
91 |
Correct |
296 ms |
12580 KB |
Output is correct |
92 |
Execution timed out |
7066 ms |
26156 KB |
Time limit exceeded |
93 |
Halted |
0 ms |
0 KB |
- |