Submission #657535

# Submission time Handle Problem Language Result Execution time Memory
657535 2022-11-10T06:38:59 Z dooompy Diversity (CEOI21_diversity) C++17
100 / 100
1785 ms 22320 KB
#include "bits/stdc++.h"

using namespace std;

void abc() {cout << endl;}
template <typename T, typename ...U> void abc(T a, U ...b) {
    cout << a << ' ', abc(b...);
}
template <typename T> void printv(T l, T r) {
    while (l != r) cout << *l << " \n"[++l == r];
}
template <typename A, typename B> istream& operator >> (istream& o, pair<A, B> &a) {
    return o >> a.first >> a.second;
}
template <typename A, typename B> ostream& operator << (ostream& o, pair<A, B> a) {
    return o << '(' << a.first << ", " << a.second << ')';
}
template <typename T> ostream& operator << (ostream& o, vector<T> a) {
    bool is = false;
    for (T i : a) {o << (is ? ' ' : '{'), is = true, o << i;}
    return o << '}';
}

#ifdef local
#define test(args...) abc("[" + string(#args) + "]", args)
#else
#define test(args...) void(0)
#endif

using ll = long long;

const int block = 550;

#define int ll

ll a[300005];
map<int, ll> ct;

struct query {
    int l, r, i;

    bool operator<(query o ) const {
        if (l / block == o.l / block) {
            return (l / block & 1) ? r > o.r : r < o.r;
        }
        return l / block < o.l / block;
    }
};

int freq[300005];
int cnt[300005];
bool in[300005];

vector<int> arr;

void change(int val, int amt) {
    cnt[freq[val]]--;

    freq[val] += amt;

    if (cnt[freq[val]] == 0 && !in[freq[val]]) {
        cnt[freq[val]]++;
        in[freq[val]] = true;
        arr.push_back(freq[val]);
    } else {
        cnt[freq[val]]++;
    }
}

ll printout[200005];

