Submission #1036339

# Submission time Handle Problem Language Result Execution time Memory
1036339 2024-07-27T09:27:20 Z tvladm2009 Cookies (JOI23_cookies) C++17
100 / 100
82 ms 29192 KB
#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long ll;
 
const int N = 3000 + 7;
const int M = 15000 + 7;
 
int n, m, a[M], b[M];
int vertical[M], bigger[M];
 
struct MyBitset {
    vector<ll> b;
    int n;
 
    void resize(int nn) {
        n = nn;
        b.resize(n / 63 + 2, 0);
    }
 
    void set(int x) {
        b[x / 63] |= (1LL << (x % 63));
    }
 
    bool get(int x) {
        if (x > n) {
            return 0;
        }
        if (b[x / 63] & (1LL << (x % 63))) {
            return true;
        } else {
            return false;
        }
    }
};
 
int f[M];
 
void add(int i, int x) {
    for (; i <= n; i += i & -i) f[i] += x;
}
 
int get(int i) {
    int res = 0;
    for (; i >= 1; i -= i & -i) res += f[i];
    return res;
}
 
int get_next(int x) {
    int l = 1, r = x, sol = 0;
    while (l <= r) {
        int m = (l + r) / 2;
        if (get(x) - get(m - 1) >= 1) {
            l = m + 1;
            sol = m;
        } else {
            r = m - 1;
        }
    }
    return sol;
}
 
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin >> n;
    for (int i = 1; i <= n; ++i) cin >> a[i];
    cin >> m;
    for (int i = 1; i <= m; ++i) cin >> b[i];
    
    int sumA = 0;
    for (int i = 1; i <= n; ++i) {
        sumA += a[i];
        bigger[a[i]]++;
    }
    for (int i = sumA; i >= 0; --i) bigger[i] += bigger[i + 1];
    reverse(b + 1, b + m + 1);
    for (int i = 1; i <= sumA; ++i) {
        vertical[i] = vertical[i - 1] + bigger[i];
    }
    vector<bitset<M>> dp(M + 1);
    bitset<M> full;
    for (int i = 0; i < M; ++i) full[i] = 1;

    dp[0][0] = 1; 
    for (int i = 1; i <= m; ++i) {
        for (int c = 1; c <= (M - 1) / b[i]; ++c) {
            dp[c] |= (dp[c - 1] << b[i]);
            dp[c] &= full >> max(0, M - 1 - vertical[c]);
        }
    }
    for (int x = 1; x <= sumA; ++x) {
        if (dp[x][sumA] == 1) {
            cout << x << "\n";
            vector<pair<int, int>> boxes;
            int cnt = x;
            int sum = sumA;
            int pos = m;
            while (pos > 0) {
                while (cnt > 0 && dp[cnt - 1][sumA - b[pos]]) {
                    sumA -= b[pos];
                    cnt--;
                    boxes.push_back({b[pos], boxes.size()});
                }
                pos--;
            }
            
            vector<vector<int>> sol(boxes.size());
            vector<vector<int>> occ(n + 1);
            sort(boxes.rbegin(), boxes.rend());
            for (int i = 0; i < boxes.size(); ++i) {
                occ[boxes[i].first].push_back(boxes[i].second);
                add(boxes[i].first, 1);
            }
            for (int it = 1; it <= n; ++it) {
                vector<int> mod;
                int x = get_next(n);
                int val = a[it];
                while (a[it] > 0) {
                    int steps = min(a[it], (int) occ[x].size());
                    for (int i = 1; i <= steps; ++i) {
                        mod.push_back(x);
                    }
                    a[it] -= steps;
                    x = get_next(x - 1);
                }
 
                reverse(mod.begin(), mod.end());
                for (auto i : mod) {
                    assert(occ[i].size() > 0);
                    
                    int x = occ[i].back();
                    occ[i].pop_back();
                    add(i, -1);
                    sol[x].push_back(it);
 
                    if (i >= 2) {
                        add(i - 1, 1);
                        occ[i - 1].push_back(x);
                    }
                }
            }
 
            for (int i = 0; i < boxes.size(); ++i) {
                cout << sol[i].size() << " ";
                for (auto j : sol[i]) {
                    cout << j << " ";
                }
                cout << "\n";
            }
            return 0;
        }
    }
    cout << -1 << "\n";
    return 0;
}

