Submission #987237

# Submission time Handle Problem Language Result Execution time Memory
987237 2024-05-22T12:05:27 Z VinhLuu Council (JOI23_council) C++17
100 / 100
609 ms 31812 KB
//#pragma GCC optimize("O3,unroll-loops")
//#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#include <bits/stdc++.h>
//#define int long long
//#define ll long long
#define fi first
#define se second
#define pb push_back
#define all(lmao) lmao.begin(), lmao.end()
using namespace std;

typedef pair<int,int> pii;
typedef tuple<int,int,int> tp;
const int N = 3e5 + 5;
const int oo = 1e9 + 1;
const int mod = 1e9 + 7;
//const ll oo = 5e18;

int n, m, mask, cnt[22], a[N], b[N];
int dp[(1 << 20)][2][2];

// 0 0 -> val
// 0 1 -> idx
// -> first
// 1 0 -> val
// 1 1 -> idx
// -> second

void update(int u,pii x) {
    if(dp[u][0][0] < x.fi) {
        if(dp[u][0][1] != x.se) dp[u][1][0] = dp[u][0][0], dp[u][1][1] = dp[u][0][1];
        dp[u][0][0] = x.fi, dp[u][0][1] = x.se;
    }else if(dp[u][1][0] < x.fi && dp[u][0][1] != x.se) dp[u][1][0] = x.fi, dp[u][1][1] = x.se;
}


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

    #define task "v"
    if(fopen(task ".inp","r")){
        freopen(task ".inp","r",stdin);
        freopen(task ".out","w",stdout);
    }

    cin >> n >> m;
    int full = (1 << m) - 1;
    for(int msk = 0; msk <= full; msk ++){
        dp[msk][0][0] = dp[msk][1][0] = 0;
        dp[msk][0][1] = dp[msk][1][1] = -1;
    }
    for(int i = 0; i < n; i ++){
        for(int j = 0; j < m; j ++){
            int x; cin >> x;
            cnt[j] += x;
            a[i] += x * (1 << j);
        }
        int u = __builtin_popcount(full ^ a[i]);
        update(full ^ a[i], {u, i});
    }

    for(int msk = full; msk >= 1; msk --){
        for(int j = 0; j < m; j ++){
            if((msk >> j) & 1){
                update(msk ^ (1 << j), {dp[msk][0][0] - 1, dp[msk][0][1]});
                update(msk ^ (1 << j), {dp[msk][1][0] - 1, dp[msk][1][1]});
            }
        }
    }


    for(int msk = 1; msk <= full; msk ++){
        for(int j = 0; j < m; j ++){
            if(!((msk >> j) & 1)){
                update(msk | (1 << j), {dp[msk][0][0], dp[msk][0][1]});
                update(msk | (1 << j), {dp[msk][1][0], dp[msk][1][1]});
            }
        }
    }

    for(int i = 0; i < n; i ++){
        int ans = 0;
        for(int j = 0; j < m; j ++){
            int tmp = cnt[j] - ((a[i] >> j) & 1);
            ans += (tmp > n / 2);
            b[i] += (1 << j) * (tmp == n / 2);
        }
        if (dp[b[i]][0][1] != i) ans += dp[b[i]][0][0];
        else ans += dp[b[i]][1][0];
        cout << ans << '\n';
    }
}

Compilation message

