답안 #622370

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
622370 2022-08-04T08:22:49 Z Joshc Diversity (CEOI21_diversity) C++11
100 / 100
3676 ms 6560 KB
#include <bits/stdc++.h>
using namespace std;
 
#define scan(x) do{while((x=getchar())<'0'); for(x-='0'; '0'<=(_=getchar()); x=(x<<3)+(x<<1)+_-'0');}while(0)
char _;
 
#define ll long long
 
int cnt[300005], a[300005], l[300005], r[300005];
ll n, out[50005];
const int SQRT = 900;
 
ll f(ll a, ll b, ll x) {
    // sum((a+bi) choose 2) with x terms
    return x*a*a + a*b*x*(x-1) + x*(x-1)*(2*x-1)/6*b*b - (2*a+b*(x-1))*x/2;
}
 
ll val(ll start, ll sz, ll num) {
    // We have num blocks of size sz, starting at position start
    // What is the total contribution?
    if (!num || !sz) return 0;
    ll res = n*(n+1)*num;
    res -= f(start, sz, num);
    res -= f(n-(start+sz*num-1)+1, sz, num);
    return res/2;
}
 
bool comp(int x, int y) {
    int p = l[x]/SQRT, q = l[y]/SQRT;
    if (p != q) return p < q;
    return p&1 ? (r[x] < r[y]) : (r[x] > r[y]);
}
 
vector<int> s;
bool included[300005];
int freq[300005], v[300005];
 
void add(int x) {
    if (freq[x] && !--v[freq[x]]) included[freq[x]] = false;
    v[++freq[x]]++;
    if (!included[freq[x]]) {
        included[freq[x]] = true;
        s.push_back(freq[x]);
    }
}
 
void remove(int x) {
    if (!--v[freq[x]]) included[freq[x]] = false;
    v[--freq[x]]++;
    if (!included[freq[x]]) {
        included[freq[x]] = true;
        s.push_back(freq[x]);
    }
}
 
ll solve() {
    ll ans = 0;
    int lsum = 0, rsum = 0;
    sort(s.begin(), s.end());
    vector<int> cur;
    for (int sz : s) {
        if (!included[sz]) continue;
        included[sz] = false;
        cur.push_back(sz);
        int num = v[sz];
        int lv = 0, rv = 0;
        if (lsum < rsum) {
            lv = num-num/2;
            rv = num/2;
        } else {
            rv = num-num/2;
            lv = num/2;
        }
        ans += val(lsum+1, sz, lv) + val(rsum+1, sz, rv);
        lsum += sz*lv;
        rsum += sz*rv;
    }
    s = cur;
    for (int i : s) included[i] = true;
    return ans;
}
 
int main() {
    int q, x;
    scan(n);
    scan(q);
    vector<int> order;
    for (int i=1; i<=n; i++) scan(a[i]);
    for (int i=1; i<=q; i++) {
        scan(l[i]);
        scan(r[i]);
        order.push_back(i);
    }
    sort(order.begin(), order.end(), comp);
    
    int L = 1, R = 0;
 
    for (int i : order) {
        while (R < r[i]) add(a[++R]);
        while (L > l[i]) add(a[--L]);
        while (R > r[i]) remove(a[R--]);
        while (L < l[i]) remove(a[L++]);
        n = R-L+1;
        out[i] = solve();
    }
 
    for (int i=1; i<=q; i++) printf("%lld\n", out[i]);
}

Compilation message

