Submission #767768

# Submission time Handle Problem Language Result Execution time Memory
767768 2023-06-27T07:05:54 Z PurpleCrayon Council (JOI23_council) C++17
100 / 100
713 ms 46388 KB
#include <bits/stdc++.h>
using namespace std;
 
#define sz(v) int(v.size())
#define ar array
typedef long long ll;
const int N = 3e5+10, MOD = 1e9+7;
const int M = 21;

int n, m, a[N], cnt[M];
// minimal number of things to turn off so that it becomes a subset of ~bad
ar<ar<int, 2>, 2> best[1 << M], sub[1 << M];

ar<ar<int, 2>, 2> add(ar<ar<int, 2>, 2> base, ar<int, 2> x) {
    for (ar<int, 2> y : base) if (y[1] == x[1]) return base;

    if (x < base[0]) {
        swap(base[0], base[1]);
        base[0] = x;
    } else if (x < base[1]) {
        base[1] = x;
    }

    return base;
}

ar<ar<int, 2>, 2> add(ar<ar<int, 2>, 2> base, ar<ar<int, 2>, 2> x) {
    return add(add(base, x[0]), x[1]);
}

void solve() {
    cin >> n >> m;

    ar<ar<int, 2>, 2> INF; INF.fill(ar<int, 2>{MOD, MOD});

    fill(best, best + (1 << m), INF);
    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;
        }
        best[a[i]] = add(best[a[i]], ar<int, 2>{__builtin_popcount(a[i]), i});
    }

    for (int j = 0; j < m; j++) {
        for (int i = (1 << m) - 1; i >= 0; i--) if ((i >> j) & 1 ^ 1) {
            best[i] = add(best[i], best[i ^ (1 << j)]);
        }
    }

    fill(sub, sub + (1 << m), INF);
    for (int i = 0; i < (1 << m); i++) {
        for (auto [x, c] : best[i]) if (c < MOD) {
            int cost = x - __builtin_popcount(i);
            sub[i] = add(sub[i], ar<int, 2>{cost, c});
        }
    }

    for (int j = 0; j < m; j++) {
        for (int i = 0; i < (1 << m); i++) if ((i >> j) & 1) {
            sub[i] = add(sub[i], sub[i ^ (1 << j)]);
        }
    }

    for (int i = 0; i < n; i++) {
        int base = 0;
        int bad = 0;
        for (int j = 0; j < m; j++) {
            int need = n / 2;
            int has = cnt[j] - ((a[i] >> j) & 1);
            if (has != need) {
                base += has > need;
                continue;
            }

            bad |= 1 << j;
            base++;
        }

        int ans = m;
        int can_sub = (1 << m) - 1 - bad;
        for (auto [x, c] : sub[can_sub]) if (c != i) {
            ans = min(ans, x);
        }

        // for (int j = 0; j < n; j++) if (j != i) ans = min(ans, __builtin_popcount(a[j] & bad));
        cout << base - ans << '\n';
    }
}
 
int main() {
    ios::sync_with_stdio(false); cin.tie(0);
    int T = 1;
    // cin >> T;
    while (T--) solve();
}

Compilation message

