답안 #796065

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
796065 2023-07-28T05:42:50 Z 이동현(#10071) Council (JOI23_council) C++17
100 / 100
1323 ms 348376 KB
#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
using namespace std;

const int NS = (int)3e5 + 4;
int n, m;
int a[NS], cnt[20], ans[NS];
int dp[21][1 << 20];
int id[21][1 << 20];
int dp2[21][1 << 20];
int id2[21][1 << 20];

signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    cin >> n >> m;
    for(int i = 0; i < n; ++i){
        for(int j = 0; j < m; ++j){
            int x;
            cin >> x;
            a[i] |= (x << j);
            cnt[j] += x;
        }
    }

    vector<int> ncnt;
    for(int i = 0; i < n; ++i){
        int bt = 0, top = 0;
        for(int j = 0; j < m; ++j){
            if(cnt[j] >= n / 2 && cnt[j] < n / 2 + 2){
                if(!i){
                    ncnt.push_back(cnt[j]);
                }
                if(a[i] & (1 << j)){
                    bt |= 1 << top;
                }
                ++top;
            }
            if(cnt[j] >= n / 2 + 2){
                ans[i] += 1;
            }
        }
        a[i] = bt;
    }
    m = (int)ncnt.size();
    for(int i = 0; i < m; ++i){
        cnt[i] = ncnt[i];
    }

    for(int i = 0; i <= m; ++i){
        for(int j = 0; j < 1 << m; ++j){
            dp[i][j] = dp2[i][j] = 1000;
            id[i][j] = id2[i][j] = -1;
        }
    }
    for(int i = 0; i < n; ++i){
        if(dp[m][a[i]] == 1000){
            dp[m][a[i]] = 0;
            id[m][a[i]] = i;
        }
        else{
            dp2[m][a[i]] = 0;
            id2[m][a[i]] = i;
        }
    }

    int all = (1 << m) - 1;
    for(int i = m - 1; i >= 0; --i){
        for(int j = 0; j < 1 << m; ++j){
            vector<pair<int, int>> srt(4);
            srt[0] = {dp[i + 1][j | (1 << i)] + !!(j & (1 << i)), id[i + 1][j | (1 << i)]};
            srt[1] = {dp2[i + 1][j | (1 << i)] + !!(j & (1 << i)), id2[i + 1][j | (1 << i)]};
            srt[2] = {dp[i + 1][j & (all - (1 << i))], id[i + 1][j & (all - (1 << i))]};
            srt[3] = {dp2[i + 1][j & (all - (1 << i))], id2[i + 1][j & (all - (1 << i))]};

            sort(srt.begin(), srt.end());
            dp[i][j] = srt[0].first, id[i][j] = srt[0].second;
            dp2[i][j] = srt[1 + (srt[0].second == srt[1].second)].first, id2[i][j] = srt[1 + (srt[0].second == srt[1].second)].second;
        }
    }

    for(int i = 0; i < n; ++i){
        int bt = 0;
        ans[i] += m;
        for(int j = 0; j < m; ++j){
            int v = cnt[j] - n / 2 - !!(a[i] & (1 << j));

            if(!v){
                bt |= (1 << j);
            }

            if((a[i] & (1 << j)) && cnt[j] == n / 2){
                --ans[i];
            }
        }

        // cout << a[i] << ' ' << bt << ' ' << dp[0][bt] << endl;

        // int mn = (int)1e9;
        // for(int j = 0; j < n; ++j){
        //     if(i != j){
        //         mn = min(mn, __builtin_popcount(bt & a[j]));
        //     }
        // }
        // ans[i] -= mn;
        // cout << ans[i] << " BIT " << bt << endl;
        ans[i] -= (id[0][bt] == i ? dp2[0][bt] : dp[0][bt]);

        cout << ans[i] << '\n';
    }
    
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 852 KB Output is correct
3 Correct 0 ms 468 KB Output is correct
4 Correct 0 ms 340 KB Output is correct
5 Correct 757 ms 344976 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 1 ms 596 KB Output is correct
8 Correct 1 ms 852 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 752 ms 345048 KB Output is correct
11 Correct 804 ms 345108 KB Output is correct
12 Correct 907 ms 345036 KB Output is correct
13 Correct 0 ms 340 KB Output is correct
14 Correct 0 ms 340 KB Output is correct
15 Correct 0 ms 340 KB Output is correct
16 Correct 0 ms 340 KB Output is correct
17 Correct 0 ms 340 KB Output is correct
18 Correct 0 ms 340 KB Output is correct
19 Correct 0 ms 340 KB Output is correct
20 Correct 0 ms 340 KB Output is correct
21 Correct 1 ms 340 KB Output is correct
22 Correct 1 ms 852 KB Output is correct
23 Correct 0 ms 340 KB Output is correct
24 Correct 0 ms 340 KB Output is correct
25 Correct 0 ms 340 KB Output is correct
26 Correct 1 ms 340 KB Output is correct
27 Correct 0 ms 340 KB Output is correct
28 Correct 0 ms 340 KB Output is correct
29 Correct 0 ms 468 KB Output is correct
30 Correct 0 ms 340 KB Output is correct
31 Correct 0 ms 340 KB Output is correct
32 Correct 0 ms 340 KB Output is correct
33 Correct 0 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 468 KB Output is correct
37 Correct 1 ms 596 KB Output is correct
38 Correct 1 ms 596 KB Output is correct
39 Correct 1 ms 852 KB Output is correct
40 Correct 1 ms 852 KB Output is correct
41 Correct 9 ms 4564 KB Output is correct
42 Correct 1 ms 468 KB Output is correct
43 Correct 0 ms 468 KB Output is correct
44 Correct 8 ms 4644 KB Output is correct
45 Correct 9 ms 4644 KB Output is correct
46 Correct 83 ms 38032 KB Output is correct
47 Correct 1 ms 980 KB Output is correct
48 Correct 1 ms 596 KB Output is correct
49 Correct 80 ms 38044 KB Output is correct
50 Correct 88 ms 38032 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 852 KB Output is correct
3 Correct 0 ms 468 KB Output is correct
4 Correct 0 ms 340 KB Output is correct
5 Correct 757 ms 344976 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 1 ms 596 KB Output is correct
8 Correct 1 ms 852 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 752 ms 345048 KB Output is correct
11 Correct 804 ms 345108 KB Output is correct
12 Correct 907 ms 345036 KB Output is correct
13 Correct 0 ms 340 KB Output is correct
14 Correct 0 ms 340 KB Output is correct
15 Correct 0 ms 340 KB Output is correct
16 Correct 0 ms 340 KB Output is correct
17 Correct 0 ms 340 KB Output is correct
18 Correct 0 ms 340 KB Output is correct
19 Correct 0 ms 340 KB Output is correct
20 Correct 0 ms 340 KB Output is correct
21 Correct 1 ms 340 KB Output is correct
22 Correct 1 ms 852 KB Output is correct
23 Correct 0 ms 340 KB Output is correct
24 Correct 0 ms 340 KB Output is correct
25 Correct 0 ms 340 KB Output is correct
26 Correct 1 ms 340 KB Output is correct
27 Correct 0 ms 340 KB Output is correct
28 Correct 0 ms 340 KB Output is correct
29 Correct 0 ms 468 KB Output is correct
30 Correct 0 ms 340 KB Output is correct
31 Correct 0 ms 340 KB Output is correct
32 Correct 0 ms 340 KB Output is correct
33 Correct 0 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 468 KB Output is correct
37 Correct 1 ms 596 KB Output is correct
38 Correct 1 ms 596 KB Output is correct
39 Correct 1 ms 852 KB Output is correct
40 Correct 1 ms 852 KB Output is correct
41 Correct 9 ms 4564 KB Output is correct
42 Correct 1 ms 468 KB Output is correct
43 Correct 0 ms 468 KB Output is correct
44 Correct 8 ms 4644 KB Output is correct
45 Correct 9 ms 4644 KB Output is correct
46 Correct 83 ms 38032 KB Output is correct
47 Correct 1 ms 980 KB Output is correct
48 Correct 1 ms 596 KB Output is correct
49 Correct 80 ms 38044 KB Output is correct
50 Correct 88 ms 38032 KB Output is correct
51 Correct 3 ms 340 KB Output is correct
52 Correct 3 ms 340 KB Output is correct
53 Correct 4 ms 332 KB Output is correct
54 Correct 979 ms 345160 KB Output is correct
55 Correct 1 ms 340 KB Output is correct
56 Correct 111 ms 38044 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 40 ms 3276 KB Output is correct
3 Correct 40 ms 3276 KB Output is correct
4 Correct 29 ms 3276 KB Output is correct
5 Correct 45 ms 3268 KB Output is correct
6 Correct 35 ms 3280 KB Output is correct
7 Correct 51 ms 3304 KB Output is correct
8 Correct 0 ms 340 KB Output is correct
9 Correct 0 ms 340 KB Output is correct
10 Correct 0 ms 340 KB Output is correct
11 Correct 0 ms 340 KB Output is correct
12 Correct 0 ms 340 KB Output is correct
13 Correct 0 ms 340 KB Output is correct
14 Correct 0 ms 340 KB Output is correct
15 Correct 0 ms 340 KB Output is correct
16 Correct 0 ms 340 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 40 ms 3276 KB Output is correct
3 Correct 40 ms 3276 KB Output is correct
4 Correct 29 ms 3276 KB Output is correct
5 Correct 45 ms 3268 KB Output is correct
6 Correct 35 ms 3280 KB Output is correct
7 Correct 51 ms 3304 KB Output is correct
8 Correct 0 ms 340 KB Output is correct
9 Correct 0 ms 340 KB Output is correct
10 Correct 0 ms 340 KB Output is correct
11 Correct 0 ms 340 KB Output is correct
12 Correct 0 ms 340 KB Output is correct
13 Correct 0 ms 340 KB Output is correct
14 Correct 0 ms 340 KB Output is correct
15 Correct 0 ms 340 KB Output is correct
16 Correct 0 ms 340 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 0 ms 340 KB Output is correct
19 Correct 0 ms 468 KB Output is correct
20 Correct 170 ms 3720 KB Output is correct
21 Correct 157 ms 3480 KB Output is correct
22 Correct 154 ms 3524 KB Output is correct
23 Correct 136 ms 3572 KB Output is correct
24 Correct 126 ms 3208 KB Output is correct
25 Correct 142 ms 3196 KB Output is correct
26 Correct 174 ms 3760 KB Output is correct
27 Correct 1 ms 852 KB Output is correct
28 Correct 0 ms 340 KB Output is correct
29 Correct 1 ms 340 KB Output is correct
30 Correct 0 ms 340 KB Output is correct
31 Correct 0 ms 340 KB Output is correct
32 Correct 0 ms 340 KB Output is correct
33 Correct 0 ms 340 KB Output is correct
34 Correct 0 ms 468 KB Output is correct
35 Correct 0 ms 340 KB Output is correct
36 Correct 1 ms 340 KB Output is correct
37 Correct 1 ms 340 KB Output is correct
38 Correct 1 ms 468 KB Output is correct
39 Correct 0 ms 468 KB Output is correct
40 Correct 1 ms 468 KB Output is correct
41 Correct 1 ms 468 KB Output is correct
42 Correct 1 ms 596 KB Output is correct
43 Correct 1 ms 596 KB Output is correct
44 Correct 1 ms 852 KB Output is correct
45 Correct 1 ms 852 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 40 ms 3276 KB Output is correct
3 Correct 40 ms 3276 KB Output is correct
4 Correct 29 ms 3276 KB Output is correct
5 Correct 45 ms 3268 KB Output is correct
6 Correct 35 ms 3280 KB Output is correct
7 Correct 51 ms 3304 KB Output is correct
8 Correct 0 ms 340 KB Output is correct
9 Correct 0 ms 340 KB Output is correct
10 Correct 0 ms 340 KB Output is correct
11 Correct 0 ms 340 KB Output is correct
12 Correct 0 ms 340 KB Output is correct
13 Correct 0 ms 340 KB Output is correct
14 Correct 0 ms 340 KB Output is correct
15 Correct 0 ms 340 KB Output is correct
16 Correct 0 ms 340 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 0 ms 340 KB Output is correct
19 Correct 0 ms 468 KB Output is correct
20 Correct 170 ms 3720 KB Output is correct
21 Correct 157 ms 3480 KB Output is correct
22 Correct 154 ms 3524 KB Output is correct
23 Correct 136 ms 3572 KB Output is correct
24 Correct 126 ms 3208 KB Output is correct
25 Correct 142 ms 3196 KB Output is correct
26 Correct 174 ms 3760 KB Output is correct
27 Correct 1 ms 852 KB Output is correct
28 Correct 0 ms 340 KB Output is correct
29 Correct 1 ms 340 KB Output is correct
30 Correct 0 ms 340 KB Output is correct
31 Correct 0 ms 340 KB Output is correct
32 Correct 0 ms 340 KB Output is correct
33 Correct 0 ms 340 KB Output is correct
34 Correct 0 ms 468 KB Output is correct
35 Correct 0 ms 340 KB Output is correct
36 Correct 1 ms 340 KB Output is correct
37 Correct 1 ms 340 KB Output is correct
38 Correct 1 ms 468 KB Output is correct
39 Correct 0 ms 468 KB Output is correct
40 Correct 1 ms 468 KB Output is correct
41 Correct 1 ms 468 KB Output is correct
42 Correct 1 ms 596 KB Output is correct
43 Correct 1 ms 596 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 245 ms 7568 KB Output is correct
48 Correct 217 ms 5492 KB Output is correct
49 Correct 223 ms 5420 KB Output is correct
50 Correct 177 ms 3648 KB Output is correct
51 Correct 165 ms 3208 KB Output is correct
52 Correct 192 ms 3200 KB Output is correct
53 Correct 246 ms 7732 KB Output is correct
54 Correct 9 ms 4564 KB Output is correct
55 Correct 0 ms 468 KB Output is correct
56 Correct 0 ms 468 KB Output is correct
57 Correct 9 ms 4564 KB Output is correct
58 Correct 9 ms 4564 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 40 ms 3276 KB Output is correct
3 Correct 40 ms 3276 KB Output is correct
4 Correct 29 ms 3276 KB Output is correct
5 Correct 45 ms 3268 KB Output is correct
6 Correct 35 ms 3280 KB Output is correct
7 Correct 51 ms 3304 KB Output is correct
8 Correct 0 ms 340 KB Output is correct
9 Correct 0 ms 340 KB Output is correct
10 Correct 0 ms 340 KB Output is correct
11 Correct 0 ms 340 KB Output is correct
12 Correct 0 ms 340 KB Output is correct
13 Correct 0 ms 340 KB Output is correct
14 Correct 0 ms 340 KB Output is correct
15 Correct 0 ms 340 KB Output is correct
16 Correct 0 ms 340 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 0 ms 340 KB Output is correct
19 Correct 0 ms 468 KB Output is correct
20 Correct 170 ms 3720 KB Output is correct
21 Correct 157 ms 3480 KB Output is correct
22 Correct 154 ms 3524 KB Output is correct
23 Correct 136 ms 3572 KB Output is correct
24 Correct 126 ms 3208 KB Output is correct
25 Correct 142 ms 3196 KB Output is correct
26 Correct 174 ms 3760 KB Output is correct
27 Correct 1 ms 852 KB Output is correct
28 Correct 0 ms 340 KB Output is correct
29 Correct 1 ms 340 KB Output is correct
30 Correct 0 ms 340 KB Output is correct
31 Correct 0 ms 340 KB Output is correct
32 Correct 0 ms 340 KB Output is correct
33 Correct 0 ms 340 KB Output is correct
34 Correct 0 ms 468 KB Output is correct
35 Correct 0 ms 340 KB Output is correct
36 Correct 1 ms 340 KB Output is correct
37 Correct 1 ms 340 KB Output is correct
38 Correct 1 ms 468 KB Output is correct
39 Correct 0 ms 468 KB Output is correct
40 Correct 1 ms 468 KB Output is correct
41 Correct 1 ms 468 KB Output is correct
42 Correct 1 ms 596 KB Output is correct
43 Correct 1 ms 596 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 245 ms 7568 KB Output is correct
48 Correct 217 ms 5492 KB Output is correct
49 Correct 223 ms 5420 KB Output is correct
50 Correct 177 ms 3648 KB Output is correct
51 Correct 165 ms 3208 KB Output is correct
52 Correct 192 ms 3200 KB Output is correct
53 Correct 246 ms 7732 KB Output is correct
54 Correct 9 ms 4564 KB Output is correct
55 Correct 0 ms 468 KB Output is correct
56 Correct 0 ms 468 KB Output is correct
57 Correct 9 ms 4564 KB Output is correct
58 Correct 9 ms 4564 KB Output is correct
59 Correct 217 ms 3480 KB Output is correct
60 Correct 210 ms 39200 KB Output is correct
61 Correct 215 ms 39340 KB Output is correct
62 Correct 224 ms 39372 KB Output is correct
63 Correct 313 ms 21476 KB Output is correct
64 Correct 377 ms 40864 KB Output is correct
65 Correct 380 ms 40964 KB Output is correct
66 Correct 202 ms 3564 KB Output is correct
67 Correct 198 ms 3196 KB Output is correct
68 Correct 228 ms 3268 KB Output is correct
69 Correct 382 ms 41216 KB Output is correct
70 Correct 92 ms 38128 KB Output is correct
71 Correct 1 ms 980 KB Output is correct
72 Correct 1 ms 564 KB Output is correct
73 Correct 87 ms 38044 KB Output is correct
74 Correct 87 ms 38032 KB Output is correct
75 Correct 113 ms 38044 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 852 KB Output is correct
3 Correct 0 ms 468 KB Output is correct
4 Correct 0 ms 340 KB Output is correct
5 Correct 757 ms 344976 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 1 ms 596 KB Output is correct
8 Correct 1 ms 852 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 752 ms 345048 KB Output is correct
11 Correct 804 ms 345108 KB Output is correct
12 Correct 907 ms 345036 KB Output is correct
13 Correct 0 ms 340 KB Output is correct
14 Correct 0 ms 340 KB Output is correct
15 Correct 0 ms 340 KB Output is correct
16 Correct 0 ms 340 KB Output is correct
17 Correct 0 ms 340 KB Output is correct
18 Correct 0 ms 340 KB Output is correct
19 Correct 0 ms 340 KB Output is correct
20 Correct 0 ms 340 KB Output is correct
21 Correct 1 ms 340 KB Output is correct
22 Correct 1 ms 852 KB Output is correct
23 Correct 0 ms 340 KB Output is correct
24 Correct 0 ms 340 KB Output is correct
25 Correct 0 ms 340 KB Output is correct
26 Correct 1 ms 340 KB Output is correct
27 Correct 0 ms 340 KB Output is correct
28 Correct 0 ms 340 KB Output is correct
29 Correct 0 ms 468 KB Output is correct
30 Correct 0 ms 340 KB Output is correct
31 Correct 0 ms 340 KB Output is correct
32 Correct 0 ms 340 KB Output is correct
33 Correct 0 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 468 KB Output is correct
37 Correct 1 ms 596 KB Output is correct
38 Correct 1 ms 596 KB Output is correct
39 Correct 1 ms 852 KB Output is correct
40 Correct 1 ms 852 KB Output is correct
41 Correct 9 ms 4564 KB Output is correct
42 Correct 1 ms 468 KB Output is correct
43 Correct 0 ms 468 KB Output is correct
44 Correct 8 ms 4644 KB Output is correct
45 Correct 9 ms 4644 KB Output is correct
46 Correct 83 ms 38032 KB Output is correct
47 Correct 1 ms 980 KB Output is correct
48 Correct 1 ms 596 KB Output is correct
49 Correct 80 ms 38044 KB Output is correct
50 Correct 88 ms 38032 KB Output is correct
51 Correct 3 ms 340 KB Output is correct
52 Correct 3 ms 340 KB Output is correct
53 Correct 4 ms 332 KB Output is correct
54 Correct 979 ms 345160 KB Output is correct
55 Correct 1 ms 340 KB Output is correct
56 Correct 111 ms 38044 KB Output is correct
57 Correct 0 ms 340 KB Output is correct
58 Correct 40 ms 3276 KB Output is correct
59 Correct 40 ms 3276 KB Output is correct
60 Correct 29 ms 3276 KB Output is correct
61 Correct 45 ms 3268 KB Output is correct
62 Correct 35 ms 3280 KB Output is correct
63 Correct 51 ms 3304 KB Output is correct
64 Correct 0 ms 340 KB Output is correct
65 Correct 0 ms 340 KB Output is correct
66 Correct 0 ms 340 KB Output is correct
67 Correct 0 ms 340 KB Output is correct
68 Correct 0 ms 340 KB Output is correct
69 Correct 0 ms 340 KB Output is correct
70 Correct 0 ms 340 KB Output is correct
71 Correct 0 ms 340 KB Output is correct
72 Correct 0 ms 340 KB Output is correct
73 Correct 1 ms 340 KB Output is correct
74 Correct 0 ms 340 KB Output is correct
75 Correct 0 ms 468 KB Output is correct
76 Correct 170 ms 3720 KB Output is correct
77 Correct 157 ms 3480 KB Output is correct
78 Correct 154 ms 3524 KB Output is correct
79 Correct 136 ms 3572 KB Output is correct
80 Correct 126 ms 3208 KB Output is correct
81 Correct 142 ms 3196 KB Output is correct
82 Correct 174 ms 3760 KB Output is correct
83 Correct 1 ms 852 KB Output is correct
84 Correct 0 ms 340 KB Output is correct
85 Correct 1 ms 340 KB Output is correct
86 Correct 0 ms 340 KB Output is correct
87 Correct 0 ms 340 KB Output is correct
88 Correct 0 ms 340 KB Output is correct
89 Correct 0 ms 340 KB Output is correct
90 Correct 0 ms 468 KB Output is correct
91 Correct 0 ms 340 KB Output is correct
92 Correct 1 ms 340 KB Output is correct
93 Correct 1 ms 340 KB Output is correct
94 Correct 1 ms 468 KB Output is correct
95 Correct 0 ms 468 KB Output is correct
96 Correct 1 ms 468 KB Output is correct
97 Correct 1 ms 468 KB Output is correct
98 Correct 1 ms 596 KB Output is correct
99 Correct 1 ms 596 KB Output is correct
100 Correct 1 ms 852 KB Output is correct
101 Correct 1 ms 852 KB Output is correct
102 Correct 1 ms 852 KB Output is correct
103 Correct 245 ms 7568 KB Output is correct
104 Correct 217 ms 5492 KB Output is correct
105 Correct 223 ms 5420 KB Output is correct
106 Correct 177 ms 3648 KB Output is correct
107 Correct 165 ms 3208 KB Output is correct
108 Correct 192 ms 3200 KB Output is correct
109 Correct 246 ms 7732 KB Output is correct
110 Correct 9 ms 4564 KB Output is correct
111 Correct 0 ms 468 KB Output is correct
112 Correct 0 ms 468 KB Output is correct
113 Correct 9 ms 4564 KB Output is correct
114 Correct 9 ms 4564 KB Output is correct
115 Correct 217 ms 3480 KB Output is correct
116 Correct 210 ms 39200 KB Output is correct
117 Correct 215 ms 39340 KB Output is correct
118 Correct 224 ms 39372 KB Output is correct
119 Correct 313 ms 21476 KB Output is correct
120 Correct 377 ms 40864 KB Output is correct
121 Correct 380 ms 40964 KB Output is correct
122 Correct 202 ms 3564 KB Output is correct
123 Correct 198 ms 3196 KB Output is correct
124 Correct 228 ms 3268 KB Output is correct
125 Correct 382 ms 41216 KB Output is correct
126 Correct 92 ms 38128 KB Output is correct
127 Correct 1 ms 980 KB Output is correct
128 Correct 1 ms 564 KB Output is correct
129 Correct 87 ms 38044 KB Output is correct
130 Correct 87 ms 38032 KB Output is correct
131 Correct 113 ms 38044 KB Output is correct
132 Correct 1271 ms 348268 KB Output is correct
133 Correct 1265 ms 348044 KB Output is correct
134 Correct 1227 ms 348312 KB Output is correct
135 Correct 1277 ms 348216 KB Output is correct
136 Correct 1290 ms 348356 KB Output is correct
137 Correct 776 ms 168196 KB Output is correct
138 Correct 740 ms 168328 KB Output is correct
139 Correct 238 ms 3548 KB Output is correct
140 Correct 239 ms 3184 KB Output is correct
141 Correct 269 ms 3276 KB Output is correct
142 Correct 1323 ms 348376 KB Output is correct