Submission #492973

# Submission time Handle Problem Language Result Execution time Memory
492973 2021-12-09T21:01:27 Z blue Diversity (CEOI21_diversity) C++17
100 / 100
4353 ms 11452 KB
#include <iostream>
#include <vector>
#include <algorithm>
#include <deque>
using namespace std;

const int mx = 300'000;
const int mxQ = 50'000;
const int rt = 500;

using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
#define sz(x) (int(x.size()))

int N, Q;
vi a(1+mx);

vi l(1+mxQ), r(1+mxQ);
vll ans(1+mxQ);

int L = 1;
int R = 0;

vll ct(1+mx, 0);
vll freq(1+mx, 0);

vector<ll> sizes;
vector<bool> occ(1+mx, 0);

ll ap_sum(ll a, ll d, ll n)
{
    return (n * (2*a + (n-1)*d))/2;
}

ll ap_sq_sum(ll a, ll d, ll n)
{

    return n*a*a  +  a*d*(n-1)*n   +   d*d*(((n-1)*n*(2*n-1))/6);
}

ll get_ans()
{
    vector<ll> sizes2;
    for(ll s: sizes)
    {
        if(occ[s]) continue;
        if(freq[s] == 0) continue;
        sizes2.push_back(s);
        occ[s] = 1;
    }
    sizes = sizes2;
    for(ll s: sizes) occ[s] = 0;

    sort(sizes.begin(), sizes.end(), [] (int u, int v)
    {
        return u > v;
    });

    deque< pair<ll, ll> > ord;
    int z = 0;
    for(ll s: sizes)
    {
        if(freq[s] % 2 == 1)
        {
            // cerr << "odd!\n";
            if(z) ord.push_back({s, 1});
            else ord.push_front({s, 1});
            z = !z;
        }
        if(freq[s]/2)
        {
            // cerr << "breaking into 2\n";
            ord.push_back({s, freq[s]/2});
            ord.push_front({s, freq[s]/2});
        }
    }
    ord.push_front({0, 0});

    ll ans = 0;
    ll tot = 0;

    int P = sz(ord) - 1;
    vll prefsum(1+P, 0);
    for(int i = 1; i <= P; i++)
    {
        prefsum[i] = prefsum[i-1] + (ord[i].first * ord[i].second);
    }
    tot = prefsum[P];

    for(int i = 1; i <= P; i++)
    {

        ans += ord[i].second * (ord[i].first * (ord[i].first + 1))/2;


        ans += ord[i].second * (ord[i].first * (tot - ord[i].first));


        ans += (tot - ord[i].first) * ap_sum(prefsum[i-1], ord[i].first, ord[i].second);


        ans -= ap_sq_sum(prefsum[i-1], ord[i].first, ord[i].second);
    }

    return ans;
}

void add_species(int a)
{
    freq[ct[a]]--;
    ct[a]++;
    freq[ct[a]]++;
    sizes.push_back(ct[a]);
}

void remove_species(int a)
{
    freq[ct[a]]--;
    ct[a]--;
    freq[ct[a]]++;
    sizes.push_back(ct[a]);
}

void expand_right()
{
    R++;
    add_species(a[R]);
}

void expand_left()
{
    L--;
    add_species(a[L]);
}

void contract_right()
{
    remove_species(a[R]);
    R--;
}

void contract_left()
{
    remove_species(a[L]);
    L++;
}

