답안 #525282

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
525282 2022-02-11T08:58:04 Z qwerasdfzxcl Mountains and Valleys (CCO20_day1problem3) C++14
13 / 25
4237 ms 12960 KB
#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();
    }
    return 0;
}
 
void dfs(int s, int pa = -1, int w = 0){
    if (pa==-1) dist[s] = 0;
    else dist[s] = dist[pa] + w;
    for (auto &v:adj[s]) if (v.v!=pa && on[v.i]) dfs(v.v, s, v.w);
}
 
int cur = 0, ans = 1e9, m;
int calc(int s, int n){
    fill(dist, dist+n, 0);
    dfs(s);
    if (*max_element(dist, dist+n)==0) return 0;
 
    dfs(max_element(dist, dist+n)-dist);
 
    return *max_element(dist, dist+n);
}
 
int main(){
    int n;
    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));
 
        on[e.i] = 1, cur += W[e.i];
 
        for (auto &x:P){
            on[x] = 0, cur -= W[x];
            ans = min(ans, cur*2 - calc(0, n));
            on[x] = 1, cur += W[x];
        }
 
        ///cycle
        on[e.i] = 0;
        vector<int> deep;
 
        int len = W[e.i] + P.size();
 
        for (auto &x:P) on[x] = 0;
        for (auto &x:cyc){
            fill(dist, dist+n, 0);
            dfs(x);
            deep.push_back(*max_element(dist, dist+n));
            ans = min(ans, cur*2-len-calc(x, n));
            //printf("%d: %d\n", x, calc(x, n));
            //for (int i=1;i<=9;i++) printf("%d", on[i]);
            //printf("\n");
        }
 
 
        for (int i=0;i<(int)cyc.size();i++){
            int clen = 0;
            for (int j=i+1;j<(int)cyc.size();j++){
                clen++;
                //ans = min(ans, cur*2 - (max(clen, len-clen) + deep[i] + deep[j]));
            }
        }
 
        ///
 
        for (auto &x:P) on[x] = 1;
 
        on[e.i] = 0, cur -= W[e.i];
    }
 
    printf("%d\n", ans);
    return 0;
}

Compilation message

Main.cpp: In function 'int main()':
Main.cpp:45:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   45 |     scanf("%d %d", &n, &m);
      |     ~~~~~^~~~~~~~~~~~~~~~~
