Submission #613684

# Submission time Handle Problem Language Result Execution time Memory
613684 2022-07-30T09:12:06 Z yuto1115 Diversity (CEOI21_diversity) C++17
100 / 100
1245 ms 8056 KB
#include <bits/stdc++.h>
#define rep(i, n) for(ll i = 0; i < ll(n); ++i)
#define rep2(i, s, n) for(ll i = ll(s); i < ll(n); ++i)
#define rrep(i, n) for(ll i = ll(n) - 1; i >= 0; --i)
#define rrep2(i, n, t) for(ll i = ll(n) - 1; i >= ll(t); --i)
#define pb push_back
#define eb emplace_back
#define all(a) a.begin(), a.end()
#define SZ(a) int(a.size())
using namespace std;
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using vp = vector<P>;
using vvp = vector<vp>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vs = vector<string>;
const int inf = 1001001001;
const ll linf = 1001001001001001001;

template<class T>
bool chmin(T &a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}

template<class T>
bool chmax(T &a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

const int sz = 300000;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr), cout.tie(nullptr);
    int n, q;
    cin >> n >> q;
    vi a(n);
    for (int &i: a) {
        cin >> i;
        --i;
    }
    vi l(q), r(q);
    rep(i, q) {
        cin >> l[i] >> r[i];
        --l[i];
    }
    const int B = 1338;
    vi ord(q);
    iota(all(ord), 0);
    sort(all(ord), [&](int i, int j) {
        if (r[i] / B != r[j] / B) return r[i] / B < r[j] / B;
        return l[i] < l[j];
    });
    vi cnt(sz);
    vi mp(n + 1);
    auto add = [&](int x) {
        --mp[cnt[x]];
        ++mp[++cnt[x]];
    };
    auto del = [&](int x) {
        --mp[cnt[x]];
        ++mp[--cnt[x]];
    };
    auto calc = [&](int s, int a, int k, int n) -> ll {
        assert(a > 0 and k > 0 and s + a * k <= n / 2);
        ll res = 0;
        res -= (ll) k * (k + 1) * (2 * k + 1) / 6 * a * a;
        res += (ll) k * (k + 1) / 2 * a * (n - 2 * s);
        res += (ll) k * s * (n - s);
        return res;
    };
    const int D = min(550, n + 1);
    vi can;
    {
        vi v(sz);
        rep(i, n) ++v[a[i]];
        rep(i, sz) if (v[i] >= D) can.pb(i);
    }
    auto solve = [&mp, &calc, &D, &can, &cnt](int n) -> ll {
        vp ls;
        rep2(i, 1, D) if (mp[i]) ls.eb(i, mp[i]);
        for (int i: can) if (cnt[i] >= D) ls.eb(cnt[i], 1);
        sort(all(ls));
        --ls.back().second;
        vi v(2);
        ll res = 0;
        for (auto[f, s]: ls) {
            if (!f or !s) continue;
//            cerr << f << ' ' << s << endl;
            if (v[0] > v[1]) swap(v[0], v[1]);
            res += calc(v[0], f, (s + 1) / 2, n);
            if (s >= 2) res += calc(v[1], f, s / 2, n);
            v[0] += (s + 1) / 2 * f;
            v[1] += s / 2 * f;
        }
        rep(i, 2) assert(v[i] <= n / 2);
        res += (ll) n * (n + 1) / 2;
        return res;
    };
    vl ans(q);
    int nl = 0, nr = 0;
    for (int i: ord) {
//        cerr << i << endl;
        while (nl > l[i]) add(a[--nl]);
        while (nr < r[i]) add(a[nr++]);
        while (nl < l[i]) del(a[nl++]);
        while (nr > r[i]) del(a[--nr]);
        ans[i] = solve(r[i] - l[i]);
    }
    rep(i, q) cout << ans[i] << '\n';
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 2644 KB Output is correct
2 Correct 3 ms 2644 KB Output is correct
3 Correct 3 ms 2620 KB Output is correct
4 Correct 2 ms 2644 KB Output is correct
5 Correct 2 ms 2620 KB Output is correct
6 Correct 2 ms 2620 KB Output is correct
7 Correct 2 ms 2624 KB Output is correct
8 Correct 2 ms 2644 KB Output is correct
9 Correct 2 ms 2644 KB Output is correct
10 Correct 2 ms 2644 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 2644 KB Output is correct
2 Correct 2 ms 2644 KB Output is correct
3 Correct 3 ms 2676 KB Output is correct
4 Correct 7 ms 3540 KB Output is correct
5 Correct 13 ms 4584 KB Output is correct
6 Correct 32 ms 5400 KB Output is correct
7 Correct 21 ms 5440 KB Output is correct
8 Correct 26 ms 5452 KB Output is correct
9 Correct 21 ms 5512 KB Output is correct
10 Correct 21 ms 5468 KB Output is correct
11 Correct 22 ms 5424 KB Output is correct
12 Correct 21 ms 5436 KB Output is correct
13 Correct 20 ms 5460 KB Output is correct
14 Correct 21 ms 5516 KB Output is correct
15 Correct 21 ms 5456 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 2644 KB Output is correct
2 Correct 2 ms 2644 KB Output is correct
3 Correct 3 ms 2676 KB Output is correct
4 Correct 7 ms 3540 KB Output is correct
5 Correct 13 ms 4584 KB Output is correct
6 Correct 32 ms 5400 KB Output is correct
7 Correct 21 ms 5440 KB Output is correct
8 Correct 26 ms 5452 KB Output is correct
9 Correct 21 ms 5512 KB Output is correct
10 Correct 21 ms 5468 KB Output is correct
11 Correct 22 ms 5424 KB Output is correct
12 Correct 21 ms 5436 KB Output is correct
13 Correct 20 ms 5460 KB Output is correct
14 Correct 21 ms 5516 KB Output is correct
15 Correct 21 ms 5456 KB Output is correct
16 Correct 2 ms 2644 KB Output is correct
17 Correct 2 ms 2644 KB Output is correct
18 Correct 3 ms 2772 KB Output is correct
19 Correct 10 ms 3688 KB Output is correct
20 Correct 21 ms 4664 KB Output is correct
21 Correct 23 ms 5512 KB Output is correct
22 Correct 23 ms 5432 KB Output is correct
23 Correct 21 ms 5456 KB Output is correct
24 Correct 22 ms 5484 KB Output is correct
25 Correct 22 ms 5460 KB Output is correct
26 Correct 22 ms 5452 KB Output is correct
27 Correct 22 ms 5464 KB Output is correct
28 Correct 25 ms 5436 KB Output is correct
29 Correct 26 ms 5440 KB Output is correct
30 Correct 28 ms 5448 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 2644 KB Output is correct
2 Correct 2 ms 2644 KB Output is correct
3 Correct 3 ms 2676 KB Output is correct
4 Correct 7 ms 3540 KB Output is correct
5 Correct 13 ms 4584 KB Output is correct
6 Correct 32 ms 5400 KB Output is correct
7 Correct 21 ms 5440 KB Output is correct
8 Correct 26 ms 5452 KB Output is correct
9 Correct 21 ms 5512 KB Output is correct
10 Correct 21 ms 5468 KB Output is correct
11 Correct 22 ms 5424 KB Output is correct
12 Correct 21 ms 5436 KB Output is correct
13 Correct 20 ms 5460 KB Output is correct
14 Correct 21 ms 5516 KB Output is correct
15 Correct 21 ms 5456 KB Output is correct
16 Correct 2 ms 2644 KB Output is correct
17 Correct 2 ms 2644 KB Output is correct
18 Correct 3 ms 2772 KB Output is correct
19 Correct 10 ms 3688 KB Output is correct
20 Correct 21 ms 4664 KB Output is correct
21 Correct 23 ms 5512 KB Output is correct
22 Correct 23 ms 5432 KB Output is correct
23 Correct 21 ms 5456 KB Output is correct
24 Correct 22 ms 5484 KB Output is correct
25 Correct 22 ms 5460 KB Output is correct
26 Correct 22 ms 5452 KB Output is correct
27 Correct 22 ms 5464 KB Output is correct
28 Correct 25 ms 5436 KB Output is correct
29 Correct 26 ms 5440 KB Output is correct
30 Correct 28 ms 5448 KB Output is correct
31 Correct 2 ms 2644 KB Output is correct
32 Correct 2 ms 2644 KB Output is correct
33 Correct 2 ms 2644 KB Output is correct
34 Correct 2 ms 2772 KB Output is correct
35 Correct 3 ms 2772 KB Output is correct
36 Correct 2 ms 2772 KB Output is correct
37 Correct 6 ms 3148 KB Output is correct
38 Correct 6 ms 3156 KB Output is correct
39 Correct 9 ms 3792 KB Output is correct
40 Correct 16 ms 4744 KB Output is correct
41 Correct 25 ms 5452 KB Output is correct
42 Correct 25 ms 5476 KB Output is correct
43 Correct 25 ms 5476 KB Output is correct
44 Correct 26 ms 5424 KB Output is correct
45 Correct 26 ms 5448 KB Output is correct
46 Correct 24 ms 5456 KB Output is correct
47 Correct 25 ms 5464 KB Output is correct
48 Correct 23 ms 5424 KB Output is correct
49 Correct 25 ms 5424 KB Output is correct
50 Correct 29 ms 5440 KB Output is correct
51 Correct 24 ms 5492 KB Output is correct
52 Correct 28 ms 5436 KB Output is correct
53 Correct 25 ms 5452 KB Output is correct
54 Correct 22 ms 5464 KB Output is correct
55 Correct 23 ms 5400 KB Output is correct
56 Correct 24 ms 5524 KB Output is correct
57 Correct 25 ms 5464 KB Output is correct
58 Correct 24 ms 5520 KB Output is correct
59 Correct 25 ms 5580 KB Output is correct
60 Correct 30 ms 5404 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 2644 KB Output is correct
2 Correct 3 ms 2644 KB Output is correct
3 Correct 3 ms 2620 KB Output is correct
4 Correct 2 ms 2644 KB Output is correct
5 Correct 2 ms 2620 KB Output is correct
6 Correct 2 ms 2620 KB Output is correct
7 Correct 2 ms 2624 KB Output is correct
8 Correct 2 ms 2644 KB Output is correct
9 Correct 2 ms 2644 KB Output is correct
10 Correct 2 ms 2644 KB Output is correct
11 Correct 2 ms 2644 KB Output is correct
12 Correct 2 ms 2644 KB Output is correct
13 Correct 3 ms 2676 KB Output is correct
14 Correct 7 ms 3540 KB Output is correct
15 Correct 13 ms 4584 KB Output is correct
16 Correct 32 ms 5400 KB Output is correct
17 Correct 21 ms 5440 KB Output is correct
18 Correct 26 ms 5452 KB Output is correct
19 Correct 21 ms 5512 KB Output is correct
20 Correct 21 ms 5468 KB Output is correct
21 Correct 22 ms 5424 KB Output is correct
22 Correct 21 ms 5436 KB Output is correct
23 Correct 20 ms 5460 KB Output is correct
24 Correct 21 ms 5516 KB Output is correct
25 Correct 21 ms 5456 KB Output is correct
26 Correct 2 ms 2644 KB Output is correct
27 Correct 2 ms 2644 KB Output is correct
28 Correct 3 ms 2772 KB Output is correct
29 Correct 10 ms 3688 KB Output is correct
30 Correct 21 ms 4664 KB Output is correct
31 Correct 23 ms 5512 KB Output is correct
32 Correct 23 ms 5432 KB Output is correct
33 Correct 21 ms 5456 KB Output is correct
34 Correct 22 ms 5484 KB Output is correct
35 Correct 22 ms 5460 KB Output is correct
36 Correct 22 ms 5452 KB Output is correct
37 Correct 22 ms 5464 KB Output is correct
38 Correct 25 ms 5436 KB Output is correct
39 Correct 26 ms 5440 KB Output is correct
40 Correct 28 ms 5448 KB Output is correct
41 Correct 2 ms 2644 KB Output is correct
42 Correct 2 ms 2644 KB Output is correct
43 Correct 2 ms 2644 KB Output is correct
44 Correct 2 ms 2772 KB Output is correct
45 Correct 3 ms 2772 KB Output is correct
46 Correct 2 ms 2772 KB Output is correct
47 Correct 6 ms 3148 KB Output is correct
48 Correct 6 ms 3156 KB Output is correct
49 Correct 9 ms 3792 KB Output is correct
50 Correct 16 ms 4744 KB Output is correct
51 Correct 25 ms 5452 KB Output is correct
52 Correct 25 ms 5476 KB Output is correct
53 Correct 25 ms 5476 KB Output is correct
54 Correct 26 ms 5424 KB Output is correct
55 Correct 26 ms 5448 KB Output is correct
56 Correct 24 ms 5456 KB Output is correct
57 Correct 25 ms 5464 KB Output is correct
58 Correct 23 ms 5424 KB Output is correct
59 Correct 25 ms 5424 KB Output is correct
60 Correct 29 ms 5440 KB Output is correct
61 Correct 24 ms 5492 KB Output is correct
62 Correct 28 ms 5436 KB Output is correct
63 Correct 25 ms 5452 KB Output is correct
64 Correct 22 ms 5464 KB Output is correct
65 Correct 23 ms 5400 KB Output is correct
66 Correct 24 ms 5524 KB Output is correct
67 Correct 25 ms 5464 KB Output is correct
68 Correct 24 ms 5520 KB Output is correct
69 Correct 25 ms 5580 KB Output is correct
70 Correct 30 ms 5404 KB Output is correct
71 Correct 6 ms 3156 KB Output is correct
72 Correct 6 ms 3284 KB Output is correct
73 Correct 6 ms 3284 KB Output is correct
74 Correct 6 ms 3200 KB Output is correct
75 Correct 6 ms 3180 KB Output is correct
76 Correct 9 ms 3912 KB Output is correct
77 Correct 9 ms 3904 KB Output is correct
78 Correct 10 ms 3908 KB Output is correct
79 Correct 10 ms 3908 KB Output is correct
80 Correct 12 ms 3924 KB Output is correct
81 Correct 18 ms 4680 KB Output is correct
82 Correct 18 ms 4620 KB Output is correct
83 Correct 21 ms 4684 KB Output is correct
84 Correct 22 ms 4660 KB Output is correct
85 Correct 19 ms 4712 KB Output is correct
86 Correct 20 ms 4684 KB Output is correct
87 Correct 23 ms 4660 KB Output is correct
88 Correct 20 ms 4640 KB Output is correct
89 Correct 20 ms 4672 KB Output is correct
90 Correct 22 ms 4656 KB Output is correct
91 Correct 33 ms 6032 KB Output is correct
92 Correct 29 ms 5992 KB Output is correct
93 Correct 31 ms 5916 KB Output is correct
94 Correct 31 ms 5924 KB Output is correct
95 Correct 29 ms 5912 KB Output is correct
96 Correct 33 ms 5996 KB Output is correct
97 Correct 34 ms 5988 KB Output is correct
98 Correct 33 ms 5956 KB Output is correct
99 Correct 42 ms 6024 KB Output is correct
100 Correct 38 ms 6028 KB Output is correct
101 Correct 32 ms 5956 KB Output is correct
102 Correct 34 ms 6020 KB Output is correct
103 Correct 35 ms 5996 KB Output is correct
104 Correct 32 ms 5976 KB Output is correct
105 Correct 30 ms 5964 KB Output is correct
106 Correct 37 ms 5984 KB Output is correct
107 Correct 40 ms 6028 KB Output is correct
108 Correct 33 ms 5964 KB Output is correct
109 Correct 32 ms 5964 KB Output is correct
110 Correct 33 ms 5964 KB Output is correct
111 Correct 34 ms 5996 KB Output is correct
112 Correct 35 ms 5960 KB Output is correct
113 Correct 36 ms 5988 KB Output is correct
114 Correct 35 ms 5944 KB Output is correct
115 Correct 32 ms 5928 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 2644 KB Output is correct
2 Correct 3 ms 2644 KB Output is correct
3 Correct 3 ms 2620 KB Output is correct
4 Correct 2 ms 2644 KB Output is correct
5 Correct 2 ms 2620 KB Output is correct
6 Correct 2 ms 2620 KB Output is correct
7 Correct 2 ms 2624 KB Output is correct
8 Correct 2 ms 2644 KB Output is correct
9 Correct 2 ms 2644 KB Output is correct
10 Correct 2 ms 2644 KB Output is correct
11 Correct 2 ms 2644 KB Output is correct
12 Correct 2 ms 2644 KB Output is correct
13 Correct 3 ms 2676 KB Output is correct
14 Correct 7 ms 3540 KB Output is correct
15 Correct 13 ms 4584 KB Output is correct
16 Correct 32 ms 5400 KB Output is correct
17 Correct 21 ms 5440 KB Output is correct
18 Correct 26 ms 5452 KB Output is correct
19 Correct 21 ms 5512 KB Output is correct
20 Correct 21 ms 5468 KB Output is correct
21 Correct 22 ms 5424 KB Output is correct
22 Correct 21 ms 5436 KB Output is correct
23 Correct 20 ms 5460 KB Output is correct
24 Correct 21 ms 5516 KB Output is correct
25 Correct 21 ms 5456 KB Output is correct
26 Correct 2 ms 2644 KB Output is correct
27 Correct 2 ms 2644 KB Output is correct
28 Correct 3 ms 2772 KB Output is correct
29 Correct 10 ms 3688 KB Output is correct
30 Correct 21 ms 4664 KB Output is correct
31 Correct 23 ms 5512 KB Output is correct
32 Correct 23 ms 5432 KB Output is correct
33 Correct 21 ms 5456 KB Output is correct
34 Correct 22 ms 5484 KB Output is correct
35 Correct 22 ms 5460 KB Output is correct
36 Correct 22 ms 5452 KB Output is correct
37 Correct 22 ms 5464 KB Output is correct
38 Correct 25 ms 5436 KB Output is correct
39 Correct 26 ms 5440 KB Output is correct
40 Correct 28 ms 5448 KB Output is correct
41 Correct 2 ms 2644 KB Output is correct
42 Correct 2 ms 2644 KB Output is correct
43 Correct 2 ms 2644 KB Output is correct
44 Correct 2 ms 2772 KB Output is correct
45 Correct 3 ms 2772 KB Output is correct
46 Correct 2 ms 2772 KB Output is correct
47 Correct 6 ms 3148 KB Output is correct
48 Correct 6 ms 3156 KB Output is correct
49 Correct 9 ms 3792 KB Output is correct
50 Correct 16 ms 4744 KB Output is correct
51 Correct 25 ms 5452 KB Output is correct
52 Correct 25 ms 5476 KB Output is correct
53 Correct 25 ms 5476 KB Output is correct
54 Correct 26 ms 5424 KB Output is correct
55 Correct 26 ms 5448 KB Output is correct
56 Correct 24 ms 5456 KB Output is correct
57 Correct 25 ms 5464 KB Output is correct
58 Correct 23 ms 5424 KB Output is correct
59 Correct 25 ms 5424 KB Output is correct
60 Correct 29 ms 5440 KB Output is correct
61 Correct 24 ms 5492 KB Output is correct
62 Correct 28 ms 5436 KB Output is correct
63 Correct 25 ms 5452 KB Output is correct
64 Correct 22 ms 5464 KB Output is correct
65 Correct 23 ms 5400 KB Output is correct
66 Correct 24 ms 5524 KB Output is correct
67 Correct 25 ms 5464 KB Output is correct
68 Correct 24 ms 5520 KB Output is correct
69 Correct 25 ms 5580 KB Output is correct
70 Correct 30 ms 5404 KB Output is correct
71 Correct 6 ms 3156 KB Output is correct
72 Correct 6 ms 3284 KB Output is correct
73 Correct 6 ms 3284 KB Output is correct
74 Correct 6 ms 3200 KB Output is correct
75 Correct 6 ms 3180 KB Output is correct
76 Correct 9 ms 3912 KB Output is correct
77 Correct 9 ms 3904 KB Output is correct
78 Correct 10 ms 3908 KB Output is correct
79 Correct 10 ms 3908 KB Output is correct
80 Correct 12 ms 3924 KB Output is correct
81 Correct 18 ms 4680 KB Output is correct
82 Correct 18 ms 4620 KB Output is correct
83 Correct 21 ms 4684 KB Output is correct
84 Correct 22 ms 4660 KB Output is correct
85 Correct 19 ms 4712 KB Output is correct
86 Correct 20 ms 4684 KB Output is correct
87 Correct 23 ms 4660 KB Output is correct
88 Correct 20 ms 4640 KB Output is correct
89 Correct 20 ms 4672 KB Output is correct
90 Correct 22 ms 4656 KB Output is correct
91 Correct 33 ms 6032 KB Output is correct
92 Correct 29 ms 5992 KB Output is correct
93 Correct 31 ms 5916 KB Output is correct
94 Correct 31 ms 5924 KB Output is correct
95 Correct 29 ms 5912 KB Output is correct
96 Correct 33 ms 5996 KB Output is correct
97 Correct 34 ms 5988 KB Output is correct
98 Correct 33 ms 5956 KB Output is correct
99 Correct 42 ms 6024 KB Output is correct
100 Correct 38 ms 6028 KB Output is correct
101 Correct 32 ms 5956 KB Output is correct
102 Correct 34 ms 6020 KB Output is correct
103 Correct 35 ms 5996 KB Output is correct
104 Correct 32 ms 5976 KB Output is correct
105 Correct 30 ms 5964 KB Output is correct
106 Correct 37 ms 5984 KB Output is correct
107 Correct 40 ms 6028 KB Output is correct
108 Correct 33 ms 5964 KB Output is correct
109 Correct 32 ms 5964 KB Output is correct
110 Correct 33 ms 5964 KB Output is correct
111 Correct 34 ms 5996 KB Output is correct
112 Correct 35 ms 5960 KB Output is correct
113 Correct 36 ms 5988 KB Output is correct
114 Correct 35 ms 5944 KB Output is correct
115 Correct 32 ms 5928 KB Output is correct
116 Correct 251 ms 3788 KB Output is correct
117 Correct 260 ms 3824 KB Output is correct
118 Correct 351 ms 4044 KB Output is correct
119 Correct 380 ms 4044 KB Output is correct
120 Correct 326 ms 4128 KB Output is correct
121 Correct 450 ms 4472 KB Output is correct
122 Correct 397 ms 4520 KB Output is correct
123 Correct 762 ms 5496 KB Output is correct
124 Correct 569 ms 5616 KB Output is correct
125 Correct 578 ms 5552 KB Output is correct
126 Correct 1158 ms 6488 KB Output is correct
127 Correct 1140 ms 7244 KB Output is correct
128 Correct 1205 ms 7244 KB Output is correct
129 Correct 1115 ms 7248 KB Output is correct
130 Correct 1126 ms 7244 KB Output is correct
131 Correct 1206 ms 7360 KB Output is correct
132 Correct 1189 ms 7300 KB Output is correct
133 Correct 1154 ms 7248 KB Output is correct
134 Correct 1245 ms 7248 KB Output is correct
135 Correct 1198 ms 7368 KB Output is correct
136 Correct 1202 ms 7296 KB Output is correct
137 Correct 1202 ms 7372 KB Output is correct
138 Correct 1170 ms 7244 KB Output is correct
139 Correct 1213 ms 7288 KB Output is correct
140 Correct 1196 ms 7292 KB Output is correct
141 Correct 1130 ms 7380 KB Output is correct
142 Correct 1174 ms 7364 KB Output is correct
143 Correct 1136 ms 7368 KB Output is correct
144 Correct 1109 ms 7368 KB Output is correct
145 Correct 1084 ms 7376 KB Output is correct
146 Correct 922 ms 7632 KB Output is correct
147 Correct 930 ms 7628 KB Output is correct
148 Correct 888 ms 7628 KB Output is correct
149 Correct 825 ms 7632 KB Output is correct
150 Correct 949 ms 7632 KB Output is correct
151 Correct 937 ms 7624 KB Output is correct
152 Correct 936 ms 7628 KB Output is correct
153 Correct 787 ms 7628 KB Output is correct
154 Correct 887 ms 7632 KB Output is correct
155 Correct 907 ms 7632 KB Output is correct
156 Correct 1141 ms 7956 KB Output is correct
157 Correct 1144 ms 7876 KB Output is correct
158 Correct 1068 ms 7956 KB Output is correct
159 Correct 1133 ms 7880 KB Output is correct
160 Correct 1099 ms 7896 KB Output is correct
161 Correct 763 ms 8004 KB Output is correct
162 Correct 941 ms 8004 KB Output is correct
163 Correct 782 ms 8004 KB Output is correct
164 Correct 967 ms 8008 KB Output is correct
165 Correct 860 ms 8056 KB Output is correct
166 Correct 1062 ms 7752 KB Output is correct
167 Correct 1035 ms 7760 KB Output is correct
168 Correct 1074 ms 7836 KB Output is correct
169 Correct 1046 ms 7916 KB Output is correct
170 Correct 1030 ms 7752 KB Output is correct
171 Correct 1080 ms 7888 KB Output is correct
172 Correct 1080 ms 7884 KB Output is correct
173 Correct 1078 ms 7888 KB Output is correct
174 Correct 1084 ms 7888 KB Output is correct
175 Correct 1107 ms 7884 KB Output is correct