int32_t main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
//    freopen("", "r", stdin);
//    freopen("", "w", stdout);
    int n, q; cin >> n >> q;

    for (int i = 1; i <= n; i++) {
        cin >> a[i];
        ct[a[i]]++;
    }

    vector<query> queries;

    for (int i = 0; i < q; i++) {
        int l, r; cin >> l >> r;
        queries.push_back({l, r, i});
    }

    sort(queries.begin(), queries.end());
    int l = 1, r = 0;

    for (auto [ql, qr, i] : queries) {
        while (l > ql) change(a[--l], 1);
        while (r < qr) change(a[++r], 1);
        while (l < ql) change(a[l++], -1);
        while (r > qr) change(a[r--], -1);

        vector<int> upd;
        for (auto cur : arr) {
            if (cnt[cur] == 0) {
                in[cur] = false;
            } else upd.push_back(cur);
        }

        arr = upd;

        sort(arr.begin(), arr.end());

        vector<pair<ll, ll>> front, back;
        int ctf = 0, ctb = 0;
        for (auto cur : arr) {
            int sz = cnt[cur];

            int more = (sz  + 1) / 2, less = sz - more;

            if (ctf > ctb) {
                back.push_back({cur, more});
                if (less != 0) front.push_back({cur, less});

                ctb += more * cur;
                ctf += less * cur;
            } else {
                if (less != 0) back.push_back({cur, less});
                front.push_back({cur, more});

                ctb += less * cur;
                ctf += more * cur;
            }
        }
        
        reverse(back.begin(), back.end());

        for (auto t : back) front.push_back(t);

        ll pref = 0, n = r - l + 1, ans = 0;
        for (auto [s, k] : front) {
            ans += (k * (pref * s + pref * s * k) / 2);
            ll suff = n - pref - s * k;
            ans += (k * (suff * s + suff * s * k) / 2);

            ans += (pref * suff * k);

            ans += s * (s - 1) / 2 * k;

            ans += k * ((k - 1) * (s * s * 2 + (k) * s * s)) / 2;

            ans -= (s * s * 2 * (k - 1) * (k) * (k + 1)) / 6;

            pref += s * k;
        }

        printout[i] = ans + n;
    }

    for (int i = 0; i < q; i++) {
        cout << printout[i] << "\n";
    }

}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 0 ms 340 KB Output is correct
3 Correct 0 ms 340 KB Output is correct
4 Correct 0 ms 340 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 0 ms 340 KB Output is correct
9 Correct 0 ms 340 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 2 ms 596 KB Output is correct
4 Correct 8 ms 1900 KB Output is correct
5 Correct 15 ms 3960 KB Output is correct
6 Correct 23 ms 4396 KB Output is correct
7 Correct 23 ms 6620 KB Output is correct
8 Correct 22 ms 4220 KB Output is correct
9 Correct 22 ms 4308 KB Output is correct
10 Correct 22 ms 5048 KB Output is correct
11 Correct 23 ms 5036 KB Output is correct
12 Correct 22 ms 4276 KB Output is correct
13 Correct 21 ms 4176 KB Output is correct
14 Correct 24 ms 5004 KB Output is correct
15 Correct 23 ms 5060 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 2 ms 596 KB Output is correct
4 Correct 8 ms 1900 KB Output is correct
5 Correct 15 ms 3960 KB Output is correct
6 Correct 23 ms 4396 KB Output is correct
7 Correct 23 ms 6620 KB Output is correct
8 Correct 22 ms 4220 KB Output is correct
9 Correct 22 ms 4308 KB Output is correct
10 Correct 22 ms 5048 KB Output is correct
11 Correct 23 ms 5036 KB Output is correct
12 Correct 22 ms 4276 KB Output is correct
13 Correct 21 ms 4176 KB Output is correct
14 Correct 24 ms 5004 KB Output is correct
15 Correct 23 ms 5060 KB Output is correct
16 Correct 0 ms 344 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 1 ms 468 KB Output is correct
19 Correct 9 ms 1896 KB Output is correct
20 Correct 18 ms 3032 KB Output is correct
21 Correct 24 ms 4556 KB Output is correct
22 Correct 24 ms 4428 KB Output is correct
23 Correct 24 ms 4396 KB Output is correct
24 Correct 23 ms 4304 KB Output is correct
25 Correct 25 ms 4312 KB Output is correct
26 Correct 26 ms 4372 KB Output is correct
27 Correct 25 ms 4312 KB Output is correct
28 Correct 27 ms 5076 KB Output is correct
29 Correct 24 ms 4320 KB Output is correct
30 Correct 24 ms 4432 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 2 ms 596 KB Output is correct
4 Correct 8 ms 1900 KB Output is correct
5 Correct 15 ms 3960 KB Output is correct
6 Correct 23 ms 4396 KB Output is correct
7 Correct 23 ms 6620 KB Output is correct
8 Correct 22 ms 4220 KB Output is correct
9 Correct 22 ms 4308 KB Output is correct
10 Correct 22 ms 5048 KB Output is correct
11 Correct 23 ms 5036 KB Output is correct
12 Correct 22 ms 4276 KB Output is correct
13 Correct 21 ms 4176 KB Output is correct
14 Correct 24 ms 5004 KB Output is correct
15 Correct 23 ms 5060 KB Output is correct
16 Correct 0 ms 344 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 1 ms 468 KB Output is correct
19 Correct 9 ms 1896 KB Output is correct
20 Correct 18 ms 3032 KB Output is correct
21 Correct 24 ms 4556 KB Output is correct
22 Correct 24 ms 4428 KB Output is correct
23 Correct 24 ms 4396 KB Output is correct
24 Correct 23 ms 4304 KB Output is correct
25 Correct 25 ms 4312 KB Output is correct
26 Correct 26 ms 4372 KB Output is correct
27 Correct 25 ms 4312 KB Output is correct
28 Correct 27 ms 5076 KB Output is correct
29 Correct 24 ms 4320 KB Output is correct
30 Correct 24 ms 4432 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 340 KB Output is correct
34 Correct 1 ms 488 KB Output is correct
35 Correct 1 ms 488 KB Output is correct
36 Correct 2 ms 484 KB Output is correct
37 Correct 7 ms 1012 KB Output is correct
38 Correct 8 ms 1036 KB Output is correct
39 Correct 15 ms 1520 KB Output is correct
40 Correct 30 ms 2816 KB Output is correct
41 Correct 38 ms 3976 KB Output is correct
42 Correct 37 ms 3932 KB Output is correct
43 Correct 37 ms 3980 KB Output is correct
44 Correct 38 ms 3920 KB Output is correct
45 Correct 38 ms 3916 KB Output is correct
46 Correct 38 ms 3908 KB Output is correct
47 Correct 37 ms 3916 KB Output is correct
48 Correct 38 ms 3972 KB Output is correct
49 Correct 38 ms 3876 KB Output is correct
50 Correct 38 ms 4016 KB Output is correct
51 Correct 38 ms 3916 KB Output is correct
52 Correct 41 ms 3892 KB Output is correct
53 Correct 38 ms 3936 KB Output is correct
54 Correct 38 ms 3920 KB Output is correct
55 Correct 37 ms 3916 KB Output is correct
56 Correct 37 ms 3948 KB Output is correct
57 Correct 41 ms 3892 KB Output is correct
58 Correct 39 ms 3964 KB Output is correct
59 Correct 39 ms 4068 KB Output is correct
60 Correct 39 ms 3964 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 0 ms 340 KB Output is correct
3 Correct 0 ms 340 KB Output is correct
4 Correct 0 ms 340 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 0 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 340 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 2 ms 596 KB Output is correct
14 Correct 8 ms 1900 KB Output is correct
15 Correct 15 ms 3960 KB Output is correct
16 Correct 23 ms 4396 KB Output is correct
17 Correct 23 ms 6620 KB Output is correct
18 Correct 22 ms 4220 KB Output is correct
19 Correct 22 ms 4308 KB Output is correct
20 Correct 22 ms 5048 KB Output is correct
21 Correct 23 ms 5036 KB Output is correct
22 Correct 22 ms 4276 KB Output is correct
23 Correct 21 ms 4176 KB Output is correct
24 Correct 24 ms 5004 KB Output is correct
25 Correct 23 ms 5060 KB Output is correct
26 Correct 0 ms 344 KB Output is correct
27 Correct 1 ms 340 KB Output is correct
28 Correct 1 ms 468 KB Output is correct
29 Correct 9 ms 1896 KB Output is correct
30 Correct 18 ms 3032 KB Output is correct
31 Correct 24 ms 4556 KB Output is correct
32 Correct 24 ms 4428 KB Output is correct
33 Correct 24 ms 4396 KB Output is correct
34 Correct 23 ms 4304 KB Output is correct
35 Correct 25 ms 4312 KB Output is correct
36 Correct 26 ms 4372 KB Output is correct
37 Correct 25 ms 4312 KB Output is correct
38 Correct 27 ms 5076 KB Output is correct
39 Correct 24 ms 4320 KB Output is correct
40 Correct 24 ms 4432 KB Output is correct
41 Correct 1 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 488 KB Output is correct
45 Correct 1 ms 488 KB Output is correct
46 Correct 2 ms 484 KB Output is correct
47 Correct 7 ms 1012 KB Output is correct
48 Correct 8 ms 1036 KB Output is correct
49 Correct 15 ms 1520 KB Output is correct
50 Correct 30 ms 2816 KB Output is correct
51 Correct 38 ms 3976 KB Output is correct
52 Correct 37 ms 3932 KB Output is correct
53 Correct 37 ms 3980 KB Output is correct
54 Correct 38 ms 3920 KB Output is correct
55 Correct 38 ms 3916 KB Output is correct
56 Correct 38 ms 3908 KB Output is correct
57 Correct 37 ms 3916 KB Output is correct
58 Correct 38 ms 3972 KB Output is correct
59 Correct 38 ms 3876 KB Output is correct
60 Correct 38 ms 4016 KB Output is correct
61 Correct 38 ms 3916 KB Output is correct
62 Correct 41 ms 3892 KB Output is correct
63 Correct 38 ms 3936 KB Output is correct
64 Correct 38 ms 3920 KB Output is correct
65 Correct 37 ms 3916 KB Output is correct
66 Correct 37 ms 3948 KB Output is correct
67 Correct 41 ms 3892 KB Output is correct
68 Correct 39 ms 3964 KB Output is correct
69 Correct 39 ms 4068 KB Output is correct
70 Correct 39 ms 3964 KB Output is correct
71 Correct 8 ms 1108 KB Output is correct
72 Correct 8 ms 1108 KB Output is correct
73 Correct 7 ms 1108 KB Output is correct
74 Correct 8 ms 1108 KB Output is correct
75 Correct 8 ms 1048 KB Output is correct
76 Correct 17 ms 1868 KB Output is correct
77 Correct 17 ms 1916 KB Output is correct
78 Correct 17 ms 1964 KB Output is correct
79 Correct 20 ms 1868 KB Output is correct
80 Correct 17 ms 1884 KB Output is correct
81 Correct 37 ms 3516 KB Output is correct
82 Correct 37 ms 3532 KB Output is correct
83 Correct 40 ms 3532 KB Output is correct
84 Correct 40 ms 3536 KB Output is correct
85 Correct 37 ms 3528 KB Output is correct
86 Correct 45 ms 4300 KB Output is correct
87 Correct 52 ms 4376 KB Output is correct
88 Correct 53 ms 4300 KB Output is correct
89 Correct 47 ms 4372 KB Output is correct
90 Correct 49 ms 4296 KB Output is correct
91 Correct 111 ms 11456 KB Output is correct
92 Correct 102 ms 11504 KB Output is correct
93 Correct 104 ms 11456 KB Output is correct
94 Correct 105 ms 11392 KB Output is correct
95 Correct 115 ms 11364 KB Output is correct
96 Correct 161 ms 18656 KB Output is correct
97 Correct 171 ms 18548 KB Output is correct
98 Correct 160 ms 18592 KB Output is correct
99 Correct 159 ms 18588 KB Output is correct
100 Correct 158 ms 18652 KB Output is correct
101 Correct 157 ms 18636 KB Output is correct
102 Correct 159 ms 18592 KB Output is correct
103 Correct 174 ms 18644 KB Output is correct
104 Correct 157 ms 18784 KB Output is correct
105 Correct 155 ms 18648 KB Output is correct
106 Correct 193 ms 22260 KB Output is correct
107 Correct 175 ms 22152 KB Output is correct
108 Correct 180 ms 22220 KB Output is correct
109 Correct 187 ms 22180 KB Output is correct
110 Correct 174 ms 22184 KB Output is correct
111 Correct 192 ms 22320 KB Output is correct
112 Correct 175 ms 22124 KB Output is correct
113 Correct 176 ms 22116 KB Output is correct
114 Correct 178 ms 22220 KB Output is correct
115 Correct 180 ms 22160 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 0 ms 340 KB Output is correct
3 Correct 0 ms 340 KB Output is correct
4 Correct 0 ms 340 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 0 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 340 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 2 ms 596 KB Output is correct
14 Correct 8 ms 1900 KB Output is correct
15 Correct 15 ms 3960 KB Output is correct
16 Correct 23 ms 4396 KB Output is correct
17 Correct 23 ms 6620 KB Output is correct
18 Correct 22 ms 4220 KB Output is correct
19 Correct 22 ms 4308 KB Output is correct
20 Correct 22 ms 5048 KB Output is correct
21 Correct 23 ms 5036 KB Output is correct
22 Correct 22 ms 4276 KB Output is correct
23 Correct 21 ms 4176 KB Output is correct
24 Correct 24 ms 5004 KB Output is correct
25 Correct 23 ms 5060 KB Output is correct
26 Correct 0 ms 344 KB Output is correct
27 Correct 1 ms 340 KB Output is correct
28 Correct 1 ms 468 KB Output is correct
29 Correct 9 ms 1896 KB Output is correct
30 Correct 18 ms 3032 KB Output is correct
31 Correct 24 ms 4556 KB Output is correct
32 Correct 24 ms 4428 KB Output is correct
33 Correct 24 ms 4396 KB Output is correct
34 Correct 23 ms 4304 KB Output is correct
35 Correct 25 ms 4312 KB Output is correct
36 Correct 26 ms 4372 KB Output is correct
37 Correct 25 ms 4312 KB Output is correct
38 Correct 27 ms 5076 KB Output is correct
39 Correct 24 ms 4320 KB Output is correct
40 Correct 24 ms 4432 KB Output is correct
41 Correct 1 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 488 KB Output is correct
45 Correct 1 ms 488 KB Output is correct
46 Correct 2 ms 484 KB Output is correct
47 Correct 7 ms 1012 KB Output is correct
48 Correct 8 ms 1036 KB Output is correct
49 Correct 15 ms 1520 KB Output is correct
50 Correct 30 ms 2816 KB Output is correct
51 Correct 38 ms 3976 KB Output is correct
52 Correct 37 ms 3932 KB Output is correct
53 Correct 37 ms 3980 KB Output is correct
54 Correct 38 ms 3920 KB Output is correct
55 Correct 38 ms 3916 KB Output is correct
56 Correct 38 ms 3908 KB Output is correct
57 Correct 37 ms 3916 KB Output is correct
58 Correct 38 ms 3972 KB Output is correct
59 Correct 38 ms 3876 KB Output is correct
60 Correct 38 ms 4016 KB Output is correct
61 Correct 38 ms 3916 KB Output is correct
62 Correct 41 ms 3892 KB Output is correct
63 Correct 38 ms 3936 KB Output is correct
64 Correct 38 ms 3920 KB Output is correct
65 Correct 37 ms 3916 KB Output is correct
66 Correct 37 ms 3948 KB Output is correct
67 Correct 41 ms 3892 KB Output is correct
68 Correct 39 ms 3964 KB Output is correct
69 Correct 39 ms 4068 KB Output is correct
70 Correct 39 ms 3964 KB Output is correct
71 Correct 8 ms 1108 KB Output is correct
72 Correct 8 ms 1108 KB Output is correct
73 Correct 7 ms 1108 KB Output is correct
74 Correct 8 ms 1108 KB Output is correct
75 Correct 8 ms 1048 KB Output is correct
76 Correct 17 ms 1868 KB Output is correct
77 Correct 17 ms 1916 KB Output is correct
78 Correct 17 ms 1964 KB Output is correct
79 Correct 20 ms 1868 KB Output is correct
80 Correct 17 ms 1884 KB Output is correct
81 Correct 37 ms 3516 KB Output is correct
82 Correct 37 ms 3532 KB Output is correct
83 Correct 40 ms 3532 KB Output is correct
84 Correct 40 ms 3536 KB Output is correct
85 Correct 37 ms 3528 KB Output is correct
86 Correct 45 ms 4300 KB Output is correct
87 Correct 52 ms 4376 KB Output is correct
88 Correct 53 ms 4300 KB Output is correct
89 Correct 47 ms 4372 KB Output is correct
90 Correct 49 ms 4296 KB Output is correct
91 Correct 111 ms 11456 KB Output is correct
92 Correct 102 ms 11504 KB Output is correct
93 Correct 104 ms 11456 KB Output is correct
94 Correct 105 ms 11392 KB Output is correct
95 Correct 115 ms 11364 KB Output is correct
96 Correct 161 ms 18656 KB Output is correct
97 Correct 171 ms 18548 KB Output is correct
98 Correct 160 ms 18592 KB Output is correct
99 Correct 159 ms 18588 KB Output is correct
100 Correct 158 ms 18652 KB Output is correct
101 Correct 157 ms 18636 KB Output is correct
102 Correct 159 ms 18592 KB Output is correct
103 Correct 174 ms 18644 KB Output is correct
104 Correct 157 ms 18784 KB Output is correct
105 Correct 155 ms 18648 KB Output is correct
106 Correct 193 ms 22260 KB Output is correct
107 Correct 175 ms 22152 KB Output is correct
108 Correct 180 ms 22220 KB Output is correct
109 Correct 187 ms 22180 KB Output is correct
110 Correct 174 ms 22184 KB Output is correct
111 Correct 192 ms 22320 KB Output is correct
112 Correct 175 ms 22124 KB Output is correct
113 Correct 176 ms 22116 KB Output is correct
114 Correct 178 ms 22220 KB Output is correct
115 Correct 180 ms 22160 KB Output is correct
116 Correct 232 ms 3028 KB Output is correct
117 Correct 254 ms 3036 KB Output is correct
118 Correct 371 ms 3680 KB Output is correct
119 Correct 377 ms 3800 KB Output is correct
120 Correct 279 ms 3788 KB Output is correct
121 Correct 509 ms 4360 KB Output is correct
122 Correct 367 ms 4504 KB Output is correct
123 Correct 958 ms 5840 KB Output is correct
124 Correct 566 ms 6168 KB Output is correct
125 Correct 505 ms 6548 KB Output is correct
126 Correct 1636 ms 6704 KB Output is correct
127 Correct 1635 ms 6824 KB Output is correct
128 Correct 1650 ms 6720 KB Output is correct
129 Correct 1657 ms 6820 KB Output is correct
130 Correct 1628 ms 6688 KB Output is correct
131 Correct 1785 ms 6852 KB Output is correct
132 Correct 1769 ms 6856 KB Output is correct
133 Correct 1758 ms 6860 KB Output is correct
134 Correct 1752 ms 6844 KB Output is correct
135 Correct 1772 ms 6868 KB Output is correct
136 Correct 1773 ms 6872 KB Output is correct
137 Correct 1748 ms 6968 KB Output is correct
138 Correct 1785 ms 6872 KB Output is correct
139 Correct 1751 ms 6840 KB Output is correct
140 Correct 1759 ms 6960 KB Output is correct
141 Correct 1511 ms 6912 KB Output is correct
142 Correct 1551 ms 7028 KB Output is correct
143 Correct 1541 ms 7012 KB Output is correct
144 Correct 1539 ms 6912 KB Output is correct
145 Correct 1521 ms 6900 KB Output is correct
146 Correct 979 ms 7508 KB Output is correct
147 Correct 950 ms 7436 KB Output is correct
148 Correct 964 ms 7444 KB Output is correct
149 Correct 959 ms 7448 KB Output is correct
150 Correct 973 ms 7496 KB Output is correct
151 Correct 912 ms 7824 KB Output is correct
152 Correct 904 ms 7948 KB Output is correct
153 Correct 922 ms 7820 KB Output is correct
154 Correct 907 ms 7820 KB Output is correct
155 Correct 897 ms 7824 KB Output is correct
156 Correct 1609 ms 11200 KB Output is correct
157 Correct 1577 ms 11256 KB Output is correct
158 Correct 1574 ms 11208 KB Output is correct
159 Correct 1573 ms 11184 KB Output is correct
160 Correct 1565 ms 11208 KB Output is correct
161 Correct 1237 ms 10032 KB Output is correct
162 Correct 1260 ms 9888 KB Output is correct
163 Correct 1231 ms 9888 KB Output is correct
164 Correct 1221 ms 9960 KB Output is correct
165 Correct 1231 ms 9932 KB Output is correct
166 Correct 1657 ms 7524 KB Output is correct
167 Correct 1654 ms 7496 KB Output is correct
168 Correct 1662 ms 7588 KB Output is correct
169 Correct 1675 ms 7516 KB Output is correct
170 Correct 1651 ms 7604 KB Output is correct
171 Correct 1663 ms 7492 KB Output is correct
172 Correct 1644 ms 7504 KB Output is correct
173 Correct 1685 ms 7380 KB Output is correct
174 Correct 1659 ms 7396 KB Output is correct
175 Correct 1678 ms 7588 KB Output is correct