Compilation message

cookies.cpp: In function 'int main()':
cookies.cpp:112:31: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  112 |             for (int i = 0; i < boxes.size(); ++i) {
      |                             ~~^~~~~~~~~~~~~~
cookies.cpp:119:21: warning: unused variable 'val' [-Wunused-variable]
  119 |                 int val = a[it];
      |                     ^~~
cookies.cpp:145:31: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  145 |             for (int i = 0; i < boxes.size(); ++i) {
      |                             ~~^~~~~~~~~~~~~~
cookies.cpp:98:17: warning: unused variable 'sum' [-Wunused-variable]
   98 |             int sum = sumA;
      |                 ^~~
# Verdict Execution time Memory Grader output
1 Correct 25 ms 27996 KB Output is correct
2 Correct 18 ms 27996 KB Output is correct
3 Correct 18 ms 27996 KB Output is correct
4 Correct 14 ms 28048 KB Output is correct
5 Correct 22 ms 28028 KB Output is correct
6 Correct 17 ms 27996 KB Output is correct
7 Correct 22 ms 27996 KB Output is correct
8 Correct 28 ms 27996 KB Output is correct
9 Correct 14 ms 27996 KB Output is correct
10 Correct 65 ms 27996 KB Output is correct
11 Correct 16 ms 27996 KB Output is correct
12 Correct 39 ms 28100 KB Output is correct
13 Correct 17 ms 27896 KB Output is correct
14 Correct 20 ms 27884 KB Output is correct
15 Correct 18 ms 28128 KB Output is correct
16 Correct 18 ms 28104 KB Output is correct
17 Correct 14 ms 27980 KB Output is correct
18 Correct 20 ms 28084 KB Output is correct
19 Correct 13 ms 27980 KB Output is correct
20 Correct 12 ms 27996 KB Output is correct
21 Correct 19 ms 28028 KB Output is correct
22 Correct 36 ms 28076 KB Output is correct
23 Correct 30 ms 27960 KB Output is correct
24 Correct 23 ms 28080 KB Output is correct
25 Correct 24 ms 27996 KB Output is correct
26 Correct 14 ms 28112 KB Output is correct
27 Correct 13 ms 27996 KB Output is correct
28 Correct 15 ms 27996 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 13 ms 28008 KB Output is correct
2 Correct 20 ms 27904 KB Output is correct
3 Correct 19 ms 27964 KB Output is correct
4 Correct 16 ms 28004 KB Output is correct
5 Correct 22 ms 28112 KB Output is correct
6 Correct 11 ms 27996 KB Output is correct
7 Correct 20 ms 27980 KB Output is correct
8 Correct 20 ms 28104 KB Output is correct
9 Correct 20 ms 28320 KB Output is correct
10 Correct 24 ms 29192 KB Output is correct
11 Correct 18 ms 27996 KB Output is correct
12 Correct 15 ms 27992 KB Output is correct
13 Correct 16 ms 27956 KB Output is correct
14 Correct 14 ms 28060 KB Output is correct
15 Correct 14 ms 28000 KB Output is correct
16 Correct 11 ms 27992 KB Output is correct
17 Correct 12 ms 27884 KB Output is correct
18 Correct 14 ms 28508 KB Output is correct
19 Correct 16 ms 28684 KB Output is correct
20 Correct 14 ms 28252 KB Output is correct
21 Correct 14 ms 28252 KB Output is correct
22 Correct 12 ms 28252 KB Output is correct
23 Correct 16 ms 27992 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 25 ms 28072 KB Output is correct
2 Correct 12 ms 27996 KB Output is correct
3 Correct 19 ms 27848 KB Output is correct
4 Correct 18 ms 27992 KB Output is correct
5 Correct 15 ms 27996 KB Output is correct
6 Correct 23 ms 27996 KB Output is correct
7 Correct 17 ms 27996 KB Output is correct
8 Correct 23 ms 27996 KB Output is correct
9 Correct 21 ms 28000 KB Output is correct
10 Correct 19 ms 27996 KB Output is correct
11 Correct 14 ms 27996 KB Output is correct
12 Correct 15 ms 28004 KB Output is correct
13 Correct 13 ms 27996 KB Output is correct
14 Correct 14 ms 27996 KB Output is correct
15 Correct 22 ms 27996 KB Output is correct
16 Correct 21 ms 27996 KB Output is correct
17 Correct 25 ms 27992 KB Output is correct
18 Correct 15 ms 27996 KB Output is correct
19 Correct 23 ms 27896 KB Output is correct
20 Correct 19 ms 27940 KB Output is correct
21 Correct 18 ms 27996 KB Output is correct
22 Correct 16 ms 28076 KB Output is correct
23 Correct 18 ms 27992 KB Output is correct
24 Correct 24 ms 27948 KB Output is correct
25 Correct 18 ms 27996 KB Output is correct
26 Correct 19 ms 27996 KB Output is correct
27 Correct 28 ms 27880 KB Output is correct
28 Correct 21 ms 27992 KB Output is correct
29 Correct 21 ms 27996 KB Output is correct
30 Correct 22 ms 27996 KB Output is correct
31 Correct 29 ms 27992 KB Output is correct
32 Correct 15 ms 27996 KB Output is correct
33 Correct 21 ms 27928 KB Output is correct
34 Correct 17 ms 27996 KB Output is correct
35 Correct 27 ms 27996 KB Output is correct
36 Correct 37 ms 27992 KB Output is correct
37 Correct 22 ms 27992 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 25 ms 27996 KB Output is correct
2 Correct 18 ms 27996 KB Output is correct
3 Correct 18 ms 27996 KB Output is correct
4 Correct 14 ms 28048 KB Output is correct
5 Correct 22 ms 28028 KB Output is correct
6 Correct 17 ms 27996 KB Output is correct
7 Correct 22 ms 27996 KB Output is correct
8 Correct 28 ms 27996 KB Output is correct
9 Correct 14 ms 27996 KB Output is correct
10 Correct 65 ms 27996 KB Output is correct
11 Correct 16 ms 27996 KB Output is correct
12 Correct 39 ms 28100 KB Output is correct
13 Correct 17 ms 27896 KB Output is correct
14 Correct 20 ms 27884 KB Output is correct
15 Correct 18 ms 28128 KB Output is correct
16 Correct 18 ms 28104 KB Output is correct
17 Correct 14 ms 27980 KB Output is correct
18 Correct 20 ms 28084 KB Output is correct
19 Correct 13 ms 27980 KB Output is correct
20 Correct 12 ms 27996 KB Output is correct
21 Correct 19 ms 28028 KB Output is correct
22 Correct 36 ms 28076 KB Output is correct
23 Correct 30 ms 27960 KB Output is correct
24 Correct 23 ms 28080 KB Output is correct
25 Correct 24 ms 27996 KB Output is correct
26 Correct 14 ms 28112 KB Output is correct
27 Correct 13 ms 27996 KB Output is correct
28 Correct 15 ms 27996 KB Output is correct
29 Correct 25 ms 28072 KB Output is correct
30 Correct 12 ms 27996 KB Output is correct
31 Correct 19 ms 27848 KB Output is correct
32 Correct 18 ms 27992 KB Output is correct
33 Correct 15 ms 27996 KB Output is correct
34 Correct 23 ms 27996 KB Output is correct
35 Correct 17 ms 27996 KB Output is correct
36 Correct 23 ms 27996 KB Output is correct
37 Correct 21 ms 28000 KB Output is correct
38 Correct 19 ms 27996 KB Output is correct
39 Correct 14 ms 27996 KB Output is correct
40 Correct 15 ms 28004 KB Output is correct
41 Correct 13 ms 27996 KB Output is correct
42 Correct 14 ms 27996 KB Output is correct
43 Correct 22 ms 27996 KB Output is correct
44 Correct 21 ms 27996 KB Output is correct
45 Correct 25 ms 27992 KB Output is correct
46 Correct 15 ms 27996 KB Output is correct
47 Correct 23 ms 27896 KB Output is correct
48 Correct 19 ms 27940 KB Output is correct
49 Correct 18 ms 27996 KB Output is correct
50 Correct 16 ms 28076 KB Output is correct
51 Correct 18 ms 27992 KB Output is correct
52 Correct 24 ms 27948 KB Output is correct
53 Correct 18 ms 27996 KB Output is correct
54 Correct 19 ms 27996 KB Output is correct
55 Correct 28 ms 27880 KB Output is correct
56 Correct 21 ms 27992 KB Output is correct
57 Correct 21 ms 27996 KB Output is correct
58 Correct 22 ms 27996 KB Output is correct
59 Correct 29 ms 27992 KB Output is correct
60 Correct 15 ms 27996 KB Output is correct
61 Correct 21 ms 27928 KB Output is correct
62 Correct 17 ms 27996 KB Output is correct
63 Correct 27 ms 27996 KB Output is correct
64 Correct 37 ms 27992 KB Output is correct
65 Correct 22 ms 27992 KB Output is correct
66 Correct 16 ms 27992 KB Output is correct
67 Correct 19 ms 27996 KB Output is correct
68 Correct 11 ms 28104 KB Output is correct
69 Correct 11 ms 27996 KB Output is correct
70 Correct 13 ms 28048 KB Output is correct
71 Correct 24 ms 27996 KB Output is correct
72 Correct 19 ms 28088 KB Output is correct
73 Correct 12 ms 27996 KB Output is correct
74 Correct 12 ms 27996 KB Output is correct
75 Correct 23 ms 27996 KB Output is correct
76 Correct 22 ms 27996 KB Output is correct
77 Correct 24 ms 27996 KB Output is correct
78 Correct 21 ms 27996 KB Output is correct
79 Correct 27 ms 27936 KB Output is correct
80 Correct 24 ms 27928 KB Output is correct
81 Correct 13 ms 27992 KB Output is correct
82 Correct 26 ms 27860 KB Output is correct
83 Correct 11 ms 27996 KB Output is correct
84 Correct 29 ms 27928 KB Output is correct
85 Correct 23 ms 27992 KB Output is correct
86 Correct 34 ms 27996 KB Output is correct
87 Correct 34 ms 28100 KB Output is correct
88 Correct 33 ms 27992 KB Output is correct
89 Correct 36 ms 27996 KB Output is correct
90 Correct 32 ms 27996 KB Output is correct
91 Correct 33 ms 27996 KB Output is correct
92 Correct 43 ms 27996 KB Output is correct
93 Correct 42 ms 27996 KB Output is correct
94 Correct 42 ms 27996 KB Output is correct
95 Correct 33 ms 28100 KB Output is correct
96 Correct 26 ms 27992 KB Output is correct
97 Correct 26 ms 27996 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 25 ms 27996 KB Output is correct
2 Correct 18 ms 27996 KB Output is correct
3 Correct 18 ms 27996 KB Output is correct
4 Correct 14 ms 28048 KB Output is correct
5 Correct 22 ms 28028 KB Output is correct
6 Correct 17 ms 27996 KB Output is correct
7 Correct 22 ms 27996 KB Output is correct
8 Correct 28 ms 27996 KB Output is correct
9 Correct 14 ms 27996 KB Output is correct
10 Correct 65 ms 27996 KB Output is correct
11 Correct 16 ms 27996 KB Output is correct
12 Correct 39 ms 28100 KB Output is correct
13 Correct 17 ms 27896 KB Output is correct
14 Correct 20 ms 27884 KB Output is correct
15 Correct 18 ms 28128 KB Output is correct
16 Correct 18 ms 28104 KB Output is correct
17 Correct 14 ms 27980 KB Output is correct
18 Correct 20 ms 28084 KB Output is correct
19 Correct 13 ms 27980 KB Output is correct
20 Correct 12 ms 27996 KB Output is correct
21 Correct 19 ms 28028 KB Output is correct
22 Correct 36 ms 28076 KB Output is correct
23 Correct 30 ms 27960 KB Output is correct
24 Correct 23 ms 28080 KB Output is correct
25 Correct 24 ms 27996 KB Output is correct
26 Correct 14 ms 28112 KB Output is correct
27 Correct 13 ms 27996 KB Output is correct
28 Correct 15 ms 27996 KB Output is correct
29 Correct 25 ms 28072 KB Output is correct
30 Correct 12 ms 27996 KB Output is correct
31 Correct 19 ms 27848 KB Output is correct
32 Correct 18 ms 27992 KB Output is correct
33 Correct 15 ms 27996 KB Output is correct
34 Correct 23 ms 27996 KB Output is correct
35 Correct 17 ms 27996 KB Output is correct
36 Correct 23 ms 27996 KB Output is correct
37 Correct 21 ms 28000 KB Output is correct
38 Correct 19 ms 27996 KB Output is correct
39 Correct 14 ms 27996 KB Output is correct
40 Correct 15 ms 28004 KB Output is correct
41 Correct 13 ms 27996 KB Output is correct
42 Correct 14 ms 27996 KB Output is correct
43 Correct 22 ms 27996 KB Output is correct
44 Correct 21 ms 27996 KB Output is correct
45 Correct 25 ms 27992 KB Output is correct
46 Correct 15 ms 27996 KB Output is correct
47 Correct 23 ms 27896 KB Output is correct
48 Correct 19 ms 27940 KB Output is correct
49 Correct 18 ms 27996 KB Output is correct
50 Correct 16 ms 28076 KB Output is correct
51 Correct 18 ms 27992 KB Output is correct
52 Correct 24 ms 27948 KB Output is correct
53 Correct 18 ms 27996 KB Output is correct
54 Correct 19 ms 27996 KB Output is correct
55 Correct 28 ms 27880 KB Output is correct
56 Correct 21 ms 27992 KB Output is correct
57 Correct 21 ms 27996 KB Output is correct
58 Correct 22 ms 27996 KB Output is correct
59 Correct 29 ms 27992 KB Output is correct
60 Correct 15 ms 27996 KB Output is correct
61 Correct 21 ms 27928 KB Output is correct
62 Correct 17 ms 27996 KB Output is correct
63 Correct 27 ms 27996 KB Output is correct
64 Correct 37 ms 27992 KB Output is correct
65 Correct 22 ms 27992 KB Output is correct
66 Correct 16 ms 27992 KB Output is correct
67 Correct 19 ms 27996 KB Output is correct
68 Correct 11 ms 28104 KB Output is correct
69 Correct 11 ms 27996 KB Output is correct
70 Correct 13 ms 28048 KB Output is correct
71 Correct 24 ms 27996 KB Output is correct
72 Correct 19 ms 28088 KB Output is correct
73 Correct 12 ms 27996 KB Output is correct
74 Correct 12 ms 27996 KB Output is correct
75 Correct 23 ms 27996 KB Output is correct
76 Correct 22 ms 27996 KB Output is correct
77 Correct 24 ms 27996 KB Output is correct
78 Correct 21 ms 27996 KB Output is correct
79 Correct 27 ms 27936 KB Output is correct
80 Correct 24 ms 27928 KB Output is correct
81 Correct 13 ms 27992 KB Output is correct
82 Correct 26 ms 27860 KB Output is correct
83 Correct 11 ms 27996 KB Output is correct
84 Correct 29 ms 27928 KB Output is correct
85 Correct 23 ms 27992 KB Output is correct
86 Correct 34 ms 27996 KB Output is correct
87 Correct 34 ms 28100 KB Output is correct
88 Correct 33 ms 27992 KB Output is correct
89 Correct 36 ms 27996 KB Output is correct
90 Correct 32 ms 27996 KB Output is correct
91 Correct 33 ms 27996 KB Output is correct
92 Correct 43 ms 27996 KB Output is correct
93 Correct 42 ms 27996 KB Output is correct
94 Correct 42 ms 27996 KB Output is correct
95 Correct 33 ms 28100 KB Output is correct
96 Correct 26 ms 27992 KB Output is correct
97 Correct 26 ms 27996 KB Output is correct
98 Correct 19 ms 28244 KB Output is correct
99 Correct 10 ms 27996 KB Output is correct
100 Correct 23 ms 27996 KB Output is correct
101 Correct 14 ms 28056 KB Output is correct
102 Correct 15 ms 27996 KB Output is correct
103 Correct 35 ms 28112 KB Output is correct
104 Correct 33 ms 27996 KB Output is correct
105 Correct 56 ms 28100 KB Output is correct
106 Correct 58 ms 28240 KB Output is correct
107 Correct 48 ms 28244 KB Output is correct
108 Correct 42 ms 27996 KB Output is correct
109 Correct 27 ms 27992 KB Output is correct
110 Correct 36 ms 28240 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 25 ms 27996 KB Output is correct
2 Correct 18 ms 27996 KB Output is correct
3 Correct 18 ms 27996 KB Output is correct
4 Correct 14 ms 28048 KB Output is correct
5 Correct 22 ms 28028 KB Output is correct
6 Correct 17 ms 27996 KB Output is correct
7 Correct 22 ms 27996 KB Output is correct
8 Correct 28 ms 27996 KB Output is correct
9 Correct 14 ms 27996 KB Output is correct
10 Correct 65 ms 27996 KB Output is correct
11 Correct 16 ms 27996 KB Output is correct
12 Correct 39 ms 28100 KB Output is correct
13 Correct 17 ms 27896 KB Output is correct
14 Correct 20 ms 27884 KB Output is correct
15 Correct 18 ms 28128 KB Output is correct
16 Correct 18 ms 28104 KB Output is correct
17 Correct 14 ms 27980 KB Output is correct
18 Correct 20 ms 28084 KB Output is correct
19 Correct 13 ms 27980 KB Output is correct
20 Correct 12 ms 27996 KB Output is correct
21 Correct 19 ms 28028 KB Output is correct
22 Correct 36 ms 28076 KB Output is correct
23 Correct 30 ms 27960 KB Output is correct
24 Correct 23 ms 28080 KB Output is correct
25 Correct 24 ms 27996 KB Output is correct
26 Correct 14 ms 28112 KB Output is correct
27 Correct 13 ms 27996 KB Output is correct
28 Correct 15 ms 27996 KB Output is correct
29 Correct 13 ms 28008 KB Output is correct
30 Correct 20 ms 27904 KB Output is correct
31 Correct 19 ms 27964 KB Output is correct
32 Correct 16 ms 28004 KB Output is correct
33 Correct 22 ms 28112 KB Output is correct
34 Correct 11 ms 27996 KB Output is correct
35 Correct 20 ms 27980 KB Output is correct
36 Correct 20 ms 28104 KB Output is correct
37 Correct 20 ms 28320 KB Output is correct
38 Correct 24 ms 29192 KB Output is correct
39 Correct 18 ms 27996 KB Output is correct
40 Correct 15 ms 27992 KB Output is correct
41 Correct 16 ms 27956 KB Output is correct
42 Correct 14 ms 28060 KB Output is correct
43 Correct 14 ms 28000 KB Output is correct
44 Correct 11 ms 27992 KB Output is correct
45 Correct 12 ms 27884 KB Output is correct
46 Correct 14 ms 28508 KB Output is correct
47 Correct 16 ms 28684 KB Output is correct
48 Correct 14 ms 28252 KB Output is correct
49 Correct 14 ms 28252 KB Output is correct
50 Correct 12 ms 28252 KB Output is correct
51 Correct 16 ms 27992 KB Output is correct
52 Correct 25 ms 28072 KB Output is correct
53 Correct 12 ms 27996 KB Output is correct
54 Correct 19 ms 27848 KB Output is correct
55 Correct 18 ms 27992 KB Output is correct
56 Correct 15 ms 27996 KB Output is correct
57 Correct 23 ms 27996 KB Output is correct
58 Correct 17 ms 27996 KB Output is correct
59 Correct 23 ms 27996 KB Output is correct
60 Correct 21 ms 28000 KB Output is correct
61 Correct 19 ms 27996 KB Output is correct
62 Correct 14 ms 27996 KB Output is correct
63 Correct 15 ms 28004 KB Output is correct
64 Correct 13 ms 27996 KB Output is correct
65 Correct 14 ms 27996 KB Output is correct
66 Correct 22 ms 27996 KB Output is correct
67 Correct 21 ms 27996 KB Output is correct
68 Correct 25 ms 27992 KB Output is correct
69 Correct 15 ms 27996 KB Output is correct
70 Correct 23 ms 27896 KB Output is correct
71 Correct 19 ms 27940 KB Output is correct
72 Correct 18 ms 27996 KB Output is correct
73 Correct 16 ms 28076 KB Output is correct
74 Correct 18 ms 27992 KB Output is correct
75 Correct 24 ms 27948 KB Output is correct
76 Correct 18 ms 27996 KB Output is correct
77 Correct 19 ms 27996 KB Output is correct
78 Correct 28 ms 27880 KB Output is correct
79 Correct 21 ms 27992 KB Output is correct
80 Correct 21 ms 27996 KB Output is correct
81 Correct 22 ms 27996 KB Output is correct
82 Correct 29 ms 27992 KB Output is correct
83 Correct 15 ms 27996 KB Output is correct
84 Correct 21 ms 27928 KB Output is correct
85 Correct 17 ms 27996 KB Output is correct
86 Correct 27 ms 27996 KB Output is correct
87 Correct 37 ms 27992 KB Output is correct
88 Correct 22 ms 27992 KB Output is correct
89 Correct 16 ms 27992 KB Output is correct
90 Correct 19 ms 27996 KB Output is correct
91 Correct 11 ms 28104 KB Output is correct
92 Correct 11 ms 27996 KB Output is correct
93 Correct 13 ms 28048 KB Output is correct
94 Correct 24 ms 27996 KB Output is correct
95 Correct 19 ms 28088 KB Output is correct
96 Correct 12 ms 27996 KB Output is correct
97 Correct 12 ms 27996 KB Output is correct
98 Correct 23 ms 27996 KB Output is correct
99 Correct 22 ms 27996 KB Output is correct
100 Correct 24 ms 27996 KB Output is correct
101 Correct 21 ms 27996 KB Output is correct
102 Correct 27 ms 27936 KB Output is correct
103 Correct 24 ms 27928 KB Output is correct
104 Correct 13 ms 27992 KB Output is correct
105 Correct 26 ms 27860 KB Output is correct
106 Correct 11 ms 27996 KB Output is correct
107 Correct 29 ms 27928 KB Output is correct
108 Correct 23 ms 27992 KB Output is correct
109 Correct 34 ms 27996 KB Output is correct
110 Correct 34 ms 28100 KB Output is correct
111 Correct 33 ms 27992 KB Output is correct
112 Correct 36 ms 27996 KB Output is correct
113 Correct 32 ms 27996 KB Output is correct
114 Correct 33 ms 27996 KB Output is correct
115 Correct 43 ms 27996 KB Output is correct
116 Correct 42 ms 27996 KB Output is correct
117 Correct 42 ms 27996 KB Output is correct
118 Correct 33 ms 28100 KB Output is correct
119 Correct 26 ms 27992 KB Output is correct
120 Correct 26 ms 27996 KB Output is correct
121 Correct 19 ms 28244 KB Output is correct
122 Correct 10 ms 27996 KB Output is correct
123 Correct 23 ms 27996 KB Output is correct
124 Correct 14 ms 28056 KB Output is correct
125 Correct 15 ms 27996 KB Output is correct
126 Correct 35 ms 28112 KB Output is correct
127 Correct 33 ms 27996 KB Output is correct
128 Correct 56 ms 28100 KB Output is correct
129 Correct 58 ms 28240 KB Output is correct
130 Correct 48 ms 28244 KB Output is correct
131 Correct 42 ms 27996 KB Output is correct
132 Correct 27 ms 27992 KB Output is correct
133 Correct 36 ms 28240 KB Output is correct
134 Correct 26 ms 28244 KB Output is correct
135 Correct 14 ms 28252 KB Output is correct
136 Correct 15 ms 28508 KB Output is correct
137 Correct 39 ms 28244 KB Output is correct
138 Correct 40 ms 28500 KB Output is correct
139 Correct 82 ms 28460 KB Output is correct
140 Correct 82 ms 28756 KB Output is correct
141 Correct 69 ms 29056 KB Output is correct
142 Correct 53 ms 28376 KB Output is correct
143 Correct 36 ms 28556 KB Output is correct
144 Correct 35 ms 28756 KB Output is correct