답안 #520490

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
520490 2022-01-30T07:19:01 Z KoD Diversity (CEOI21_diversity) C++17
100 / 100
4338 ms 8264 KB
#include <bits/stdc++.h>

using std::vector;
using std::array;
using std::pair;
using std::tuple;

using i64 = std::int64_t;

constexpr int B = 700;
constexpr int MAX = 300000;

constexpr i64 sum_k(const int n) {
    return (i64)n * (n + 1) / 2;
}
 
constexpr i64 sum_k2(const int n) {
    return (i64)n * (n + 1) * (2 * n + 1) / 6;
}

int main() {
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(nullptr);
    int N, Q;
    std::cin >> N >> Q;
    vector<int> A(N);
    for (auto& x : A) {
        std::cin >> x;
        x -= 1;
    }
    vector<vector<int>> query((N + B - 1) / B);
    vector<int> L(Q), R(Q);
    for (int i = 0; i < Q; ++i) {
        std::cin >> L[i] >> R[i];
        L[i] -= 1;
        query[L[i] / B].push_back(i);
    }
    vector<i64> ans(Q);
    vector<int> count(MAX), block(N + 1), nonzero;
    const auto change = [&](const int x, const int c) {
        block[count[x]] -= 1;
        count[x] += c;
        if (count[x] != 0 and block[count[x]] == 0) {
            nonzero.push_back(count[x]);
        }
        block[count[x]] += 1;
    };
    for (auto& qidx : query) {
        if (qidx.empty()) {
            continue;
        }
        std::sort(qidx.begin(), qidx.end(), [&](const int i, const int j) {
            return R[i] < R[j]; 
        });
        std::fill(count.begin(), count.end(), 0);
        std::fill(block.begin(), block.end(), 0);
        nonzero.clear();
        int l = L[qidx[0]], r = L[qidx[0]];
        for (const int q : qidx) {
            while (r < R[q]) {
                change(A[r++], 1);
            }
            while (l > L[q]) {
                change(A[--l], 1);
            }
            while (l < L[q]) {
                change(A[l++], -1);
            }
            std::sort(nonzero.begin(), nonzero.end());
            nonzero.erase(std::unique(nonzero.begin(), nonzero.end()), nonzero.end());
            const int len = R[q] - L[q];
            ans[q] = sum_k(len);
            const auto add_to = [&](const i64 s, const int a, const int n) {
                ans[q] += (n * s + sum_k(n) * a) * len;
                ans[q] -= n * s * s + 2 * s * sum_k(n) * a + sum_k2(n) * a * a;
            };
            int left = 0, right = 0;
            vector<int> next;
            for (const int a : nonzero) {
                const int b = block[a];
                if (b == 0) {
                    continue;
                }
                next.push_back(a);
                if (left > right) {
                    std::swap(left, right);
                }
                const int need = std::min(b, (right - left + a - 1) / a);
                const int to_left = need + (b - need) / 2;
                const int to_right = b - to_left;
                add_to(left, a, to_left);
                add_to(right, a, to_right);
                left += a * to_left;
                right += a * to_right;
            }
            ans[q] -= (i64)left * (len - left);
            nonzero = std::move(next);
        }
    }
    for (const i64 x : ans) {
        std::cout << x << '\n';
    }
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 1484 KB Output is correct
2 Correct 1 ms 1484 KB Output is correct
3 Correct 1 ms 1484 KB Output is correct
4 Correct 1 ms 1484 KB Output is correct
5 Correct 1 ms 1484 KB Output is correct
6 Correct 1 ms 1484 KB Output is correct
7 Correct 1 ms 1484 KB Output is correct
8 Correct 1 ms 1484 KB Output is correct
9 Correct 1 ms 1484 KB Output is correct
10 Correct 1 ms 1484 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 1484 KB Output is correct
2 Correct 1 ms 1484 KB Output is correct
3 Correct 2 ms 1612 KB Output is correct
4 Correct 14 ms 3020 KB Output is correct
5 Correct 28 ms 4184 KB Output is correct
6 Correct 45 ms 5924 KB Output is correct
7 Correct 40 ms 5956 KB Output is correct
8 Correct 42 ms 6012 KB Output is correct
9 Correct 43 ms 5956 KB Output is correct
10 Correct 39 ms 5948 KB Output is correct
11 Correct 41 ms 5968 KB Output is correct
12 Correct 39 ms 5968 KB Output is correct
13 Correct 47 ms 5952 KB Output is correct
14 Correct 39 ms 5956 KB Output is correct
15 Correct 38 ms 5964 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 1484 KB Output is correct
2 Correct 1 ms 1484 KB Output is correct
3 Correct 2 ms 1612 KB Output is correct
4 Correct 14 ms 3020 KB Output is correct
5 Correct 28 ms 4184 KB Output is correct
6 Correct 45 ms 5924 KB Output is correct
7 Correct 40 ms 5956 KB Output is correct
8 Correct 42 ms 6012 KB Output is correct
9 Correct 43 ms 5956 KB Output is correct
10 Correct 39 ms 5948 KB Output is correct
11 Correct 41 ms 5968 KB Output is correct
12 Correct 39 ms 5968 KB Output is correct
13 Correct 47 ms 5952 KB Output is correct
14 Correct 39 ms 5956 KB Output is correct
15 Correct 38 ms 5964 KB Output is correct
16 Correct 1 ms 1484 KB Output is correct
17 Correct 1 ms 1484 KB Output is correct
18 Correct 2 ms 1616 KB Output is correct
19 Correct 13 ms 2892 KB Output is correct
20 Correct 28 ms 4168 KB Output is correct
21 Correct 41 ms 5972 KB Output is correct
22 Correct 39 ms 5956 KB Output is correct
23 Correct 41 ms 5948 KB Output is correct
24 Correct 40 ms 5992 KB Output is correct
25 Correct 39 ms 5964 KB Output is correct
26 Correct 44 ms 5976 KB Output is correct
27 Correct 41 ms 5944 KB Output is correct
28 Correct 45 ms 5968 KB Output is correct
29 Correct 42 ms 5960 KB Output is correct
30 Correct 41 ms 5972 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 1484 KB Output is correct
2 Correct 1 ms 1484 KB Output is correct
3 Correct 2 ms 1612 KB Output is correct
4 Correct 14 ms 3020 KB Output is correct
5 Correct 28 ms 4184 KB Output is correct
6 Correct 45 ms 5924 KB Output is correct
7 Correct 40 ms 5956 KB Output is correct
8 Correct 42 ms 6012 KB Output is correct
9 Correct 43 ms 5956 KB Output is correct
10 Correct 39 ms 5948 KB Output is correct
11 Correct 41 ms 5968 KB Output is correct
12 Correct 39 ms 5968 KB Output is correct
13 Correct 47 ms 5952 KB Output is correct
14 Correct 39 ms 5956 KB Output is correct
15 Correct 38 ms 5964 KB Output is correct
16 Correct 1 ms 1484 KB Output is correct
17 Correct 1 ms 1484 KB Output is correct
18 Correct 2 ms 1616 KB Output is correct
19 Correct 13 ms 2892 KB Output is correct
20 Correct 28 ms 4168 KB Output is correct
21 Correct 41 ms 5972 KB Output is correct
22 Correct 39 ms 5956 KB Output is correct
23 Correct 41 ms 5948 KB Output is correct
24 Correct 40 ms 5992 KB Output is correct
25 Correct 39 ms 5964 KB Output is correct
26 Correct 44 ms 5976 KB Output is correct
27 Correct 41 ms 5944 KB Output is correct
28 Correct 45 ms 5968 KB Output is correct
29 Correct 42 ms 5960 KB Output is correct
30 Correct 41 ms 5972 KB Output is correct
31 Correct 1 ms 1484 KB Output is correct
32 Correct 1 ms 1484 KB Output is correct
33 Correct 1 ms 1484 KB Output is correct
34 Correct 2 ms 1612 KB Output is correct
35 Correct 2 ms 1484 KB Output is correct
36 Correct 1 ms 1484 KB Output is correct
37 Correct 5 ms 1996 KB Output is correct
38 Correct 4 ms 1868 KB Output is correct
39 Correct 11 ms 2380 KB Output is correct
40 Correct 18 ms 3408 KB Output is correct
41 Correct 29 ms 4428 KB Output is correct
42 Correct 28 ms 4440 KB Output is correct
43 Correct 28 ms 4432 KB Output is correct
44 Correct 29 ms 4428 KB Output is correct
45 Correct 26 ms 4448 KB Output is correct
46 Correct 27 ms 4424 KB Output is correct
47 Correct 26 ms 4428 KB Output is correct
48 Correct 29 ms 4572 KB Output is correct
49 Correct 28 ms 4428 KB Output is correct
50 Correct 28 ms 4444 KB Output is correct
51 Correct 29 ms 4436 KB Output is correct
52 Correct 27 ms 4440 KB Output is correct
53 Correct 28 ms 4468 KB Output is correct
54 Correct 26 ms 4436 KB Output is correct
55 Correct 27 ms 4436 KB Output is correct
56 Correct 27 ms 4472 KB Output is correct
57 Correct 27 ms 4436 KB Output is correct
58 Correct 27 ms 4444 KB Output is correct
59 Correct 30 ms 4420 KB Output is correct
60 Correct 27 ms 4428 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 1484 KB Output is correct
2 Correct 1 ms 1484 KB Output is correct
3 Correct 1 ms 1484 KB Output is correct
4 Correct 1 ms 1484 KB Output is correct
5 Correct 1 ms 1484 KB Output is correct
6 Correct 1 ms 1484 KB Output is correct
7 Correct 1 ms 1484 KB Output is correct
8 Correct 1 ms 1484 KB Output is correct
9 Correct 1 ms 1484 KB Output is correct
10 Correct 1 ms 1484 KB Output is correct
11 Correct 1 ms 1484 KB Output is correct
12 Correct 1 ms 1484 KB Output is correct
13 Correct 2 ms 1612 KB Output is correct
14 Correct 14 ms 3020 KB Output is correct
15 Correct 28 ms 4184 KB Output is correct
16 Correct 45 ms 5924 KB Output is correct
17 Correct 40 ms 5956 KB Output is correct
18 Correct 42 ms 6012 KB Output is correct
19 Correct 43 ms 5956 KB Output is correct
20 Correct 39 ms 5948 KB Output is correct
21 Correct 41 ms 5968 KB Output is correct
22 Correct 39 ms 5968 KB Output is correct
23 Correct 47 ms 5952 KB Output is correct
24 Correct 39 ms 5956 KB Output is correct
25 Correct 38 ms 5964 KB Output is correct
26 Correct 1 ms 1484 KB Output is correct
27 Correct 1 ms 1484 KB Output is correct
28 Correct 2 ms 1616 KB Output is correct
29 Correct 13 ms 2892 KB Output is correct
30 Correct 28 ms 4168 KB Output is correct
31 Correct 41 ms 5972 KB Output is correct
32 Correct 39 ms 5956 KB Output is correct
33 Correct 41 ms 5948 KB Output is correct
34 Correct 40 ms 5992 KB Output is correct
35 Correct 39 ms 5964 KB Output is correct
36 Correct 44 ms 5976 KB Output is correct
37 Correct 41 ms 5944 KB Output is correct
38 Correct 45 ms 5968 KB Output is correct
39 Correct 42 ms 5960 KB Output is correct
40 Correct 41 ms 5972 KB Output is correct
41 Correct 1 ms 1484 KB Output is correct
42 Correct 1 ms 1484 KB Output is correct
43 Correct 1 ms 1484 KB Output is correct
44 Correct 2 ms 1612 KB Output is correct
45 Correct 2 ms 1484 KB Output is correct
46 Correct 1 ms 1484 KB Output is correct
47 Correct 5 ms 1996 KB Output is correct
48 Correct 4 ms 1868 KB Output is correct
49 Correct 11 ms 2380 KB Output is correct
50 Correct 18 ms 3408 KB Output is correct
51 Correct 29 ms 4428 KB Output is correct
52 Correct 28 ms 4440 KB Output is correct
53 Correct 28 ms 4432 KB Output is correct
54 Correct 29 ms 4428 KB Output is correct
55 Correct 26 ms 4448 KB Output is correct
56 Correct 27 ms 4424 KB Output is correct
57 Correct 26 ms 4428 KB Output is correct
58 Correct 29 ms 4572 KB Output is correct
59 Correct 28 ms 4428 KB Output is correct
60 Correct 28 ms 4444 KB Output is correct
61 Correct 29 ms 4436 KB Output is correct
62 Correct 27 ms 4440 KB Output is correct
63 Correct 28 ms 4468 KB Output is correct
64 Correct 26 ms 4436 KB Output is correct
65 Correct 27 ms 4436 KB Output is correct
66 Correct 27 ms 4472 KB Output is correct
67 Correct 27 ms 4436 KB Output is correct
68 Correct 27 ms 4444 KB Output is correct
69 Correct 30 ms 4420 KB Output is correct
70 Correct 27 ms 4428 KB Output is correct
71 Correct 5 ms 1868 KB Output is correct
72 Correct 4 ms 1868 KB Output is correct
73 Correct 5 ms 1868 KB Output is correct
74 Correct 5 ms 1868 KB Output is correct
75 Correct 5 ms 1868 KB Output is correct
76 Correct 11 ms 2252 KB Output is correct
77 Correct 12 ms 2252 KB Output is correct
78 Correct 12 ms 2188 KB Output is correct
79 Correct 11 ms 2296 KB Output is correct
80 Correct 8 ms 2252 KB Output is correct
81 Correct 16 ms 3028 KB Output is correct
82 Correct 16 ms 3020 KB Output is correct
83 Correct 17 ms 3032 KB Output is correct
84 Correct 16 ms 3076 KB Output is correct
85 Correct 16 ms 3032 KB Output is correct
86 Correct 21 ms 3024 KB Output is correct
87 Correct 19 ms 3032 KB Output is correct
88 Correct 19 ms 3024 KB Output is correct
89 Correct 24 ms 3020 KB Output is correct
90 Correct 17 ms 3020 KB Output is correct
91 Correct 25 ms 3804 KB Output is correct
92 Correct 26 ms 3788 KB Output is correct
93 Correct 25 ms 3796 KB Output is correct
94 Correct 31 ms 3808 KB Output is correct
95 Correct 31 ms 3796 KB Output is correct
96 Correct 32 ms 3788 KB Output is correct
97 Correct 30 ms 3800 KB Output is correct
98 Correct 30 ms 3796 KB Output is correct
99 Correct 30 ms 3792 KB Output is correct
100 Correct 29 ms 3800 KB Output is correct
101 Correct 29 ms 3788 KB Output is correct
102 Correct 32 ms 3788 KB Output is correct
103 Correct 29 ms 3796 KB Output is correct
104 Correct 35 ms 3788 KB Output is correct
105 Correct 34 ms 3796 KB Output is correct
106 Correct 30 ms 3800 KB Output is correct
107 Correct 29 ms 3808 KB Output is correct
108 Correct 29 ms 3804 KB Output is correct
109 Correct 29 ms 3812 KB Output is correct
110 Correct 29 ms 3796 KB Output is correct
111 Correct 30 ms 3800 KB Output is correct
112 Correct 29 ms 3804 KB Output is correct
113 Correct 30 ms 3804 KB Output is correct
114 Correct 42 ms 3844 KB Output is correct
115 Correct 33 ms 3780 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 1484 KB Output is correct
2 Correct 1 ms 1484 KB Output is correct
3 Correct 1 ms 1484 KB Output is correct
4 Correct 1 ms 1484 KB Output is correct
5 Correct 1 ms 1484 KB Output is correct
6 Correct 1 ms 1484 KB Output is correct
7 Correct 1 ms 1484 KB Output is correct
8 Correct 1 ms 1484 KB Output is correct
9 Correct 1 ms 1484 KB Output is correct
10 Correct 1 ms 1484 KB Output is correct
11 Correct 1 ms 1484 KB Output is correct
12 Correct 1 ms 1484 KB Output is correct
13 Correct 2 ms 1612 KB Output is correct
14 Correct 14 ms 3020 KB Output is correct
15 Correct 28 ms 4184 KB Output is correct
16 Correct 45 ms 5924 KB Output is correct
17 Correct 40 ms 5956 KB Output is correct
18 Correct 42 ms 6012 KB Output is correct
19 Correct 43 ms 5956 KB Output is correct
20 Correct 39 ms 5948 KB Output is correct
21 Correct 41 ms 5968 KB Output is correct
22 Correct 39 ms 5968 KB Output is correct
23 Correct 47 ms 5952 KB Output is correct
24 Correct 39 ms 5956 KB Output is correct
25 Correct 38 ms 5964 KB Output is correct
26 Correct 1 ms 1484 KB Output is correct
27 Correct 1 ms 1484 KB Output is correct
28 Correct 2 ms 1616 KB Output is correct
29 Correct 13 ms 2892 KB Output is correct
30 Correct 28 ms 4168 KB Output is correct
31 Correct 41 ms 5972 KB Output is correct
32 Correct 39 ms 5956 KB Output is correct
33 Correct 41 ms 5948 KB Output is correct
34 Correct 40 ms 5992 KB Output is correct
35 Correct 39 ms 5964 KB Output is correct
36 Correct 44 ms 5976 KB Output is correct
37 Correct 41 ms 5944 KB Output is correct
38 Correct 45 ms 5968 KB Output is correct
39 Correct 42 ms 5960 KB Output is correct
40 Correct 41 ms 5972 KB Output is correct
41 Correct 1 ms 1484 KB Output is correct
42 Correct 1 ms 1484 KB Output is correct
43 Correct 1 ms 1484 KB Output is correct
44 Correct 2 ms 1612 KB Output is correct
45 Correct 2 ms 1484 KB Output is correct
46 Correct 1 ms 1484 KB Output is correct
47 Correct 5 ms 1996 KB Output is correct
48 Correct 4 ms 1868 KB Output is correct
49 Correct 11 ms 2380 KB Output is correct
50 Correct 18 ms 3408 KB Output is correct
51 Correct 29 ms 4428 KB Output is correct
52 Correct 28 ms 4440 KB Output is correct
53 Correct 28 ms 4432 KB Output is correct
54 Correct 29 ms 4428 KB Output is correct
55 Correct 26 ms 4448 KB Output is correct
56 Correct 27 ms 4424 KB Output is correct
57 Correct 26 ms 4428 KB Output is correct
58 Correct 29 ms 4572 KB Output is correct
59 Correct 28 ms 4428 KB Output is correct
60 Correct 28 ms 4444 KB Output is correct
61 Correct 29 ms 4436 KB Output is correct
62 Correct 27 ms 4440 KB Output is correct
63 Correct 28 ms 4468 KB Output is correct
64 Correct 26 ms 4436 KB Output is correct
65 Correct 27 ms 4436 KB Output is correct
66 Correct 27 ms 4472 KB Output is correct
67 Correct 27 ms 4436 KB Output is correct
68 Correct 27 ms 4444 KB Output is correct
69 Correct 30 ms 4420 KB Output is correct
70 Correct 27 ms 4428 KB Output is correct
71 Correct 5 ms 1868 KB Output is correct
72 Correct 4 ms 1868 KB Output is correct
73 Correct 5 ms 1868 KB Output is correct
74 Correct 5 ms 1868 KB Output is correct
75 Correct 5 ms 1868 KB Output is correct
76 Correct 11 ms 2252 KB Output is correct
77 Correct 12 ms 2252 KB Output is correct
78 Correct 12 ms 2188 KB Output is correct
79 Correct 11 ms 2296 KB Output is correct
80 Correct 8 ms 2252 KB Output is correct
81 Correct 16 ms 3028 KB Output is correct
82 Correct 16 ms 3020 KB Output is correct
83 Correct 17 ms 3032 KB Output is correct
84 Correct 16 ms 3076 KB Output is correct
85 Correct 16 ms 3032 KB Output is correct
86 Correct 21 ms 3024 KB Output is correct
87 Correct 19 ms 3032 KB Output is correct
88 Correct 19 ms 3024 KB Output is correct
89 Correct 24 ms 3020 KB Output is correct
90 Correct 17 ms 3020 KB Output is correct
91 Correct 25 ms 3804 KB Output is correct
92 Correct 26 ms 3788 KB Output is correct
93 Correct 25 ms 3796 KB Output is correct
94 Correct 31 ms 3808 KB Output is correct
95 Correct 31 ms 3796 KB Output is correct
96 Correct 32 ms 3788 KB Output is correct
97 Correct 30 ms 3800 KB Output is correct
98 Correct 30 ms 3796 KB Output is correct
99 Correct 30 ms 3792 KB Output is correct
100 Correct 29 ms 3800 KB Output is correct
101 Correct 29 ms 3788 KB Output is correct
102 Correct 32 ms 3788 KB Output is correct
103 Correct 29 ms 3796 KB Output is correct
104 Correct 35 ms 3788 KB Output is correct
105 Correct 34 ms 3796 KB Output is correct
106 Correct 30 ms 3800 KB Output is correct
107 Correct 29 ms 3808 KB Output is correct
108 Correct 29 ms 3804 KB Output is correct
109 Correct 29 ms 3812 KB Output is correct
110 Correct 29 ms 3796 KB Output is correct
111 Correct 30 ms 3800 KB Output is correct
112 Correct 29 ms 3804 KB Output is correct
113 Correct 30 ms 3804 KB Output is correct
114 Correct 42 ms 3844 KB Output is correct
115 Correct 33 ms 3780 KB Output is correct
116 Correct 586 ms 3056 KB Output is correct
117 Correct 515 ms 3052 KB Output is correct
118 Correct 843 ms 3656 KB Output is correct
119 Correct 515 ms 3520 KB Output is correct
120 Correct 339 ms 3504 KB Output is correct
121 Correct 615 ms 3940 KB Output is correct
122 Correct 446 ms 4036 KB Output is correct
123 Correct 1387 ms 4872 KB Output is correct
124 Correct 685 ms 4860 KB Output is correct
125 Correct 577 ms 4876 KB Output is correct
126 Correct 4338 ms 5736 KB Output is correct
127 Correct 4190 ms 7392 KB Output is correct
128 Correct 4192 ms 7324 KB Output is correct
129 Correct 4146 ms 7332 KB Output is correct
130 Correct 4148 ms 7300 KB Output is correct
131 Correct 3667 ms 7492 KB Output is correct
132 Correct 3602 ms 7600 KB Output is correct
133 Correct 3852 ms 7480 KB Output is correct
134 Correct 3726 ms 7552 KB Output is correct
135 Correct 3741 ms 7580 KB Output is correct
136 Correct 3621 ms 7596 KB Output is correct
137 Correct 3783 ms 7504 KB Output is correct
138 Correct 3670 ms 7444 KB Output is correct
139 Correct 3785 ms 7480 KB Output is correct
140 Correct 3633 ms 7408 KB Output is correct
141 Correct 2592 ms 7472 KB Output is correct
142 Correct 2628 ms 7468 KB Output is correct
143 Correct 2586 ms 7468 KB Output is correct
144 Correct 2520 ms 7456 KB Output is correct
145 Correct 2508 ms 7492 KB Output is correct
146 Correct 1125 ms 7688 KB Output is correct
147 Correct 1113 ms 7724 KB Output is correct
148 Correct 1138 ms 7744 KB Output is correct
149 Correct 1115 ms 7748 KB Output is correct
150 Correct 1131 ms 7672 KB Output is correct
151 Correct 1029 ms 7732 KB Output is correct
152 Correct 1024 ms 7716 KB Output is correct
153 Correct 1040 ms 7692 KB Output is correct
154 Correct 1029 ms 7748 KB Output is correct
155 Correct 1014 ms 7748 KB Output is correct
156 Correct 2387 ms 8040 KB Output is correct
157 Correct 2346 ms 8256 KB Output is correct
158 Correct 2356 ms 8008 KB Output is correct
159 Correct 2342 ms 8144 KB Output is correct
160 Correct 2312 ms 8144 KB Output is correct
161 Correct 2466 ms 8256 KB Output is correct
162 Correct 2445 ms 8164 KB Output is correct
163 Correct 2448 ms 8264 KB Output is correct
164 Correct 2449 ms 8144 KB Output is correct
165 Correct 2477 ms 8140 KB Output is correct
166 Correct 3401 ms 8008 KB Output is correct
167 Correct 3396 ms 7920 KB Output is correct
168 Correct 3443 ms 7964 KB Output is correct
169 Correct 3437 ms 8036 KB Output is correct
170 Correct 3423 ms 7864 KB Output is correct
171 Correct 4099 ms 7920 KB Output is correct
172 Correct 4070 ms 8000 KB Output is correct
173 Correct 4080 ms 8044 KB Output is correct
174 Correct 4234 ms 7920 KB Output is correct
175 Correct 4224 ms 7928 KB Output is correct