council.cpp: In function 'void solve()':
council.cpp:48:62: warning: suggest parentheses around arithmetic in operand of '^' [-Wparentheses]
   48 |         for (int i = (1 << m) - 1; i >= 0; i--) if ((i >> j) & 1 ^ 1) {
      |                                                     ~~~~~~~~~^~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 0 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 156 ms 33136 KB Output is correct
6 Correct 159 ms 33136 KB Output is correct
7 Correct 151 ms 33152 KB Output is correct
8 Correct 168 ms 33124 KB Output is correct
9 Correct 226 ms 33252 KB Output is correct
10 Correct 152 ms 33132 KB Output is correct
11 Correct 171 ms 33152 KB Output is correct
12 Correct 227 ms 33140 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 1 ms 324 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 1 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 0 ms 340 KB Output is correct
22 Correct 1 ms 328 KB Output is correct
23 Correct 0 ms 332 KB Output is correct
24 Correct 0 ms 340 KB Output is correct
25 Correct 1 ms 340 KB Output is correct
26 Correct 0 ms 340 KB Output is correct
27 Correct 1 ms 340 KB Output is correct
28 Correct 0 ms 340 KB Output is correct
29 Correct 1 ms 328 KB Output is correct
30 Correct 1 ms 340 KB Output is correct
31 Correct 1 ms 340 KB Output is correct
32 Correct 1 ms 340 KB Output is correct
33 Correct 1 ms 328 KB Output is correct
34 Correct 1 ms 328 KB Output is correct
35 Correct 0 ms 340 KB Output is correct
36 Correct 0 ms 340 KB Output is correct
37 Correct 1 ms 340 KB Output is correct
38 Correct 1 ms 340 KB Output is correct
39 Correct 1 ms 340 KB Output is correct
40 Correct 1 ms 340 KB Output is correct
41 Correct 2 ms 852 KB Output is correct
42 Correct 2 ms 852 KB Output is correct
43 Correct 3 ms 852 KB Output is correct
44 Correct 2 ms 852 KB Output is correct
45 Correct 3 ms 852 KB Output is correct
46 Correct 16 ms 4452 KB Output is correct
47 Correct 16 ms 4452 KB Output is correct
48 Correct 18 ms 4436 KB Output is correct
49 Correct 17 ms 4436 KB Output is correct
50 Correct 18 ms 4444 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 0 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 156 ms 33136 KB Output is correct
6 Correct 159 ms 33136 KB Output is correct
7 Correct 151 ms 33152 KB Output is correct
8 Correct 168 ms 33124 KB Output is correct
9 Correct 226 ms 33252 KB Output is correct
10 Correct 152 ms 33132 KB Output is correct
11 Correct 171 ms 33152 KB Output is correct
12 Correct 227 ms 33140 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 1 ms 324 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 1 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 0 ms 340 KB Output is correct
22 Correct 1 ms 328 KB Output is correct
23 Correct 0 ms 332 KB Output is correct
24 Correct 0 ms 340 KB Output is correct
25 Correct 1 ms 340 KB Output is correct
26 Correct 0 ms 340 KB Output is correct
27 Correct 1 ms 340 KB Output is correct
28 Correct 0 ms 340 KB Output is correct
29 Correct 1 ms 328 KB Output is correct
30 Correct 1 ms 340 KB Output is correct
31 Correct 1 ms 340 KB Output is correct
32 Correct 1 ms 340 KB Output is correct
33 Correct 1 ms 328 KB Output is correct
34 Correct 1 ms 328 KB Output is correct
35 Correct 0 ms 340 KB Output is correct
36 Correct 0 ms 340 KB Output is correct
37 Correct 1 ms 340 KB Output is correct
38 Correct 1 ms 340 KB Output is correct
39 Correct 1 ms 340 KB Output is correct
40 Correct 1 ms 340 KB Output is correct
41 Correct 2 ms 852 KB Output is correct
42 Correct 2 ms 852 KB Output is correct
43 Correct 3 ms 852 KB Output is correct
44 Correct 2 ms 852 KB Output is correct
45 Correct 3 ms 852 KB Output is correct
46 Correct 16 ms 4452 KB Output is correct
47 Correct 16 ms 4452 KB Output is correct
48 Correct 18 ms 4436 KB Output is correct
49 Correct 17 ms 4436 KB Output is correct
50 Correct 18 ms 4444 KB Output is correct
51 Correct 161 ms 33248 KB Output is correct
52 Correct 150 ms 33268 KB Output is correct
53 Correct 287 ms 33240 KB Output is correct
54 Correct 291 ms 33276 KB Output is correct
55 Correct 1 ms 340 KB Output is correct
56 Correct 38 ms 4536 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 45 ms 2316 KB Output is correct
3 Correct 48 ms 2976 KB Output is correct
4 Correct 35 ms 2512 KB Output is correct
5 Correct 51 ms 3076 KB Output is correct
6 Correct 37 ms 2552 KB Output is correct
7 Correct 52 ms 3012 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 0 ms 340 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 0 ms 328 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 1 ms 340 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 1 ms 340 KB Output is correct
17 Correct 1 ms 332 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 45 ms 2316 KB Output is correct
3 Correct 48 ms 2976 KB Output is correct
4 Correct 35 ms 2512 KB Output is correct
5 Correct 51 ms 3076 KB Output is correct
6 Correct 37 ms 2552 KB Output is correct
7 Correct 52 ms 3012 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 0 ms 340 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 0 ms 328 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 1 ms 340 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 1 ms 340 KB Output is correct
17 Correct 1 ms 332 KB Output is correct
18 Correct 1 ms 340 KB Output is correct
19 Correct 1 ms 340 KB Output is correct
20 Correct 174 ms 7176 KB Output is correct
21 Correct 157 ms 6244 KB Output is correct
22 Correct 158 ms 6460 KB Output is correct
23 Correct 160 ms 7356 KB Output is correct
24 Correct 153 ms 6932 KB Output is correct
25 Correct 165 ms 7060 KB Output is correct
26 Correct 183 ms 7184 KB Output is correct
27 Correct 1 ms 340 KB Output is correct
28 Correct 0 ms 212 KB Output is correct
29 Correct 0 ms 340 KB Output is correct
30 Correct 0 ms 340 KB Output is correct
31 Correct 1 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 1 ms 340 KB Output is correct
35 Correct 1 ms 340 KB Output is correct
36 Correct 1 ms 340 KB Output is correct
37 Correct 0 ms 340 KB Output is correct
38 Correct 1 ms 340 KB Output is correct
39 Correct 1 ms 328 KB Output is correct
40 Correct 1 ms 340 KB Output is correct
41 Correct 0 ms 340 KB Output is correct
42 Correct 1 ms 340 KB Output is correct
43 Correct 1 ms 340 KB Output is correct
44 Correct 1 ms 340 KB Output is correct
45 Correct 1 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 45 ms 2316 KB Output is correct
3 Correct 48 ms 2976 KB Output is correct
4 Correct 35 ms 2512 KB Output is correct
5 Correct 51 ms 3076 KB Output is correct
6 Correct 37 ms 2552 KB Output is correct
7 Correct 52 ms 3012 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 0 ms 340 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 0 ms 328 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 1 ms 340 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 1 ms 340 KB Output is correct
17 Correct 1 ms 332 KB Output is correct
18 Correct 1 ms 340 KB Output is correct
19 Correct 1 ms 340 KB Output is correct
20 Correct 174 ms 7176 KB Output is correct
21 Correct 157 ms 6244 KB Output is correct
22 Correct 158 ms 6460 KB Output is correct
23 Correct 160 ms 7356 KB Output is correct
24 Correct 153 ms 6932 KB Output is correct
25 Correct 165 ms 7060 KB Output is correct
26 Correct 183 ms 7184 KB Output is correct
27 Correct 1 ms 340 KB Output is correct
28 Correct 0 ms 212 KB Output is correct
29 Correct 0 ms 340 KB Output is correct
30 Correct 0 ms 340 KB Output is correct
31 Correct 1 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 1 ms 340 KB Output is correct
35 Correct 1 ms 340 KB Output is correct
36 Correct 1 ms 340 KB Output is correct
37 Correct 0 ms 340 KB Output is correct
38 Correct 1 ms 340 KB Output is correct
39 Correct 1 ms 328 KB Output is correct
40 Correct 1 ms 340 KB Output is correct
41 Correct 0 ms 340 KB Output is correct
42 Correct 1 ms 340 KB Output is correct
43 Correct 1 ms 340 KB Output is correct
44 Correct 1 ms 340 KB Output is correct
45 Correct 1 ms 340 KB Output is correct
46 Correct 1 ms 452 KB Output is correct
47 Correct 236 ms 9636 KB Output is correct
48 Correct 231 ms 8816 KB Output is correct
49 Correct 230 ms 9172 KB Output is correct
50 Correct 210 ms 9420 KB Output is correct
51 Correct 208 ms 9548 KB Output is correct
52 Correct 236 ms 9268 KB Output is correct
53 Correct 238 ms 10152 KB Output is correct
54 Correct 2 ms 852 KB Output is correct
55 Correct 2 ms 852 KB Output is correct
56 Correct 3 ms 852 KB Output is correct
57 Correct 2 ms 852 KB Output is correct
58 Correct 3 ms 852 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 45 ms 2316 KB Output is correct
3 Correct 48 ms 2976 KB Output is correct
4 Correct 35 ms 2512 KB Output is correct
5 Correct 51 ms 3076 KB Output is correct
6 Correct 37 ms 2552 KB Output is correct
7 Correct 52 ms 3012 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 0 ms 340 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 0 ms 328 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 1 ms 340 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 1 ms 340 KB Output is correct
17 Correct 1 ms 332 KB Output is correct
18 Correct 1 ms 340 KB Output is correct
19 Correct 1 ms 340 KB Output is correct
20 Correct 174 ms 7176 KB Output is correct
21 Correct 157 ms 6244 KB Output is correct
22 Correct 158 ms 6460 KB Output is correct
23 Correct 160 ms 7356 KB Output is correct
24 Correct 153 ms 6932 KB Output is correct
25 Correct 165 ms 7060 KB Output is correct
26 Correct 183 ms 7184 KB Output is correct
27 Correct 1 ms 340 KB Output is correct
28 Correct 0 ms 212 KB Output is correct
29 Correct 0 ms 340 KB Output is correct
30 Correct 0 ms 340 KB Output is correct
31 Correct 1 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 1 ms 340 KB Output is correct
35 Correct 1 ms 340 KB Output is correct
36 Correct 1 ms 340 KB Output is correct
37 Correct 0 ms 340 KB Output is correct
38 Correct 1 ms 340 KB Output is correct
39 Correct 1 ms 328 KB Output is correct
40 Correct 1 ms 340 KB Output is correct
41 Correct 0 ms 340 KB Output is correct
42 Correct 1 ms 340 KB Output is correct
43 Correct 1 ms 340 KB Output is correct
44 Correct 1 ms 340 KB Output is correct
45 Correct 1 ms 340 KB Output is correct
46 Correct 1 ms 452 KB Output is correct
47 Correct 236 ms 9636 KB Output is correct
48 Correct 231 ms 8816 KB Output is correct
49 Correct 230 ms 9172 KB Output is correct
50 Correct 210 ms 9420 KB Output is correct
51 Correct 208 ms 9548 KB Output is correct
52 Correct 236 ms 9268 KB Output is correct
53 Correct 238 ms 10152 KB Output is correct
54 Correct 2 ms 852 KB Output is correct
55 Correct 2 ms 852 KB Output is correct
56 Correct 3 ms 852 KB Output is correct
57 Correct 2 ms 852 KB Output is correct
58 Correct 3 ms 852 KB Output is correct
59 Correct 267 ms 12648 KB Output is correct
60 Correct 140 ms 8356 KB Output is correct
61 Correct 152 ms 8624 KB Output is correct
62 Correct 150 ms 8796 KB Output is correct
63 Correct 280 ms 12344 KB Output is correct
64 Correct 316 ms 14832 KB Output is correct
65 Correct 322 ms 14808 KB Output is correct
66 Correct 254 ms 15308 KB Output is correct
67 Correct 248 ms 14744 KB Output is correct
68 Correct 315 ms 14728 KB Output is correct
69 Correct 320 ms 15356 KB Output is correct
70 Correct 21 ms 4448 KB Output is correct
71 Correct 18 ms 4428 KB Output is correct
72 Correct 21 ms 4440 KB Output is correct
73 Correct 16 ms 4436 KB Output is correct
74 Correct 19 ms 4444 KB Output is correct
75 Correct 38 ms 4540 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 0 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 156 ms 33136 KB Output is correct
6 Correct 159 ms 33136 KB Output is correct
7 Correct 151 ms 33152 KB Output is correct
8 Correct 168 ms 33124 KB Output is correct
9 Correct 226 ms 33252 KB Output is correct
10 Correct 152 ms 33132 KB Output is correct
11 Correct 171 ms 33152 KB Output is correct
12 Correct 227 ms 33140 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 1 ms 324 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 1 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 0 ms 340 KB Output is correct
22 Correct 1 ms 328 KB Output is correct
23 Correct 0 ms 332 KB Output is correct
24 Correct 0 ms 340 KB Output is correct
25 Correct 1 ms 340 KB Output is correct
26 Correct 0 ms 340 KB Output is correct
27 Correct 1 ms 340 KB Output is correct
28 Correct 0 ms 340 KB Output is correct
29 Correct 1 ms 328 KB Output is correct
30 Correct 1 ms 340 KB Output is correct
31 Correct 1 ms 340 KB Output is correct
32 Correct 1 ms 340 KB Output is correct
33 Correct 1 ms 328 KB Output is correct
34 Correct 1 ms 328 KB Output is correct
35 Correct 0 ms 340 KB Output is correct
36 Correct 0 ms 340 KB Output is correct
37 Correct 1 ms 340 KB Output is correct
38 Correct 1 ms 340 KB Output is correct
39 Correct 1 ms 340 KB Output is correct
40 Correct 1 ms 340 KB Output is correct
41 Correct 2 ms 852 KB Output is correct
42 Correct 2 ms 852 KB Output is correct
43 Correct 3 ms 852 KB Output is correct
44 Correct 2 ms 852 KB Output is correct
45 Correct 3 ms 852 KB Output is correct
46 Correct 16 ms 4452 KB Output is correct
47 Correct 16 ms 4452 KB Output is correct
48 Correct 18 ms 4436 KB Output is correct
49 Correct 17 ms 4436 KB Output is correct
50 Correct 18 ms 4444 KB Output is correct
51 Correct 161 ms 33248 KB Output is correct
52 Correct 150 ms 33268 KB Output is correct
53 Correct 287 ms 33240 KB Output is correct
54 Correct 291 ms 33276 KB Output is correct
55 Correct 1 ms 340 KB Output is correct
56 Correct 38 ms 4536 KB Output is correct
57 Correct 1 ms 340 KB Output is correct
58 Correct 45 ms 2316 KB Output is correct
59 Correct 48 ms 2976 KB Output is correct
60 Correct 35 ms 2512 KB Output is correct
61 Correct 51 ms 3076 KB Output is correct
62 Correct 37 ms 2552 KB Output is correct
63 Correct 52 ms 3012 KB Output is correct
64 Correct 1 ms 340 KB Output is correct
65 Correct 0 ms 340 KB Output is correct
66 Correct 1 ms 340 KB Output is correct
67 Correct 0 ms 328 KB Output is correct
68 Correct 1 ms 340 KB Output is correct
69 Correct 1 ms 340 KB Output is correct
70 Correct 1 ms 340 KB Output is correct
71 Correct 1 ms 212 KB Output is correct
72 Correct 1 ms 340 KB Output is correct
73 Correct 1 ms 332 KB Output is correct
74 Correct 1 ms 340 KB Output is correct
75 Correct 1 ms 340 KB Output is correct
76 Correct 174 ms 7176 KB Output is correct
77 Correct 157 ms 6244 KB Output is correct
78 Correct 158 ms 6460 KB Output is correct
79 Correct 160 ms 7356 KB Output is correct
80 Correct 153 ms 6932 KB Output is correct
81 Correct 165 ms 7060 KB Output is correct
82 Correct 183 ms 7184 KB Output is correct
83 Correct 1 ms 340 KB Output is correct
84 Correct 0 ms 212 KB Output is correct
85 Correct 0 ms 340 KB Output is correct
86 Correct 0 ms 340 KB Output is correct
87 Correct 1 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 1 ms 340 KB Output is correct
91 Correct 1 ms 340 KB Output is correct
92 Correct 1 ms 340 KB Output is correct
93 Correct 0 ms 340 KB Output is correct
94 Correct 1 ms 340 KB Output is correct
95 Correct 1 ms 328 KB Output is correct
96 Correct 1 ms 340 KB Output is correct
97 Correct 0 ms 340 KB Output is correct
98 Correct 1 ms 340 KB Output is correct
99 Correct 1 ms 340 KB Output is correct
100 Correct 1 ms 340 KB Output is correct
101 Correct 1 ms 340 KB Output is correct
102 Correct 1 ms 452 KB Output is correct
103 Correct 236 ms 9636 KB Output is correct
104 Correct 231 ms 8816 KB Output is correct
105 Correct 230 ms 9172 KB Output is correct
106 Correct 210 ms 9420 KB Output is correct
107 Correct 208 ms 9548 KB Output is correct
108 Correct 236 ms 9268 KB Output is correct
109 Correct 238 ms 10152 KB Output is correct
110 Correct 2 ms 852 KB Output is correct
111 Correct 2 ms 852 KB Output is correct
112 Correct 3 ms 852 KB Output is correct
113 Correct 2 ms 852 KB Output is correct
114 Correct 3 ms 852 KB Output is correct
115 Correct 267 ms 12648 KB Output is correct
116 Correct 140 ms 8356 KB Output is correct
117 Correct 152 ms 8624 KB Output is correct
118 Correct 150 ms 8796 KB Output is correct
119 Correct 280 ms 12344 KB Output is correct
120 Correct 316 ms 14832 KB Output is correct
121 Correct 322 ms 14808 KB Output is correct
122 Correct 254 ms 15308 KB Output is correct
123 Correct 248 ms 14744 KB Output is correct
124 Correct 315 ms 14728 KB Output is correct
125 Correct 320 ms 15356 KB Output is correct
126 Correct 21 ms 4448 KB Output is correct
127 Correct 18 ms 4428 KB Output is correct
128 Correct 21 ms 4440 KB Output is correct
129 Correct 16 ms 4436 KB Output is correct
130 Correct 19 ms 4444 KB Output is correct
131 Correct 38 ms 4540 KB Output is correct
132 Correct 638 ms 45272 KB Output is correct
133 Correct 606 ms 45236 KB Output is correct
134 Correct 622 ms 45792 KB Output is correct
135 Correct 647 ms 45704 KB Output is correct
136 Correct 651 ms 45388 KB Output is correct
137 Correct 438 ms 28716 KB Output is correct
138 Correct 433 ms 29392 KB Output is correct
139 Correct 425 ms 46028 KB Output is correct
140 Correct 438 ms 45196 KB Output is correct
141 Correct 687 ms 45124 KB Output is correct
142 Correct 713 ms 46388 KB Output is correct