Main.cpp:48:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   48 |         scanf("%d %d %d", &x, &y, &z);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 11980 KB Output is correct
2 Correct 6 ms 11980 KB Output is correct
3 Correct 6 ms 12032 KB Output is correct
4 Correct 7 ms 11980 KB Output is correct
5 Correct 7 ms 12052 KB Output is correct
6 Correct 6 ms 11964 KB Output is correct
7 Correct 7 ms 11980 KB Output is correct
8 Correct 7 ms 11980 KB Output is correct
9 Correct 7 ms 11980 KB Output is correct
10 Correct 7 ms 11980 KB Output is correct
11 Correct 9 ms 12076 KB Output is correct
12 Correct 8 ms 11980 KB Output is correct
13 Correct 6 ms 11980 KB Output is correct
14 Correct 6 ms 11980 KB Output is correct
15 Correct 7 ms 12052 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 11980 KB Output is correct
2 Correct 6 ms 11980 KB Output is correct
3 Correct 6 ms 12032 KB Output is correct
4 Correct 7 ms 11980 KB Output is correct
5 Correct 7 ms 12052 KB Output is correct
6 Correct 6 ms 11964 KB Output is correct
7 Correct 7 ms 11980 KB Output is correct
8 Correct 7 ms 11980 KB Output is correct
9 Correct 7 ms 11980 KB Output is correct
10 Correct 7 ms 11980 KB Output is correct
11 Correct 9 ms 12076 KB Output is correct
12 Correct 8 ms 11980 KB Output is correct
13 Correct 6 ms 11980 KB Output is correct
14 Correct 6 ms 11980 KB Output is correct
15 Correct 7 ms 12052 KB Output is correct
16 Correct 6 ms 12028 KB Output is correct
17 Correct 6 ms 12060 KB Output is correct
18 Correct 6 ms 11980 KB Output is correct
19 Correct 7 ms 11980 KB Output is correct
20 Correct 8 ms 11952 KB Output is correct
21 Correct 7 ms 11980 KB Output is correct
22 Correct 6 ms 11980 KB Output is correct
23 Correct 7 ms 11980 KB Output is correct
24 Correct 8 ms 12056 KB Output is correct
25 Correct 6 ms 11980 KB Output is correct
26 Correct 6 ms 11980 KB Output is correct
27 Correct 8 ms 11980 KB Output is correct
28 Correct 7 ms 11980 KB Output is correct
29 Correct 7 ms 11980 KB Output is correct
30 Correct 7 ms 11980 KB Output is correct
31 Correct 7 ms 11980 KB Output is correct
32 Correct 7 ms 11980 KB Output is correct
33 Correct 7 ms 12056 KB Output is correct
34 Correct 7 ms 11980 KB Output is correct
35 Correct 7 ms 11980 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 13 ms 12876 KB Output is correct
2 Correct 11 ms 12748 KB Output is correct
3 Correct 10 ms 12728 KB Output is correct
4 Correct 11 ms 12704 KB Output is correct
5 Correct 12 ms 12608 KB Output is correct
6 Correct 11 ms 12604 KB Output is correct
7 Correct 12 ms 12824 KB Output is correct
8 Correct 11 ms 12864 KB Output is correct
9 Correct 14 ms 12732 KB Output is correct
10 Correct 10 ms 12712 KB Output is correct
11 Correct 11 ms 12656 KB Output is correct
12 Correct 11 ms 12712 KB Output is correct
13 Correct 11 ms 12696 KB Output is correct
14 Correct 14 ms 12732 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 11980 KB Output is correct
2 Correct 6 ms 11980 KB Output is correct
3 Correct 6 ms 12032 KB Output is correct
4 Correct 7 ms 11980 KB Output is correct
5 Correct 7 ms 12052 KB Output is correct
6 Correct 6 ms 11964 KB Output is correct
7 Correct 7 ms 11980 KB Output is correct
8 Correct 7 ms 11980 KB Output is correct
9 Correct 7 ms 11980 KB Output is correct
10 Correct 7 ms 11980 KB Output is correct
11 Correct 9 ms 12076 KB Output is correct
12 Correct 8 ms 11980 KB Output is correct
13 Correct 6 ms 11980 KB Output is correct
14 Correct 6 ms 11980 KB Output is correct
15 Correct 7 ms 12052 KB Output is correct
16 Correct 6 ms 12028 KB Output is correct
17 Correct 6 ms 12060 KB Output is correct
18 Correct 6 ms 11980 KB Output is correct
19 Correct 7 ms 11980 KB Output is correct
20 Correct 8 ms 11952 KB Output is correct
21 Correct 7 ms 11980 KB Output is correct
22 Correct 6 ms 11980 KB Output is correct
23 Correct 7 ms 11980 KB Output is correct
24 Correct 8 ms 12056 KB Output is correct
25 Correct 6 ms 11980 KB Output is correct
26 Correct 6 ms 11980 KB Output is correct
27 Correct 8 ms 11980 KB Output is correct
28 Correct 7 ms 11980 KB Output is correct
29 Correct 7 ms 11980 KB Output is correct
30 Correct 7 ms 11980 KB Output is correct
31 Correct 7 ms 11980 KB Output is correct
32 Correct 7 ms 11980 KB Output is correct
33 Correct 7 ms 12056 KB Output is correct
34 Correct 7 ms 11980 KB Output is correct
35 Correct 7 ms 11980 KB Output is correct
36 Correct 24 ms 12012 KB Output is correct
37 Correct 31 ms 12072 KB Output is correct
38 Correct 27 ms 11980 KB Output is correct
39 Correct 26 ms 11980 KB Output is correct
40 Correct 24 ms 12072 KB Output is correct
41 Correct 24 ms 11968 KB Output is correct
42 Correct 29 ms 12000 KB Output is correct
43 Correct 23 ms 11980 KB Output is correct
44 Correct 25 ms 11980 KB Output is correct
45 Correct 23 ms 11980 KB Output is correct
46 Correct 24 ms 11980 KB Output is correct
47 Correct 25 ms 12048 KB Output is correct
48 Correct 8 ms 11980 KB Output is correct
49 Correct 8 ms 12072 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 11980 KB Output is correct
2 Correct 6 ms 11980 KB Output is correct
3 Correct 6 ms 12032 KB Output is correct
4 Correct 7 ms 11980 KB Output is correct
5 Correct 7 ms 12052 KB Output is correct
6 Correct 6 ms 11964 KB Output is correct
7 Correct 7 ms 11980 KB Output is correct
8 Correct 7 ms 11980 KB Output is correct
9 Correct 7 ms 11980 KB Output is correct
10 Correct 7 ms 11980 KB Output is correct
11 Correct 9 ms 12076 KB Output is correct
12 Correct 8 ms 11980 KB Output is correct
13 Correct 6 ms 11980 KB Output is correct
14 Correct 6 ms 11980 KB Output is correct
15 Correct 7 ms 12052 KB Output is correct
16 Correct 6 ms 12028 KB Output is correct
17 Correct 6 ms 12060 KB Output is correct
18 Correct 6 ms 11980 KB Output is correct
19 Correct 7 ms 11980 KB Output is correct
20 Correct 8 ms 11952 KB Output is correct
21 Correct 7 ms 11980 KB Output is correct
22 Correct 6 ms 11980 KB Output is correct
23 Correct 7 ms 11980 KB Output is correct
24 Correct 8 ms 12056 KB Output is correct
25 Correct 6 ms 11980 KB Output is correct
26 Correct 6 ms 11980 KB Output is correct
27 Correct 8 ms 11980 KB Output is correct
28 Correct 7 ms 11980 KB Output is correct
29 Correct 7 ms 11980 KB Output is correct
30 Correct 7 ms 11980 KB Output is correct
31 Correct 7 ms 11980 KB Output is correct
32 Correct 7 ms 11980 KB Output is correct
33 Correct 7 ms 12056 KB Output is correct
34 Correct 7 ms 11980 KB Output is correct
35 Correct 7 ms 11980 KB Output is correct
36 Correct 24 ms 12012 KB Output is correct
37 Correct 31 ms 12072 KB Output is correct
38 Correct 27 ms 11980 KB Output is correct
39 Correct 26 ms 11980 KB Output is correct
40 Correct 24 ms 12072 KB Output is correct
41 Correct 24 ms 11968 KB Output is correct
42 Correct 29 ms 12000 KB Output is correct
43 Correct 23 ms 11980 KB Output is correct
44 Correct 25 ms 11980 KB Output is correct
45 Correct 23 ms 11980 KB Output is correct
46 Correct 24 ms 11980 KB Output is correct
47 Correct 25 ms 12048 KB Output is correct
48 Correct 8 ms 11980 KB Output is correct
49 Correct 8 ms 12072 KB Output is correct
50 Correct 3200 ms 12264 KB Output is correct
51 Correct 4237 ms 12260 KB Output is correct
52 Correct 3515 ms 12148 KB Output is correct
53 Correct 3239 ms 12128 KB Output is correct
54 Correct 3249 ms 12136 KB Output is correct
55 Correct 2841 ms 12116 KB Output is correct
56 Correct 3422 ms 12148 KB Output is correct
57 Correct 2770 ms 12136 KB Output is correct
58 Correct 3143 ms 12152 KB Output is correct
59 Correct 2403 ms 12140 KB Output is correct
60 Correct 2848 ms 12140 KB Output is correct
61 Correct 3447 ms 12132 KB Output is correct
62 Correct 537 ms 12232 KB Output is correct
63 Correct 428 ms 12112 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 11980 KB Output is correct
2 Correct 6 ms 11980 KB Output is correct
3 Correct 6 ms 12032 KB Output is correct
4 Correct 7 ms 11980 KB Output is correct
5 Correct 7 ms 12052 KB Output is correct
6 Correct 6 ms 11964 KB Output is correct
7 Correct 7 ms 11980 KB Output is correct
8 Correct 7 ms 11980 KB Output is correct
9 Correct 7 ms 11980 KB Output is correct
10 Correct 7 ms 11980 KB Output is correct
11 Correct 9 ms 12076 KB Output is correct
12 Correct 8 ms 11980 KB Output is correct
13 Correct 6 ms 11980 KB Output is correct
14 Correct 6 ms 11980 KB Output is correct
15 Correct 7 ms 12052 KB Output is correct
16 Correct 6 ms 12028 KB Output is correct
17 Correct 6 ms 12060 KB Output is correct
18 Correct 6 ms 11980 KB Output is correct
19 Correct 7 ms 11980 KB Output is correct
20 Correct 8 ms 11952 KB Output is correct
21 Correct 7 ms 11980 KB Output is correct
22 Correct 6 ms 11980 KB Output is correct
23 Correct 7 ms 11980 KB Output is correct
24 Correct 8 ms 12056 KB Output is correct
25 Correct 6 ms 11980 KB Output is correct
26 Correct 6 ms 11980 KB Output is correct
27 Correct 8 ms 11980 KB Output is correct
28 Correct 7 ms 11980 KB Output is correct
29 Correct 7 ms 11980 KB Output is correct
30 Correct 7 ms 11980 KB Output is correct
31 Correct 7 ms 11980 KB Output is correct
32 Correct 7 ms 11980 KB Output is correct
33 Correct 7 ms 12056 KB Output is correct
34 Correct 7 ms 11980 KB Output is correct
35 Correct 7 ms 11980 KB Output is correct
36 Correct 13 ms 12876 KB Output is correct
37 Correct 11 ms 12748 KB Output is correct
38 Correct 10 ms 12728 KB Output is correct
39 Correct 11 ms 12704 KB Output is correct
40 Correct 12 ms 12608 KB Output is correct
41 Correct 11 ms 12604 KB Output is correct
42 Correct 12 ms 12824 KB Output is correct
43 Correct 11 ms 12864 KB Output is correct
44 Correct 14 ms 12732 KB Output is correct
45 Correct 10 ms 12712 KB Output is correct
46 Correct 11 ms 12656 KB Output is correct
47 Correct 11 ms 12712 KB Output is correct
48 Correct 11 ms 12696 KB Output is correct
49 Correct 14 ms 12732 KB Output is correct
50 Correct 24 ms 12012 KB Output is correct
51 Correct 31 ms 12072 KB Output is correct
52 Correct 27 ms 11980 KB Output is correct
53 Correct 26 ms 11980 KB Output is correct
54 Correct 24 ms 12072 KB Output is correct
55 Correct 24 ms 11968 KB Output is correct
56 Correct 29 ms 12000 KB Output is correct
57 Correct 23 ms 11980 KB Output is correct
58 Correct 25 ms 11980 KB Output is correct
59 Correct 23 ms 11980 KB Output is correct
60 Correct 24 ms 11980 KB Output is correct
61 Correct 25 ms 12048 KB Output is correct
62 Correct 8 ms 11980 KB Output is correct
63 Correct 8 ms 12072 KB Output is correct
64 Correct 3200 ms 12264 KB Output is correct
65 Correct 4237 ms 12260 KB Output is correct
66 Correct 3515 ms 12148 KB Output is correct
67 Correct 3239 ms 12128 KB Output is correct
68 Correct 3249 ms 12136 KB Output is correct
69 Correct 2841 ms 12116 KB Output is correct
70 Correct 3422 ms 12148 KB Output is correct
71 Correct 2770 ms 12136 KB Output is correct
72 Correct 3143 ms 12152 KB Output is correct
73 Correct 2403 ms 12140 KB Output is correct
74 Correct 2848 ms 12140 KB Output is correct
75 Correct 3447 ms 12132 KB Output is correct
76 Correct 537 ms 12232 KB Output is correct
77 Correct 428 ms 12112 KB Output is correct
78 Correct 11 ms 12876 KB Output is correct
79 Correct 11 ms 12960 KB Output is correct
80 Correct 11 ms 12828 KB Output is correct
81 Incorrect 11 ms 12836 KB Output isn't correct
82 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 11980 KB Output is correct
2 Correct 6 ms 11980 KB Output is correct
3 Correct 6 ms 12032 KB Output is correct
4 Correct 7 ms 11980 KB Output is correct
5 Correct 7 ms 12052 KB Output is correct
6 Correct 6 ms 11964 KB Output is correct
7 Correct 7 ms 11980 KB Output is correct
8 Correct 7 ms 11980 KB Output is correct
9 Correct 7 ms 11980 KB Output is correct
10 Correct 7 ms 11980 KB Output is correct
11 Correct 9 ms 12076 KB Output is correct
12 Correct 8 ms 11980 KB Output is correct
13 Correct 6 ms 11980 KB Output is correct
14 Correct 6 ms 11980 KB Output is correct
15 Correct 7 ms 12052 KB Output is correct
16 Correct 6 ms 12028 KB Output is correct
17 Correct 6 ms 12060 KB Output is correct
18 Correct 6 ms 11980 KB Output is correct
19 Correct 7 ms 11980 KB Output is correct
20 Correct 8 ms 11952 KB Output is correct
21 Correct 7 ms 11980 KB Output is correct
22 Correct 6 ms 11980 KB Output is correct
23 Correct 7 ms 11980 KB Output is correct
24 Correct 8 ms 12056 KB Output is correct
25 Correct 6 ms 11980 KB Output is correct
26 Correct 6 ms 11980 KB Output is correct
27 Correct 8 ms 11980 KB Output is correct
28 Correct 7 ms 11980 KB Output is correct
29 Correct 7 ms 11980 KB Output is correct
30 Correct 7 ms 11980 KB Output is correct
31 Correct 7 ms 11980 KB Output is correct
32 Correct 7 ms 11980 KB Output is correct
33 Correct 7 ms 12056 KB Output is correct
34 Correct 7 ms 11980 KB Output is correct
35 Correct 7 ms 11980 KB Output is correct
36 Correct 13 ms 12876 KB Output is correct
37 Correct 11 ms 12748 KB Output is correct
38 Correct 10 ms 12728 KB Output is correct
39 Correct 11 ms 12704 KB Output is correct
40 Correct 12 ms 12608 KB Output is correct
41 Correct 11 ms 12604 KB Output is correct
42 Correct 12 ms 12824 KB Output is correct
43 Correct 11 ms 12864 KB Output is correct
44 Correct 14 ms 12732 KB Output is correct
45 Correct 10 ms 12712 KB Output is correct
46 Correct 11 ms 12656 KB Output is correct
47 Correct 11 ms 12712 KB Output is correct
48 Correct 11 ms 12696 KB Output is correct
49 Correct 14 ms 12732 KB Output is correct
50 Correct 24 ms 12012 KB Output is correct
51 Correct 31 ms 12072 KB Output is correct
52 Correct 27 ms 11980 KB Output is correct
53 Correct 26 ms 11980 KB Output is correct
54 Correct 24 ms 12072 KB Output is correct
55 Correct 24 ms 11968 KB Output is correct
56 Correct 29 ms 12000 KB Output is correct
57 Correct 23 ms 11980 KB Output is correct
58 Correct 25 ms 11980 KB Output is correct
59 Correct 23 ms 11980 KB Output is correct
60 Correct 24 ms 11980 KB Output is correct
61 Correct 25 ms 12048 KB Output is correct
62 Correct 8 ms 11980 KB Output is correct
63 Correct 8 ms 12072 KB Output is correct
64 Correct 3200 ms 12264 KB Output is correct
65 Correct 4237 ms 12260 KB Output is correct
66 Correct 3515 ms 12148 KB Output is correct
67 Correct 3239 ms 12128 KB Output is correct
68 Correct 3249 ms 12136 KB Output is correct
69 Correct 2841 ms 12116 KB Output is correct
70 Correct 3422 ms 12148 KB Output is correct
71 Correct 2770 ms 12136 KB Output is correct
72 Correct 3143 ms 12152 KB Output is correct
73 Correct 2403 ms 12140 KB Output is correct
74 Correct 2848 ms 12140 KB Output is correct
75 Correct 3447 ms 12132 KB Output is correct
76 Correct 537 ms 12232 KB Output is correct
77 Correct 428 ms 12112 KB Output is correct
78 Correct 11 ms 12876 KB Output is correct
79 Correct 11 ms 12960 KB Output is correct
80 Correct 11 ms 12828 KB Output is correct
81 Incorrect 11 ms 12836 KB Output isn't correct
82 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 11980 KB Output is correct
2 Correct 6 ms 11980 KB Output is correct
3 Correct 6 ms 12032 KB Output is correct
4 Correct 7 ms 11980 KB Output is correct
5 Correct 7 ms 12052 KB Output is correct
6 Correct 6 ms 11964 KB Output is correct
7 Correct 7 ms 11980 KB Output is correct
8 Correct 7 ms 11980 KB Output is correct
9 Correct 7 ms 11980 KB Output is correct
10 Correct 7 ms 11980 KB Output is correct
11 Correct 9 ms 12076 KB Output is correct
12 Correct 8 ms 11980 KB Output is correct
13 Correct 6 ms 11980 KB Output is correct
14 Correct 6 ms 11980 KB Output is correct
15 Correct 7 ms 12052 KB Output is correct
16 Correct 6 ms 12028 KB Output is correct
17 Correct 6 ms 12060 KB Output is correct
18 Correct 6 ms 11980 KB Output is correct
19 Correct 7 ms 11980 KB Output is correct
20 Correct 8 ms 11952 KB Output is correct
21 Correct 7 ms 11980 KB Output is correct
22 Correct 6 ms 11980 KB Output is correct
23 Correct 7 ms 11980 KB Output is correct
24 Correct 8 ms 12056 KB Output is correct
25 Correct 6 ms 11980 KB Output is correct
26 Correct 6 ms 11980 KB Output is correct
27 Correct 8 ms 11980 KB Output is correct
28 Correct 7 ms 11980 KB Output is correct
29 Correct 7 ms 11980 KB Output is correct
30 Correct 7 ms 11980 KB Output is correct
31 Correct 7 ms 11980 KB Output is correct
32 Correct 7 ms 11980 KB Output is correct
33 Correct 7 ms 12056 KB Output is correct
34 Correct 7 ms 11980 KB Output is correct
35 Correct 7 ms 11980 KB Output is correct
36 Correct 13 ms 12876 KB Output is correct
37 Correct 11 ms 12748 KB Output is correct
38 Correct 10 ms 12728 KB Output is correct
39 Correct 11 ms 12704 KB Output is correct
40 Correct 12 ms 12608 KB Output is correct
41 Correct 11 ms 12604 KB Output is correct
42 Correct 12 ms 12824 KB Output is correct
43 Correct 11 ms 12864 KB Output is correct
44 Correct 14 ms 12732 KB Output is correct
45 Correct 10 ms 12712 KB Output is correct
46 Correct 11 ms 12656 KB Output is correct
47 Correct 11 ms 12712 KB Output is correct
48 Correct 11 ms 12696 KB Output is correct
49 Correct 14 ms 12732 KB Output is correct
50 Correct 24 ms 12012 KB Output is correct
51 Correct 31 ms 12072 KB Output is correct
52 Correct 27 ms 11980 KB Output is correct
53 Correct 26 ms 11980 KB Output is correct
54 Correct 24 ms 12072 KB Output is correct
55 Correct 24 ms 11968 KB Output is correct
56 Correct 29 ms 12000 KB Output is correct
57 Correct 23 ms 11980 KB Output is correct
58 Correct 25 ms 11980 KB Output is correct
59 Correct 23 ms 11980 KB Output is correct
60 Correct 24 ms 11980 KB Output is correct
61 Correct 25 ms 12048 KB Output is correct
62 Correct 8 ms 11980 KB Output is correct
63 Correct 8 ms 12072 KB Output is correct
64 Correct 3200 ms 12264 KB Output is correct
65 Correct 4237 ms 12260 KB Output is correct
66 Correct 3515 ms 12148 KB Output is correct
67 Correct 3239 ms 12128 KB Output is correct
68 Correct 3249 ms 12136 KB Output is correct
69 Correct 2841 ms 12116 KB Output is correct
70 Correct 3422 ms 12148 KB Output is correct
71 Correct 2770 ms 12136 KB Output is correct
72 Correct 3143 ms 12152 KB Output is correct
73 Correct 2403 ms 12140 KB Output is correct
74 Correct 2848 ms 12140 KB Output is correct
75 Correct 3447 ms 12132 KB Output is correct
76 Correct 537 ms 12232 KB Output is correct
77 Correct 428 ms 12112 KB Output is correct
78 Correct 11 ms 12876 KB Output is correct
79 Correct 11 ms 12960 KB Output is correct
80 Correct 11 ms 12828 KB Output is correct
81 Incorrect 11 ms 12836 KB Output isn't correct
82 Halted 0 ms 0 KB -