int main()
{
    cin >> N >> Q;
    for(int i = 1; i <= N; i++) cin >> a[i];
    for(int j = 1; j <= Q; j++) cin >> l[j] >> r[j];

    vi I(Q);
    for(int j = 0; j < Q; j++) I[j] = j+1;
    sort(I.begin(), I.end(), [] (int u, int v)
    {
        if(l[u]/rt != l[v]/rt) return l[u]/rt < l[v]/rt;
        else return r[u] < r[v];
    });

    freq[0] = mx;

    for(int q: I)
    {
        while(R < r[q]) expand_right();
        while(L > l[q]) expand_left();
        while(R > r[q]) contract_right();
        while(L < l[q]) contract_left();
        ans[q] = get_ans();
    }

    for(int q = 1; q <= Q; q++) cout << ans[q] << '\n';
}
# Verdict Execution time Memory Grader output
1 Correct 3 ms 6988 KB Output is correct
2 Correct 3 ms 6988 KB Output is correct
3 Correct 3 ms 6988 KB Output is correct
4 Correct 3 ms 6988 KB Output is correct
5 Correct 5 ms 6988 KB Output is correct
6 Correct 4 ms 6988 KB Output is correct
7 Correct 3 ms 6988 KB Output is correct
8 Correct 3 ms 6988 KB Output is correct
9 Correct 4 ms 6988 KB Output is correct
10 Correct 3 ms 6948 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 6988 KB Output is correct
2 Correct 3 ms 6988 KB Output is correct
3 Correct 6 ms 7168 KB Output is correct
4 Correct 18 ms 8132 KB Output is correct
5 Correct 42 ms 9136 KB Output is correct
6 Correct 62 ms 11184 KB Output is correct
7 Correct 49 ms 11196 KB Output is correct
8 Correct 57 ms 11192 KB Output is correct
9 Correct 50 ms 11184 KB Output is correct
10 Correct 51 ms 11176 KB Output is correct
11 Correct 51 ms 11184 KB Output is correct
12 Correct 50 ms 11192 KB Output is correct
13 Correct 70 ms 11184 KB Output is correct
14 Correct 55 ms 11196 KB Output is correct
15 Correct 54 ms 11184 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 6988 KB Output is correct
2 Correct 3 ms 6988 KB Output is correct
3 Correct 6 ms 7168 KB Output is correct
4 Correct 18 ms 8132 KB Output is correct
5 Correct 42 ms 9136 KB Output is correct
6 Correct 62 ms 11184 KB Output is correct
7 Correct 49 ms 11196 KB Output is correct
8 Correct 57 ms 11192 KB Output is correct
9 Correct 50 ms 11184 KB Output is correct
10 Correct 51 ms 11176 KB Output is correct
11 Correct 51 ms 11184 KB Output is correct
12 Correct 50 ms 11192 KB Output is correct
13 Correct 70 ms 11184 KB Output is correct
14 Correct 55 ms 11196 KB Output is correct
15 Correct 54 ms 11184 KB Output is correct
16 Correct 3 ms 6988 KB Output is correct
17 Correct 3 ms 6988 KB Output is correct
18 Correct 4 ms 7120 KB Output is correct
19 Correct 29 ms 8132 KB Output is correct
20 Correct 36 ms 9136 KB Output is correct
21 Correct 54 ms 11176 KB Output is correct
22 Correct 55 ms 11180 KB Output is correct
23 Correct 56 ms 11196 KB Output is correct
24 Correct 56 ms 11188 KB Output is correct
25 Correct 62 ms 11192 KB Output is correct
26 Correct 58 ms 11184 KB Output is correct
27 Correct 75 ms 11180 KB Output is correct
28 Correct 53 ms 11196 KB Output is correct
29 Correct 58 ms 11160 KB Output is correct
30 Correct 79 ms 11184 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 6988 KB Output is correct
2 Correct 3 ms 6988 KB Output is correct
3 Correct 6 ms 7168 KB Output is correct
4 Correct 18 ms 8132 KB Output is correct
5 Correct 42 ms 9136 KB Output is correct
6 Correct 62 ms 11184 KB Output is correct
7 Correct 49 ms 11196 KB Output is correct
8 Correct 57 ms 11192 KB Output is correct
9 Correct 50 ms 11184 KB Output is correct
10 Correct 51 ms 11176 KB Output is correct
11 Correct 51 ms 11184 KB Output is correct
12 Correct 50 ms 11192 KB Output is correct
13 Correct 70 ms 11184 KB Output is correct
14 Correct 55 ms 11196 KB Output is correct
15 Correct 54 ms 11184 KB Output is correct
16 Correct 3 ms 6988 KB Output is correct
17 Correct 3 ms 6988 KB Output is correct
18 Correct 4 ms 7120 KB Output is correct
19 Correct 29 ms 8132 KB Output is correct
20 Correct 36 ms 9136 KB Output is correct
21 Correct 54 ms 11176 KB Output is correct
22 Correct 55 ms 11180 KB Output is correct
23 Correct 56 ms 11196 KB Output is correct
24 Correct 56 ms 11188 KB Output is correct
25 Correct 62 ms 11192 KB Output is correct
26 Correct 58 ms 11184 KB Output is correct
27 Correct 75 ms 11180 KB Output is correct
28 Correct 53 ms 11196 KB Output is correct
29 Correct 58 ms 11160 KB Output is correct
30 Correct 79 ms 11184 KB Output is correct
31 Correct 3 ms 6988 KB Output is correct
32 Correct 3 ms 6988 KB Output is correct
33 Correct 3 ms 6988 KB Output is correct
34 Correct 6 ms 7184 KB Output is correct
35 Correct 5 ms 7184 KB Output is correct
36 Correct 6 ms 7128 KB Output is correct
37 Correct 14 ms 7584 KB Output is correct
38 Correct 14 ms 7624 KB Output is correct
39 Correct 25 ms 8140 KB Output is correct
40 Correct 62 ms 9132 KB Output is correct
41 Correct 77 ms 11176 KB Output is correct
42 Correct 74 ms 11184 KB Output is correct
43 Correct 68 ms 11196 KB Output is correct
44 Correct 69 ms 11180 KB Output is correct
45 Correct 67 ms 11180 KB Output is correct
46 Correct 68 ms 11192 KB Output is correct
47 Correct 69 ms 11208 KB Output is correct
48 Correct 74 ms 11184 KB Output is correct
49 Correct 74 ms 11184 KB Output is correct
50 Correct 68 ms 11188 KB Output is correct
51 Correct 70 ms 11188 KB Output is correct
52 Correct 94 ms 11192 KB Output is correct
53 Correct 72 ms 11188 KB Output is correct
54 Correct 71 ms 11184 KB Output is correct
55 Correct 71 ms 11192 KB Output is correct
56 Correct 69 ms 11196 KB Output is correct
57 Correct 70 ms 11184 KB Output is correct
58 Correct 68 ms 11188 KB Output is correct
59 Correct 87 ms 11180 KB Output is correct
60 Correct 84 ms 11176 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 6988 KB Output is correct
2 Correct 3 ms 6988 KB Output is correct
3 Correct 3 ms 6988 KB Output is correct
4 Correct 3 ms 6988 KB Output is correct
5 Correct 5 ms 6988 KB Output is correct
6 Correct 4 ms 6988 KB Output is correct
7 Correct 3 ms 6988 KB Output is correct
8 Correct 3 ms 6988 KB Output is correct
9 Correct 4 ms 6988 KB Output is correct
10 Correct 3 ms 6948 KB Output is correct
11 Correct 3 ms 6988 KB Output is correct
12 Correct 3 ms 6988 KB Output is correct
13 Correct 6 ms 7168 KB Output is correct
14 Correct 18 ms 8132 KB Output is correct
15 Correct 42 ms 9136 KB Output is correct
16 Correct 62 ms 11184 KB Output is correct
17 Correct 49 ms 11196 KB Output is correct
18 Correct 57 ms 11192 KB Output is correct
19 Correct 50 ms 11184 KB Output is correct
20 Correct 51 ms 11176 KB Output is correct
21 Correct 51 ms 11184 KB Output is correct
22 Correct 50 ms 11192 KB Output is correct
23 Correct 70 ms 11184 KB Output is correct
24 Correct 55 ms 11196 KB Output is correct
25 Correct 54 ms 11184 KB Output is correct
26 Correct 3 ms 6988 KB Output is correct
27 Correct 3 ms 6988 KB Output is correct
28 Correct 4 ms 7120 KB Output is correct
29 Correct 29 ms 8132 KB Output is correct
30 Correct 36 ms 9136 KB Output is correct
31 Correct 54 ms 11176 KB Output is correct
32 Correct 55 ms 11180 KB Output is correct
33 Correct 56 ms 11196 KB Output is correct
34 Correct 56 ms 11188 KB Output is correct
35 Correct 62 ms 11192 KB Output is correct
36 Correct 58 ms 11184 KB Output is correct
37 Correct 75 ms 11180 KB Output is correct
38 Correct 53 ms 11196 KB Output is correct
39 Correct 58 ms 11160 KB Output is correct
40 Correct 79 ms 11184 KB Output is correct
41 Correct 3 ms 6988 KB Output is correct
42 Correct 3 ms 6988 KB Output is correct
43 Correct 3 ms 6988 KB Output is correct
44 Correct 6 ms 7184 KB Output is correct
45 Correct 5 ms 7184 KB Output is correct
46 Correct 6 ms 7128 KB Output is correct
47 Correct 14 ms 7584 KB Output is correct
48 Correct 14 ms 7624 KB Output is correct
49 Correct 25 ms 8140 KB Output is correct
50 Correct 62 ms 9132 KB Output is correct
51 Correct 77 ms 11176 KB Output is correct
52 Correct 74 ms 11184 KB Output is correct
53 Correct 68 ms 11196 KB Output is correct
54 Correct 69 ms 11180 KB Output is correct
55 Correct 67 ms 11180 KB Output is correct
56 Correct 68 ms 11192 KB Output is correct
57 Correct 69 ms 11208 KB Output is correct
58 Correct 74 ms 11184 KB Output is correct
59 Correct 74 ms 11184 KB Output is correct
60 Correct 68 ms 11188 KB Output is correct
61 Correct 70 ms 11188 KB Output is correct
62 Correct 94 ms 11192 KB Output is correct
63 Correct 72 ms 11188 KB Output is correct
64 Correct 71 ms 11184 KB Output is correct
65 Correct 71 ms 11192 KB Output is correct
66 Correct 69 ms 11196 KB Output is correct
67 Correct 70 ms 11184 KB Output is correct
68 Correct 68 ms 11188 KB Output is correct
69 Correct 87 ms 11180 KB Output is correct
70 Correct 84 ms 11176 KB Output is correct
71 Correct 14 ms 7624 KB Output is correct
72 Correct 14 ms 7624 KB Output is correct
73 Correct 16 ms 7628 KB Output is correct
74 Correct 14 ms 7624 KB Output is correct
75 Correct 15 ms 7628 KB Output is correct
76 Correct 38 ms 8140 KB Output is correct
77 Correct 29 ms 8124 KB Output is correct
78 Correct 29 ms 8136 KB Output is correct
79 Correct 29 ms 8124 KB Output is correct
80 Correct 28 ms 8120 KB Output is correct
81 Correct 56 ms 9132 KB Output is correct
82 Correct 51 ms 9140 KB Output is correct
83 Correct 71 ms 9136 KB Output is correct
84 Correct 56 ms 9140 KB Output is correct
85 Correct 51 ms 9156 KB Output is correct
86 Correct 58 ms 9140 KB Output is correct
87 Correct 58 ms 9140 KB Output is correct
88 Correct 59 ms 9136 KB Output is correct
89 Correct 79 ms 9136 KB Output is correct
90 Correct 76 ms 9132 KB Output is correct
91 Correct 89 ms 11180 KB Output is correct
92 Correct 100 ms 11176 KB Output is correct
93 Correct 94 ms 11184 KB Output is correct
94 Correct 88 ms 11160 KB Output is correct
95 Correct 100 ms 11188 KB Output is correct
96 Correct 96 ms 11176 KB Output is correct
97 Correct 102 ms 11176 KB Output is correct
98 Correct 107 ms 11176 KB Output is correct
99 Correct 94 ms 11192 KB Output is correct
100 Correct 104 ms 11192 KB Output is correct
101 Correct 95 ms 11160 KB Output is correct
102 Correct 97 ms 11188 KB Output is correct
103 Correct 105 ms 11184 KB Output is correct
104 Correct 95 ms 11176 KB Output is correct
105 Correct 96 ms 11184 KB Output is correct
106 Correct 101 ms 11184 KB Output is correct
107 Correct 109 ms 11192 KB Output is correct
108 Correct 117 ms 11180 KB Output is correct
109 Correct 100 ms 11180 KB Output is correct
110 Correct 96 ms 11180 KB Output is correct
111 Correct 110 ms 11184 KB Output is correct
112 Correct 108 ms 11192 KB Output is correct
113 Correct 103 ms 11180 KB Output is correct
114 Correct 101 ms 11180 KB Output is correct
115 Correct 103 ms 11176 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 6988 KB Output is correct
2 Correct 3 ms 6988 KB Output is correct
3 Correct 3 ms 6988 KB Output is correct
4 Correct 3 ms 6988 KB Output is correct
5 Correct 5 ms 6988 KB Output is correct
6 Correct 4 ms 6988 KB Output is correct
7 Correct 3 ms 6988 KB Output is correct
8 Correct 3 ms 6988 KB Output is correct
9 Correct 4 ms 6988 KB Output is correct
10 Correct 3 ms 6948 KB Output is correct
11 Correct 3 ms 6988 KB Output is correct
12 Correct 3 ms 6988 KB Output is correct
13 Correct 6 ms 7168 KB Output is correct
14 Correct 18 ms 8132 KB Output is correct
15 Correct 42 ms 9136 KB Output is correct
16 Correct 62 ms 11184 KB Output is correct
17 Correct 49 ms 11196 KB Output is correct
18 Correct 57 ms 11192 KB Output is correct
19 Correct 50 ms 11184 KB Output is correct
20 Correct 51 ms 11176 KB Output is correct
21 Correct 51 ms 11184 KB Output is correct
22 Correct 50 ms 11192 KB Output is correct
23 Correct 70 ms 11184 KB Output is correct
24 Correct 55 ms 11196 KB Output is correct
25 Correct 54 ms 11184 KB Output is correct
26 Correct 3 ms 6988 KB Output is correct
27 Correct 3 ms 6988 KB Output is correct
28 Correct 4 ms 7120 KB Output is correct
29 Correct 29 ms 8132 KB Output is correct
30 Correct 36 ms 9136 KB Output is correct
31 Correct 54 ms 11176 KB Output is correct
32 Correct 55 ms 11180 KB Output is correct
33 Correct 56 ms 11196 KB Output is correct
34 Correct 56 ms 11188 KB Output is correct
35 Correct 62 ms 11192 KB Output is correct
36 Correct 58 ms 11184 KB Output is correct
37 Correct 75 ms 11180 KB Output is correct
38 Correct 53 ms 11196 KB Output is correct
39 Correct 58 ms 11160 KB Output is correct
40 Correct 79 ms 11184 KB Output is correct
41 Correct 3 ms 6988 KB Output is correct
42 Correct 3 ms 6988 KB Output is correct
43 Correct 3 ms 6988 KB Output is correct
44 Correct 6 ms 7184 KB Output is correct
45 Correct 5 ms 7184 KB Output is correct
46 Correct 6 ms 7128 KB Output is correct
47 Correct 14 ms 7584 KB Output is correct
48 Correct 14 ms 7624 KB Output is correct
49 Correct 25 ms 8140 KB Output is correct
50 Correct 62 ms 9132 KB Output is correct
51 Correct 77 ms 11176 KB Output is correct
52 Correct 74 ms 11184 KB Output is correct
53 Correct 68 ms 11196 KB Output is correct
54 Correct 69 ms 11180 KB Output is correct
55 Correct 67 ms 11180 KB Output is correct
56 Correct 68 ms 11192 KB Output is correct
57 Correct 69 ms 11208 KB Output is correct
58 Correct 74 ms 11184 KB Output is correct
59 Correct 74 ms 11184 KB Output is correct
60 Correct 68 ms 11188 KB Output is correct
61 Correct 70 ms 11188 KB Output is correct
62 Correct 94 ms 11192 KB Output is correct
63 Correct 72 ms 11188 KB Output is correct
64 Correct 71 ms 11184 KB Output is correct
65 Correct 71 ms 11192 KB Output is correct
66 Correct 69 ms 11196 KB Output is correct
67 Correct 70 ms 11184 KB Output is correct
68 Correct 68 ms 11188 KB Output is correct
69 Correct 87 ms 11180 KB Output is correct
70 Correct 84 ms 11176 KB Output is correct
71 Correct 14 ms 7624 KB Output is correct
72 Correct 14 ms 7624 KB Output is correct
73 Correct 16 ms 7628 KB Output is correct
74 Correct 14 ms 7624 KB Output is correct
75 Correct 15 ms 7628 KB Output is correct
76 Correct 38 ms 8140 KB Output is correct
77 Correct 29 ms 8124 KB Output is correct
78 Correct 29 ms 8136 KB Output is correct
79 Correct 29 ms 8124 KB Output is correct
80 Correct 28 ms 8120 KB Output is correct
81 Correct 56 ms 9132 KB Output is correct
82 Correct 51 ms 9140 KB Output is correct
83 Correct 71 ms 9136 KB Output is correct
84 Correct 56 ms 9140 KB Output is correct
85 Correct 51 ms 9156 KB Output is correct
86 Correct 58 ms 9140 KB Output is correct
87 Correct 58 ms 9140 KB Output is correct
88 Correct 59 ms 9136 KB Output is correct
89 Correct 79 ms 9136 KB Output is correct
90 Correct 76 ms 9132 KB Output is correct
91 Correct 89 ms 11180 KB Output is correct
92 Correct 100 ms 11176 KB Output is correct
93 Correct 94 ms 11184 KB Output is correct
94 Correct 88 ms 11160 KB Output is correct
95 Correct 100 ms 11188 KB Output is correct
96 Correct 96 ms 11176 KB Output is correct
97 Correct 102 ms 11176 KB Output is correct
98 Correct 107 ms 11176 KB Output is correct
99 Correct 94 ms 11192 KB Output is correct
100 Correct 104 ms 11192 KB Output is correct
101 Correct 95 ms 11160 KB Output is correct
102 Correct 97 ms 11188 KB Output is correct
103 Correct 105 ms 11184 KB Output is correct
104 Correct 95 ms 11176 KB Output is correct
105 Correct 96 ms 11184 KB Output is correct
106 Correct 101 ms 11184 KB Output is correct
107 Correct 109 ms 11192 KB Output is correct
108 Correct 117 ms 11180 KB Output is correct
109 Correct 100 ms 11180 KB Output is correct
110 Correct 96 ms 11180 KB Output is correct
111 Correct 110 ms 11184 KB Output is correct
112 Correct 108 ms 11192 KB Output is correct
113 Correct 103 ms 11180 KB Output is correct
114 Correct 101 ms 11180 KB Output is correct
115 Correct 103 ms 11176 KB Output is correct
116 Correct 323 ms 7744 KB Output is correct
117 Correct 379 ms 7760 KB Output is correct
118 Correct 541 ms 8248 KB Output is correct
119 Correct 667 ms 8276 KB Output is correct
120 Correct 527 ms 8256 KB Output is correct
121 Correct 1006 ms 8632 KB Output is correct
122 Correct 822 ms 8616 KB Output is correct
123 Correct 2239 ms 9376 KB Output is correct
124 Correct 1760 ms 9520 KB Output is correct
125 Correct 1731 ms 9500 KB Output is correct
126 Correct 3632 ms 11320 KB Output is correct
127 Correct 3618 ms 11312 KB Output is correct
128 Correct 3713 ms 11304 KB Output is correct
129 Correct 3640 ms 11324 KB Output is correct
130 Correct 3626 ms 11304 KB Output is correct
131 Correct 3973 ms 11304 KB Output is correct
132 Correct 3959 ms 11308 KB Output is correct
133 Correct 3867 ms 11312 KB Output is correct
134 Correct 3903 ms 11304 KB Output is correct
135 Correct 3785 ms 11312 KB Output is correct
136 Correct 3731 ms 11320 KB Output is correct
137 Correct 3762 ms 11308 KB Output is correct
138 Correct 3724 ms 11312 KB Output is correct
139 Correct 3731 ms 11312 KB Output is correct
140 Correct 3816 ms 11312 KB Output is correct
141 Correct 3723 ms 11300 KB Output is correct
142 Correct 3755 ms 11320 KB Output is correct
143 Correct 3723 ms 11312 KB Output is correct
144 Correct 3699 ms 11320 KB Output is correct
145 Correct 3697 ms 11316 KB Output is correct
146 Correct 3230 ms 11312 KB Output is correct
147 Correct 3174 ms 11312 KB Output is correct
148 Correct 3297 ms 11308 KB Output is correct
149 Correct 3304 ms 11324 KB Output is correct
150 Correct 3281 ms 11320 KB Output is correct
151 Correct 3271 ms 11312 KB Output is correct
152 Correct 3136 ms 11312 KB Output is correct
153 Correct 3368 ms 11312 KB Output is correct
154 Correct 3278 ms 11376 KB Output is correct
155 Correct 3261 ms 11320 KB Output is correct
156 Correct 4334 ms 11304 KB Output is correct
157 Correct 4314 ms 11320 KB Output is correct
158 Correct 4353 ms 11316 KB Output is correct
159 Correct 4242 ms 11320 KB Output is correct
160 Correct 4321 ms 11316 KB Output is correct
161 Correct 3827 ms 11312 KB Output is correct
162 Correct 3877 ms 11312 KB Output is correct
163 Correct 3761 ms 11308 KB Output is correct
164 Correct 3822 ms 11312 KB Output is correct
165 Correct 3829 ms 11320 KB Output is correct
166 Correct 3823 ms 11308 KB Output is correct
167 Correct 3775 ms 11452 KB Output is correct
168 Correct 3765 ms 11304 KB Output is correct
169 Correct 3801 ms 11320 KB Output is correct
170 Correct 3782 ms 11440 KB Output is correct
171 Correct 3502 ms 11320 KB Output is correct
172 Correct 3448 ms 11316 KB Output is correct
173 Correct 3518 ms 11308 KB Output is correct
174 Correct 3495 ms 11324 KB Output is correct
175 Correct 3531 ms 11308 KB Output is correct