council.cpp: In function 'int main()':
council.cpp:42:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   42 |         freopen(task ".inp","r",stdin);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
council.cpp:43:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   43 |         freopen(task ".out","w",stdout);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 460 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 233 ms 16864 KB Output is correct
6 Correct 233 ms 16732 KB Output is correct
7 Correct 252 ms 16864 KB Output is correct
8 Correct 248 ms 16864 KB Output is correct
9 Correct 249 ms 16976 KB Output is correct
10 Correct 247 ms 16728 KB Output is correct
11 Correct 283 ms 16864 KB Output is correct
12 Correct 246 ms 16880 KB Output is correct
13 Correct 1 ms 344 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 1 ms 344 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 1 ms 600 KB Output is correct
19 Correct 1 ms 344 KB Output is correct
20 Correct 1 ms 348 KB Output is correct
21 Correct 1 ms 348 KB Output is correct
22 Correct 1 ms 348 KB Output is correct
23 Correct 1 ms 344 KB Output is correct
24 Correct 1 ms 348 KB Output is correct
25 Correct 1 ms 348 KB Output is correct
26 Correct 1 ms 348 KB Output is correct
27 Correct 1 ms 344 KB Output is correct
28 Correct 1 ms 348 KB Output is correct
29 Correct 1 ms 348 KB Output is correct
30 Correct 1 ms 348 KB Output is correct
31 Correct 1 ms 348 KB Output is correct
32 Correct 1 ms 348 KB Output is correct
33 Correct 1 ms 348 KB Output is correct
34 Correct 2 ms 348 KB Output is correct
35 Correct 1 ms 348 KB Output is correct
36 Correct 1 ms 348 KB Output is correct
37 Correct 1 ms 348 KB Output is correct
38 Correct 1 ms 348 KB Output is correct
39 Correct 1 ms 348 KB Output is correct
40 Correct 1 ms 348 KB Output is correct
41 Correct 5 ms 604 KB Output is correct
42 Correct 4 ms 604 KB Output is correct
43 Correct 5 ms 604 KB Output is correct
44 Correct 5 ms 600 KB Output is correct
45 Correct 4 ms 604 KB Output is correct
46 Correct 26 ms 2396 KB Output is correct
47 Correct 29 ms 2392 KB Output is correct
48 Correct 29 ms 2396 KB Output is correct
49 Correct 28 ms 2392 KB Output is correct
50 Correct 29 ms 2396 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 460 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 233 ms 16864 KB Output is correct
6 Correct 233 ms 16732 KB Output is correct
7 Correct 252 ms 16864 KB Output is correct
8 Correct 248 ms 16864 KB Output is correct
9 Correct 249 ms 16976 KB Output is correct
10 Correct 247 ms 16728 KB Output is correct
11 Correct 283 ms 16864 KB Output is correct
12 Correct 246 ms 16880 KB Output is correct
13 Correct 1 ms 344 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 1 ms 344 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 1 ms 600 KB Output is correct
19 Correct 1 ms 344 KB Output is correct
20 Correct 1 ms 348 KB Output is correct
21 Correct 1 ms 348 KB Output is correct
22 Correct 1 ms 348 KB Output is correct
23 Correct 1 ms 344 KB Output is correct
24 Correct 1 ms 348 KB Output is correct
25 Correct 1 ms 348 KB Output is correct
26 Correct 1 ms 348 KB Output is correct
27 Correct 1 ms 344 KB Output is correct
28 Correct 1 ms 348 KB Output is correct
29 Correct 1 ms 348 KB Output is correct
30 Correct 1 ms 348 KB Output is correct
31 Correct 1 ms 348 KB Output is correct
32 Correct 1 ms 348 KB Output is correct
33 Correct 1 ms 348 KB Output is correct
34 Correct 2 ms 348 KB Output is correct
35 Correct 1 ms 348 KB Output is correct
36 Correct 1 ms 348 KB Output is correct
37 Correct 1 ms 348 KB Output is correct
38 Correct 1 ms 348 KB Output is correct
39 Correct 1 ms 348 KB Output is correct
40 Correct 1 ms 348 KB Output is correct
41 Correct 5 ms 604 KB Output is correct
42 Correct 4 ms 604 KB Output is correct
43 Correct 5 ms 604 KB Output is correct
44 Correct 5 ms 600 KB Output is correct
45 Correct 4 ms 604 KB Output is correct
46 Correct 26 ms 2396 KB Output is correct
47 Correct 29 ms 2392 KB Output is correct
48 Correct 29 ms 2396 KB Output is correct
49 Correct 28 ms 2392 KB Output is correct
50 Correct 29 ms 2396 KB Output is correct
51 Correct 242 ms 16984 KB Output is correct
52 Correct 265 ms 16984 KB Output is correct
53 Correct 243 ms 17012 KB Output is correct
54 Correct 241 ms 16988 KB Output is correct
55 Correct 1 ms 344 KB Output is correct
56 Correct 29 ms 2652 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 40 ms 4476 KB Output is correct
3 Correct 41 ms 4356 KB Output is correct
4 Correct 30 ms 3924 KB Output is correct
5 Correct 43 ms 4436 KB Output is correct
6 Correct 31 ms 3920 KB Output is correct
7 Correct 43 ms 4436 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 1 ms 344 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 1 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 40 ms 4476 KB Output is correct
3 Correct 41 ms 4356 KB Output is correct
4 Correct 30 ms 3924 KB Output is correct
5 Correct 43 ms 4436 KB Output is correct
6 Correct 31 ms 3920 KB Output is correct
7 Correct 43 ms 4436 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 1 ms 344 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 1 ms 344 KB Output is correct
18 Correct 1 ms 344 KB Output is correct
19 Correct 1 ms 348 KB Output is correct
20 Correct 150 ms 9064 KB Output is correct
21 Correct 148 ms 8568 KB Output is correct
22 Correct 137 ms 8528 KB Output is correct
23 Correct 133 ms 9332 KB Output is correct
24 Correct 132 ms 9044 KB Output is correct
25 Correct 161 ms 9144 KB Output is correct
26 Correct 148 ms 9220 KB Output is correct
27 Correct 1 ms 348 KB Output is correct
28 Correct 1 ms 344 KB Output is correct
29 Correct 1 ms 348 KB Output is correct
30 Correct 1 ms 348 KB Output is correct
31 Correct 1 ms 348 KB Output is correct
32 Correct 1 ms 348 KB Output is correct
33 Correct 1 ms 348 KB Output is correct
34 Correct 1 ms 344 KB Output is correct
35 Correct 1 ms 348 KB Output is correct
36 Correct 1 ms 348 KB Output is correct
37 Correct 1 ms 348 KB Output is correct
38 Correct 1 ms 348 KB Output is correct
39 Correct 1 ms 348 KB Output is correct
40 Correct 1 ms 348 KB Output is correct
41 Correct 1 ms 348 KB Output is correct
42 Correct 1 ms 348 KB Output is correct
43 Correct 1 ms 348 KB Output is correct
44 Correct 1 ms 348 KB Output is correct
45 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 40 ms 4476 KB Output is correct
3 Correct 41 ms 4356 KB Output is correct
4 Correct 30 ms 3924 KB Output is correct
5 Correct 43 ms 4436 KB Output is correct
6 Correct 31 ms 3920 KB Output is correct
7 Correct 43 ms 4436 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 1 ms 344 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 1 ms 344 KB Output is correct
18 Correct 1 ms 344 KB Output is correct
19 Correct 1 ms 348 KB Output is correct
20 Correct 150 ms 9064 KB Output is correct
21 Correct 148 ms 8568 KB Output is correct
22 Correct 137 ms 8528 KB Output is correct
23 Correct 133 ms 9332 KB Output is correct
24 Correct 132 ms 9044 KB Output is correct
25 Correct 161 ms 9144 KB Output is correct
26 Correct 148 ms 9220 KB Output is correct
27 Correct 1 ms 348 KB Output is correct
28 Correct 1 ms 344 KB Output is correct
29 Correct 1 ms 348 KB Output is correct
30 Correct 1 ms 348 KB Output is correct
31 Correct 1 ms 348 KB Output is correct
32 Correct 1 ms 348 KB Output is correct
33 Correct 1 ms 348 KB Output is correct
34 Correct 1 ms 344 KB Output is correct
35 Correct 1 ms 348 KB Output is correct
36 Correct 1 ms 348 KB Output is correct
37 Correct 1 ms 348 KB Output is correct
38 Correct 1 ms 348 KB Output is correct
39 Correct 1 ms 348 KB Output is correct
40 Correct 1 ms 348 KB Output is correct
41 Correct 1 ms 348 KB Output is correct
42 Correct 1 ms 348 KB Output is correct
43 Correct 1 ms 348 KB Output is correct
44 Correct 1 ms 348 KB Output is correct
45 Correct 1 ms 348 KB Output is correct
46 Correct 1 ms 344 KB Output is correct
47 Correct 200 ms 11608 KB Output is correct
48 Correct 185 ms 11088 KB Output is correct
49 Correct 198 ms 11116 KB Output is correct
50 Correct 180 ms 12140 KB Output is correct
51 Correct 179 ms 11856 KB Output is correct
52 Correct 213 ms 11632 KB Output is correct
53 Correct 202 ms 12112 KB Output is correct
54 Correct 5 ms 604 KB Output is correct
55 Correct 4 ms 604 KB Output is correct
56 Correct 4 ms 728 KB Output is correct
57 Correct 4 ms 604 KB Output is correct
58 Correct 4 ms 604 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 40 ms 4476 KB Output is correct
3 Correct 41 ms 4356 KB Output is correct
4 Correct 30 ms 3924 KB Output is correct
5 Correct 43 ms 4436 KB Output is correct
6 Correct 31 ms 3920 KB Output is correct
7 Correct 43 ms 4436 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 1 ms 344 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 1 ms 344 KB Output is correct
18 Correct 1 ms 344 KB Output is correct
19 Correct 1 ms 348 KB Output is correct
20 Correct 150 ms 9064 KB Output is correct
21 Correct 148 ms 8568 KB Output is correct
22 Correct 137 ms 8528 KB Output is correct
23 Correct 133 ms 9332 KB Output is correct
24 Correct 132 ms 9044 KB Output is correct
25 Correct 161 ms 9144 KB Output is correct
26 Correct 148 ms 9220 KB Output is correct
27 Correct 1 ms 348 KB Output is correct
28 Correct 1 ms 344 KB Output is correct
29 Correct 1 ms 348 KB Output is correct
30 Correct 1 ms 348 KB Output is correct
31 Correct 1 ms 348 KB Output is correct
32 Correct 1 ms 348 KB Output is correct
33 Correct 1 ms 348 KB Output is correct
34 Correct 1 ms 344 KB Output is correct
35 Correct 1 ms 348 KB Output is correct
36 Correct 1 ms 348 KB Output is correct
37 Correct 1 ms 348 KB Output is correct
38 Correct 1 ms 348 KB Output is correct
39 Correct 1 ms 348 KB Output is correct
40 Correct 1 ms 348 KB Output is correct
41 Correct 1 ms 348 KB Output is correct
42 Correct 1 ms 348 KB Output is correct
43 Correct 1 ms 348 KB Output is correct
44 Correct 1 ms 348 KB Output is correct
45 Correct 1 ms 348 KB Output is correct
46 Correct 1 ms 344 KB Output is correct
47 Correct 200 ms 11608 KB Output is correct
48 Correct 185 ms 11088 KB Output is correct
49 Correct 198 ms 11116 KB Output is correct
50 Correct 180 ms 12140 KB Output is correct
51 Correct 179 ms 11856 KB Output is correct
52 Correct 213 ms 11632 KB Output is correct
53 Correct 202 ms 12112 KB Output is correct
54 Correct 5 ms 604 KB Output is correct
55 Correct 4 ms 604 KB Output is correct
56 Correct 4 ms 728 KB Output is correct
57 Correct 4 ms 604 KB Output is correct
58 Correct 4 ms 604 KB Output is correct
59 Correct 236 ms 13904 KB Output is correct
60 Correct 116 ms 7508 KB Output is correct
61 Correct 124 ms 7848 KB Output is correct
62 Correct 127 ms 7888 KB Output is correct
63 Correct 236 ms 13776 KB Output is correct
64 Correct 271 ms 15188 KB Output is correct
65 Correct 264 ms 15164 KB Output is correct
66 Correct 251 ms 15648 KB Output is correct
67 Correct 235 ms 15456 KB Output is correct
68 Correct 276 ms 15412 KB Output is correct
69 Correct 269 ms 15700 KB Output is correct
70 Correct 27 ms 2396 KB Output is correct
71 Correct 29 ms 2392 KB Output is correct
72 Correct 28 ms 2392 KB Output is correct
73 Correct 32 ms 2500 KB Output is correct
74 Correct 32 ms 2392 KB Output is correct
75 Correct 29 ms 2648 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 460 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 233 ms 16864 KB Output is correct
6 Correct 233 ms 16732 KB Output is correct
7 Correct 252 ms 16864 KB Output is correct
8 Correct 248 ms 16864 KB Output is correct
9 Correct 249 ms 16976 KB Output is correct
10 Correct 247 ms 16728 KB Output is correct
11 Correct 283 ms 16864 KB Output is correct
12 Correct 246 ms 16880 KB Output is correct
13 Correct 1 ms 344 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 1 ms 344 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 1 ms 600 KB Output is correct
19 Correct 1 ms 344 KB Output is correct
20 Correct 1 ms 348 KB Output is correct
21 Correct 1 ms 348 KB Output is correct
22 Correct 1 ms 348 KB Output is correct
23 Correct 1 ms 344 KB Output is correct
24 Correct 1 ms 348 KB Output is correct
25 Correct 1 ms 348 KB Output is correct
26 Correct 1 ms 348 KB Output is correct
27 Correct 1 ms 344 KB Output is correct
28 Correct 1 ms 348 KB Output is correct
29 Correct 1 ms 348 KB Output is correct
30 Correct 1 ms 348 KB Output is correct
31 Correct 1 ms 348 KB Output is correct
32 Correct 1 ms 348 KB Output is correct
33 Correct 1 ms 348 KB Output is correct
34 Correct 2 ms 348 KB Output is correct
35 Correct 1 ms 348 KB Output is correct
36 Correct 1 ms 348 KB Output is correct
37 Correct 1 ms 348 KB Output is correct
38 Correct 1 ms 348 KB Output is correct
39 Correct 1 ms 348 KB Output is correct
40 Correct 1 ms 348 KB Output is correct
41 Correct 5 ms 604 KB Output is correct
42 Correct 4 ms 604 KB Output is correct
43 Correct 5 ms 604 KB Output is correct
44 Correct 5 ms 600 KB Output is correct
45 Correct 4 ms 604 KB Output is correct
46 Correct 26 ms 2396 KB Output is correct
47 Correct 29 ms 2392 KB Output is correct
48 Correct 29 ms 2396 KB Output is correct
49 Correct 28 ms 2392 KB Output is correct
50 Correct 29 ms 2396 KB Output is correct
51 Correct 242 ms 16984 KB Output is correct
52 Correct 265 ms 16984 KB Output is correct
53 Correct 243 ms 17012 KB Output is correct
54 Correct 241 ms 16988 KB Output is correct
55 Correct 1 ms 344 KB Output is correct
56 Correct 29 ms 2652 KB Output is correct
57 Correct 1 ms 344 KB Output is correct
58 Correct 40 ms 4476 KB Output is correct
59 Correct 41 ms 4356 KB Output is correct
60 Correct 30 ms 3924 KB Output is correct
61 Correct 43 ms 4436 KB Output is correct
62 Correct 31 ms 3920 KB Output is correct
63 Correct 43 ms 4436 KB Output is correct
64 Correct 1 ms 348 KB Output is correct
65 Correct 1 ms 348 KB Output is correct
66 Correct 1 ms 348 KB Output is correct
67 Correct 1 ms 348 KB Output is correct
68 Correct 1 ms 348 KB Output is correct
69 Correct 1 ms 348 KB Output is correct
70 Correct 1 ms 348 KB Output is correct
71 Correct 1 ms 344 KB Output is correct
72 Correct 1 ms 348 KB Output is correct
73 Correct 1 ms 344 KB Output is correct
74 Correct 1 ms 344 KB Output is correct
75 Correct 1 ms 348 KB Output is correct
76 Correct 150 ms 9064 KB Output is correct
77 Correct 148 ms 8568 KB Output is correct
78 Correct 137 ms 8528 KB Output is correct
79 Correct 133 ms 9332 KB Output is correct
80 Correct 132 ms 9044 KB Output is correct
81 Correct 161 ms 9144 KB Output is correct
82 Correct 148 ms 9220 KB Output is correct
83 Correct 1 ms 348 KB Output is correct
84 Correct 1 ms 344 KB Output is correct
85 Correct 1 ms 348 KB Output is correct
86 Correct 1 ms 348 KB Output is correct
87 Correct 1 ms 348 KB Output is correct
88 Correct 1 ms 348 KB Output is correct
89 Correct 1 ms 348 KB Output is correct
90 Correct 1 ms 344 KB Output is correct
91 Correct 1 ms 348 KB Output is correct
92 Correct 1 ms 348 KB Output is correct
93 Correct 1 ms 348 KB Output is correct
94 Correct 1 ms 348 KB Output is correct
95 Correct 1 ms 348 KB Output is correct
96 Correct 1 ms 348 KB Output is correct
97 Correct 1 ms 348 KB Output is correct
98 Correct 1 ms 348 KB Output is correct
99 Correct 1 ms 348 KB Output is correct
100 Correct 1 ms 348 KB Output is correct
101 Correct 1 ms 348 KB Output is correct
102 Correct 1 ms 344 KB Output is correct
103 Correct 200 ms 11608 KB Output is correct
104 Correct 185 ms 11088 KB Output is correct
105 Correct 198 ms 11116 KB Output is correct
106 Correct 180 ms 12140 KB Output is correct
107 Correct 179 ms 11856 KB Output is correct
108 Correct 213 ms 11632 KB Output is correct
109 Correct 202 ms 12112 KB Output is correct
110 Correct 5 ms 604 KB Output is correct
111 Correct 4 ms 604 KB Output is correct
112 Correct 4 ms 728 KB Output is correct
113 Correct 4 ms 604 KB Output is correct
114 Correct 4 ms 604 KB Output is correct
115 Correct 236 ms 13904 KB Output is correct
116 Correct 116 ms 7508 KB Output is correct
117 Correct 124 ms 7848 KB Output is correct
118 Correct 127 ms 7888 KB Output is correct
119 Correct 236 ms 13776 KB Output is correct
120 Correct 271 ms 15188 KB Output is correct
121 Correct 264 ms 15164 KB Output is correct
122 Correct 251 ms 15648 KB Output is correct
123 Correct 235 ms 15456 KB Output is correct
124 Correct 276 ms 15412 KB Output is correct
125 Correct 269 ms 15700 KB Output is correct
126 Correct 27 ms 2396 KB Output is correct
127 Correct 29 ms 2392 KB Output is correct
128 Correct 28 ms 2392 KB Output is correct
129 Correct 32 ms 2500 KB Output is correct
130 Correct 32 ms 2392 KB Output is correct
131 Correct 29 ms 2648 KB Output is correct
132 Correct 574 ms 31808 KB Output is correct
133 Correct 542 ms 31592 KB Output is correct
134 Correct 590 ms 31812 KB Output is correct
135 Correct 552 ms 31536 KB Output is correct
136 Correct 600 ms 31808 KB Output is correct
137 Correct 473 ms 22824 KB Output is correct
138 Correct 448 ms 23036 KB Output is correct
139 Correct 491 ms 31804 KB Output is correct
140 Correct 485 ms 31292 KB Output is correct
141 Correct 556 ms 31312 KB Output is correct
142 Correct 609 ms 31796 KB Output is correct