diversity.cpp: In function 'int main()':
diversity.cpp:84:12: warning: unused variable 'x' [-Wunused-variable]
   84 |     int q, x;
      |            ^
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 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 312 KB Output is correct
7 Correct 0 ms 340 KB Output is correct
8 Correct 0 ms 340 KB Output is correct
9 Correct 0 ms 340 KB Output is correct
10 Correct 0 ms 316 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 2 ms 468 KB Output is correct
4 Correct 9 ms 1616 KB Output is correct
5 Correct 20 ms 2892 KB Output is correct
6 Correct 29 ms 4552 KB Output is correct
7 Correct 30 ms 4936 KB Output is correct
8 Correct 27 ms 4552 KB Output is correct
9 Correct 29 ms 4552 KB Output is correct
10 Correct 28 ms 4708 KB Output is correct
11 Correct 31 ms 4532 KB Output is correct
12 Correct 30 ms 4524 KB Output is correct
13 Correct 29 ms 4552 KB Output is correct
14 Correct 28 ms 4580 KB Output is correct
15 Correct 31 ms 4592 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 2 ms 468 KB Output is correct
4 Correct 9 ms 1616 KB Output is correct
5 Correct 20 ms 2892 KB Output is correct
6 Correct 29 ms 4552 KB Output is correct
7 Correct 30 ms 4936 KB Output is correct
8 Correct 27 ms 4552 KB Output is correct
9 Correct 29 ms 4552 KB Output is correct
10 Correct 28 ms 4708 KB Output is correct
11 Correct 31 ms 4532 KB Output is correct
12 Correct 30 ms 4524 KB Output is correct
13 Correct 29 ms 4552 KB Output is correct
14 Correct 28 ms 4580 KB Output is correct
15 Correct 31 ms 4592 KB Output is correct
16 Correct 1 ms 340 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 1 ms 468 KB Output is correct
19 Correct 10 ms 1616 KB Output is correct
20 Correct 19 ms 2880 KB Output is correct
21 Correct 36 ms 4672 KB Output is correct
22 Correct 29 ms 4584 KB Output is correct
23 Correct 36 ms 4656 KB Output is correct
24 Correct 31 ms 4552 KB Output is correct
25 Correct 31 ms 4552 KB Output is correct
26 Correct 29 ms 4572 KB Output is correct
27 Correct 29 ms 4676 KB Output is correct
28 Correct 29 ms 4680 KB Output is correct
29 Correct 28 ms 4588 KB Output is correct
30 Correct 30 ms 4584 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 2 ms 468 KB Output is correct
4 Correct 9 ms 1616 KB Output is correct
5 Correct 20 ms 2892 KB Output is correct
6 Correct 29 ms 4552 KB Output is correct
7 Correct 30 ms 4936 KB Output is correct
8 Correct 27 ms 4552 KB Output is correct
9 Correct 29 ms 4552 KB Output is correct
10 Correct 28 ms 4708 KB Output is correct
11 Correct 31 ms 4532 KB Output is correct
12 Correct 30 ms 4524 KB Output is correct
13 Correct 29 ms 4552 KB Output is correct
14 Correct 28 ms 4580 KB Output is correct
15 Correct 31 ms 4592 KB Output is correct
16 Correct 1 ms 340 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 1 ms 468 KB Output is correct
19 Correct 10 ms 1616 KB Output is correct
20 Correct 19 ms 2880 KB Output is correct
21 Correct 36 ms 4672 KB Output is correct
22 Correct 29 ms 4584 KB Output is correct
23 Correct 36 ms 4656 KB Output is correct
24 Correct 31 ms 4552 KB Output is correct
25 Correct 31 ms 4552 KB Output is correct
26 Correct 29 ms 4572 KB Output is correct
27 Correct 29 ms 4676 KB Output is correct
28 Correct 29 ms 4680 KB Output is correct
29 Correct 28 ms 4588 KB Output is correct
30 Correct 30 ms 4584 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 316 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 328 KB Output is correct
37 Correct 3 ms 748 KB Output is correct
38 Correct 3 ms 700 KB Output is correct
39 Correct 5 ms 1220 KB Output is correct
40 Correct 10 ms 2212 KB Output is correct
41 Correct 16 ms 3256 KB Output is correct
42 Correct 17 ms 3224 KB Output is correct
43 Correct 19 ms 3240 KB Output is correct
44 Correct 16 ms 3264 KB Output is correct
45 Correct 18 ms 3264 KB Output is correct
46 Correct 17 ms 3244 KB Output is correct
47 Correct 16 ms 3216 KB Output is correct
48 Correct 18 ms 3260 KB Output is correct
49 Correct 16 ms 3236 KB Output is correct
50 Correct 17 ms 3252 KB Output is correct
51 Correct 17 ms 3260 KB Output is correct
52 Correct 16 ms 3248 KB Output is correct
53 Correct 17 ms 3236 KB Output is correct
54 Correct 17 ms 3224 KB Output is correct
55 Correct 16 ms 3232 KB Output is correct
56 Correct 17 ms 3236 KB Output is correct
57 Correct 16 ms 3216 KB Output is correct
58 Correct 16 ms 3216 KB Output is correct
59 Correct 17 ms 3292 KB Output is correct
60 Correct 17 ms 3280 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 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 312 KB Output is correct
7 Correct 0 ms 340 KB Output is correct
8 Correct 0 ms 340 KB Output is correct
9 Correct 0 ms 340 KB Output is correct
10 Correct 0 ms 316 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 2 ms 468 KB Output is correct
14 Correct 9 ms 1616 KB Output is correct
15 Correct 20 ms 2892 KB Output is correct
16 Correct 29 ms 4552 KB Output is correct
17 Correct 30 ms 4936 KB Output is correct
18 Correct 27 ms 4552 KB Output is correct
19 Correct 29 ms 4552 KB Output is correct
20 Correct 28 ms 4708 KB Output is correct
21 Correct 31 ms 4532 KB Output is correct
22 Correct 30 ms 4524 KB Output is correct
23 Correct 29 ms 4552 KB Output is correct
24 Correct 28 ms 4580 KB Output is correct
25 Correct 31 ms 4592 KB Output is correct
26 Correct 1 ms 340 KB Output is correct
27 Correct 1 ms 340 KB Output is correct
28 Correct 1 ms 468 KB Output is correct
29 Correct 10 ms 1616 KB Output is correct
30 Correct 19 ms 2880 KB Output is correct
31 Correct 36 ms 4672 KB Output is correct
32 Correct 29 ms 4584 KB Output is correct
33 Correct 36 ms 4656 KB Output is correct
34 Correct 31 ms 4552 KB Output is correct
35 Correct 31 ms 4552 KB Output is correct
36 Correct 29 ms 4572 KB Output is correct
37 Correct 29 ms 4676 KB Output is correct
38 Correct 29 ms 4680 KB Output is correct
39 Correct 28 ms 4588 KB Output is correct
40 Correct 30 ms 4584 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 316 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 328 KB Output is correct
47 Correct 3 ms 748 KB Output is correct
48 Correct 3 ms 700 KB Output is correct
49 Correct 5 ms 1220 KB Output is correct
50 Correct 10 ms 2212 KB Output is correct
51 Correct 16 ms 3256 KB Output is correct
52 Correct 17 ms 3224 KB Output is correct
53 Correct 19 ms 3240 KB Output is correct
54 Correct 16 ms 3264 KB Output is correct
55 Correct 18 ms 3264 KB Output is correct
56 Correct 17 ms 3244 KB Output is correct
57 Correct 16 ms 3216 KB Output is correct
58 Correct 18 ms 3260 KB Output is correct
59 Correct 16 ms 3236 KB Output is correct
60 Correct 17 ms 3252 KB Output is correct
61 Correct 17 ms 3260 KB Output is correct
62 Correct 16 ms 3248 KB Output is correct
63 Correct 17 ms 3236 KB Output is correct
64 Correct 17 ms 3224 KB Output is correct
65 Correct 16 ms 3232 KB Output is correct
66 Correct 17 ms 3236 KB Output is correct
67 Correct 16 ms 3216 KB Output is correct
68 Correct 16 ms 3216 KB Output is correct
69 Correct 17 ms 3292 KB Output is correct
70 Correct 17 ms 3280 KB Output is correct
71 Correct 3 ms 708 KB Output is correct
72 Correct 3 ms 724 KB Output is correct
73 Correct 3 ms 708 KB Output is correct
74 Correct 2 ms 712 KB Output is correct
75 Correct 3 ms 700 KB Output is correct
76 Correct 6 ms 1164 KB Output is correct
77 Correct 4 ms 1236 KB Output is correct
78 Correct 4 ms 1224 KB Output is correct
79 Correct 5 ms 1220 KB Output is correct
80 Correct 4 ms 1212 KB Output is correct
81 Correct 9 ms 2256 KB Output is correct
82 Correct 8 ms 2092 KB Output is correct
83 Correct 8 ms 2104 KB Output is correct
84 Correct 8 ms 1996 KB Output is correct
85 Correct 8 ms 2120 KB Output is correct
86 Correct 9 ms 2228 KB Output is correct
87 Correct 11 ms 2152 KB Output is correct
88 Correct 13 ms 2228 KB Output is correct
89 Correct 10 ms 2260 KB Output is correct
90 Correct 9 ms 2204 KB Output is correct
91 Correct 15 ms 3532 KB Output is correct
92 Correct 14 ms 3488 KB Output is correct
93 Correct 15 ms 3608 KB Output is correct
94 Correct 16 ms 3628 KB Output is correct
95 Correct 15 ms 3620 KB Output is correct
96 Correct 20 ms 4048 KB Output is correct
97 Correct 18 ms 4200 KB Output is correct
98 Correct 20 ms 4056 KB Output is correct
99 Correct 18 ms 4064 KB Output is correct
100 Correct 19 ms 4192 KB Output is correct
101 Correct 18 ms 4084 KB Output is correct
102 Correct 18 ms 4300 KB Output is correct
103 Correct 18 ms 4144 KB Output is correct
104 Correct 18 ms 4160 KB Output is correct
105 Correct 19 ms 4140 KB Output is correct
106 Correct 17 ms 4300 KB Output is correct
107 Correct 18 ms 4380 KB Output is correct
108 Correct 17 ms 4300 KB Output is correct
109 Correct 18 ms 4328 KB Output is correct
110 Correct 19 ms 4304 KB Output is correct
111 Correct 18 ms 4300 KB Output is correct
112 Correct 17 ms 4468 KB Output is correct
113 Correct 19 ms 4468 KB Output is correct
114 Correct 18 ms 4300 KB Output is correct
115 Correct 19 ms 4308 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 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 312 KB Output is correct
7 Correct 0 ms 340 KB Output is correct
8 Correct 0 ms 340 KB Output is correct
9 Correct 0 ms 340 KB Output is correct
10 Correct 0 ms 316 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 2 ms 468 KB Output is correct
14 Correct 9 ms 1616 KB Output is correct
15 Correct 20 ms 2892 KB Output is correct
16 Correct 29 ms 4552 KB Output is correct
17 Correct 30 ms 4936 KB Output is correct
18 Correct 27 ms 4552 KB Output is correct
19 Correct 29 ms 4552 KB Output is correct
20 Correct 28 ms 4708 KB Output is correct
21 Correct 31 ms 4532 KB Output is correct
22 Correct 30 ms 4524 KB Output is correct
23 Correct 29 ms 4552 KB Output is correct
24 Correct 28 ms 4580 KB Output is correct
25 Correct 31 ms 4592 KB Output is correct
26 Correct 1 ms 340 KB Output is correct
27 Correct 1 ms 340 KB Output is correct
28 Correct 1 ms 468 KB Output is correct
29 Correct 10 ms 1616 KB Output is correct
30 Correct 19 ms 2880 KB Output is correct
31 Correct 36 ms 4672 KB Output is correct
32 Correct 29 ms 4584 KB Output is correct
33 Correct 36 ms 4656 KB Output is correct
34 Correct 31 ms 4552 KB Output is correct
35 Correct 31 ms 4552 KB Output is correct
36 Correct 29 ms 4572 KB Output is correct
37 Correct 29 ms 4676 KB Output is correct
38 Correct 29 ms 4680 KB Output is correct
39 Correct 28 ms 4588 KB Output is correct
40 Correct 30 ms 4584 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 316 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 328 KB Output is correct
47 Correct 3 ms 748 KB Output is correct
48 Correct 3 ms 700 KB Output is correct
49 Correct 5 ms 1220 KB Output is correct
50 Correct 10 ms 2212 KB Output is correct
51 Correct 16 ms 3256 KB Output is correct
52 Correct 17 ms 3224 KB Output is correct
53 Correct 19 ms 3240 KB Output is correct
54 Correct 16 ms 3264 KB Output is correct
55 Correct 18 ms 3264 KB Output is correct
56 Correct 17 ms 3244 KB Output is correct
57 Correct 16 ms 3216 KB Output is correct
58 Correct 18 ms 3260 KB Output is correct
59 Correct 16 ms 3236 KB Output is correct
60 Correct 17 ms 3252 KB Output is correct
61 Correct 17 ms 3260 KB Output is correct
62 Correct 16 ms 3248 KB Output is correct
63 Correct 17 ms 3236 KB Output is correct
64 Correct 17 ms 3224 KB Output is correct
65 Correct 16 ms 3232 KB Output is correct
66 Correct 17 ms 3236 KB Output is correct
67 Correct 16 ms 3216 KB Output is correct
68 Correct 16 ms 3216 KB Output is correct
69 Correct 17 ms 3292 KB Output is correct
70 Correct 17 ms 3280 KB Output is correct
71 Correct 3 ms 708 KB Output is correct
72 Correct 3 ms 724 KB Output is correct
73 Correct 3 ms 708 KB Output is correct
74 Correct 2 ms 712 KB Output is correct
75 Correct 3 ms 700 KB Output is correct
76 Correct 6 ms 1164 KB Output is correct
77 Correct 4 ms 1236 KB Output is correct
78 Correct 4 ms 1224 KB Output is correct
79 Correct 5 ms 1220 KB Output is correct
80 Correct 4 ms 1212 KB Output is correct
81 Correct 9 ms 2256 KB Output is correct
82 Correct 8 ms 2092 KB Output is correct
83 Correct 8 ms 2104 KB Output is correct
84 Correct 8 ms 1996 KB Output is correct
85 Correct 8 ms 2120 KB Output is correct
86 Correct 9 ms 2228 KB Output is correct
87 Correct 11 ms 2152 KB Output is correct
88 Correct 13 ms 2228 KB Output is correct
89 Correct 10 ms 2260 KB Output is correct
90 Correct 9 ms 2204 KB Output is correct
91 Correct 15 ms 3532 KB Output is correct
92 Correct 14 ms 3488 KB Output is correct
93 Correct 15 ms 3608 KB Output is correct
94 Correct 16 ms 3628 KB Output is correct
95 Correct 15 ms 3620 KB Output is correct
96 Correct 20 ms 4048 KB Output is correct
97 Correct 18 ms 4200 KB Output is correct
98 Correct 20 ms 4056 KB Output is correct
99 Correct 18 ms 4064 KB Output is correct
100 Correct 19 ms 4192 KB Output is correct
101 Correct 18 ms 4084 KB Output is correct
102 Correct 18 ms 4300 KB Output is correct
103 Correct 18 ms 4144 KB Output is correct
104 Correct 18 ms 4160 KB Output is correct
105 Correct 19 ms 4140 KB Output is correct
106 Correct 17 ms 4300 KB Output is correct
107 Correct 18 ms 4380 KB Output is correct
108 Correct 17 ms 4300 KB Output is correct
109 Correct 18 ms 4328 KB Output is correct
110 Correct 19 ms 4304 KB Output is correct
111 Correct 18 ms 4300 KB Output is correct
112 Correct 17 ms 4468 KB Output is correct
113 Correct 19 ms 4468 KB Output is correct
114 Correct 18 ms 4300 KB Output is correct
115 Correct 19 ms 4308 KB Output is correct
116 Correct 724 ms 2368 KB Output is correct
117 Correct 606 ms 2368 KB Output is correct
118 Correct 928 ms 3036 KB Output is correct
119 Correct 567 ms 2900 KB Output is correct
120 Correct 367 ms 2908 KB Output is correct
121 Correct 622 ms 3380 KB Output is correct
122 Correct 397 ms 3400 KB Output is correct
123 Correct 1268 ms 4360 KB Output is correct
124 Correct 496 ms 4448 KB Output is correct
125 Correct 406 ms 4484 KB Output is correct
126 Correct 3614 ms 5956 KB Output is correct
127 Correct 3608 ms 5816 KB Output is correct
128 Correct 3571 ms 5824 KB Output is correct
129 Correct 3598 ms 5808 KB Output is correct
130 Correct 3600 ms 5804 KB Output is correct
131 Correct 3239 ms 5680 KB Output is correct
132 Correct 3213 ms 5640 KB Output is correct
133 Correct 3362 ms 5676 KB Output is correct
134 Correct 3255 ms 5652 KB Output is correct
135 Correct 3207 ms 5908 KB Output is correct
136 Correct 3108 ms 5772 KB Output is correct
137 Correct 3281 ms 5684 KB Output is correct
138 Correct 3138 ms 5628 KB Output is correct
139 Correct 3230 ms 5812 KB Output is correct
140 Correct 3162 ms 5768 KB Output is correct
141 Correct 2149 ms 5412 KB Output is correct
142 Correct 2214 ms 5472 KB Output is correct
143 Correct 2264 ms 5464 KB Output is correct
144 Correct 2210 ms 5460 KB Output is correct
145 Correct 2207 ms 5456 KB Output is correct
146 Correct 786 ms 5328 KB Output is correct
147 Correct 774 ms 5328 KB Output is correct
148 Correct 800 ms 5324 KB Output is correct
149 Correct 778 ms 5340 KB Output is correct
150 Correct 785 ms 5324 KB Output is correct
151 Correct 670 ms 5380 KB Output is correct
152 Correct 668 ms 5376 KB Output is correct
153 Correct 690 ms 5372 KB Output is correct
154 Correct 662 ms 5368 KB Output is correct
155 Correct 655 ms 5384 KB Output is correct
156 Correct 1936 ms 6316 KB Output is correct
157 Correct 1936 ms 6344 KB Output is correct
158 Correct 2031 ms 6252 KB Output is correct
159 Correct 1950 ms 6256 KB Output is correct
160 Correct 2069 ms 6264 KB Output is correct
161 Correct 2033 ms 6548 KB Output is correct
162 Correct 2180 ms 6472 KB Output is correct
163 Correct 2121 ms 6440 KB Output is correct
164 Correct 2105 ms 6460 KB Output is correct
165 Correct 1959 ms 6424 KB Output is correct
166 Correct 2979 ms 6292 KB Output is correct
167 Correct 3038 ms 6256 KB Output is correct
168 Correct 2989 ms 6252 KB Output is correct
169 Correct 3036 ms 6308 KB Output is correct
170 Correct 2986 ms 6280 KB Output is correct
171 Correct 3671 ms 6460 KB Output is correct
172 Correct 3648 ms 6560 KB Output is correct
173 Correct 3662 ms 6456 KB Output is correct
174 Correct 3580 ms 6460 KB Output is correct
175 Correct 3676 ms 6488 KB Output is correct