# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
520463 |
2022-01-30T05:36:47 Z |
KoD |
Diversity (CEOI21_diversity) |
C++17 |
|
2739 ms |
144232 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 = 1000;
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;
}
const int G = N / B;
vector precalc(G, vector<vector<pair<int, int>>>(G + 1));
for (int lc = 0; lc < G; ++lc) {
vector<char> appear(MAX);
vector<int> count(MAX);
for (int rc = lc + 1; rc <= G; ++rc) {
vector<int> remove, add;
for (int i = B * (rc - 1); i < B * rc; ++i) {
if (!appear[A[i]]) {
appear[A[i]] = true;
if (count[A[i]] > 0) {
remove.push_back(count[A[i]]);
}
add.push_back(A[i]);
}
count[A[i]] += 1;
}
for (auto& x : add) {
appear[x] = false;
x = count[x];
}
std::sort(remove.begin(), remove.end());
std::sort(add.begin(), add.end());
const auto& read = precalc[lc][rc - 1];
auto& write = precalc[lc][rc];
const int A = read.size(), B = remove.size(), C = add.size();
int i = 0, j = 0, k = 0;
while (i < A or k < C) {
int val = MAX;
if (i < A) {
val = std::min(val, read[i].first);
}
if (k < C) {
val = std::min(val, add[k]);
}
int cnt = 0;
if (i < A and val == read[i].first) {
cnt += read[i].second;
i += 1;
}
while (j < B and val == remove[j]) {
j += 1;
cnt -= 1;
}
while (k < C and val == add[k]) {
k += 1;
cnt += 1;
}
if (cnt > 0) {
write.emplace_back(val, cnt);
}
}
}
}
vector<vector<int>> idx(MAX);
for (int i = 0; i < N; ++i) {
idx[A[i]].push_back(i);
}
const auto range_count = [&](const int l, const int r, const int x) {
const auto& v = idx[x];
return std::lower_bound(v.begin(), v.end(), r) - std::lower_bound(v.begin(), v.end(), l);
};
vector<char> appear(MAX);
vector<int> count(MAX);
while (Q--) {
int l, r;
std::cin >> l >> r;
l -= 1;
vector<pair<int, int>> list;
if (l / B == r / B) {
vector<int> add;
for (int i = l; i < r; ++i) {
if (!appear[A[i]]) {
appear[A[i]] = true;
add.push_back(A[i]);
}
count[A[i]] += 1;
}
for (const int x : add) {
appear[x] = false;
list.emplace_back(count[x], 1);
count[x] = 0;
}
std::sort(list.begin(), list.end());
} else {
const int lc = (l + B - 1) / B;
const int rc = r / B;
assert(lc <= rc);
vector<int> remove, add, seen;
for (int i = l; i < B * lc; ++i) {
if (!appear[A[i]]) {
appear[A[i]] = true;
const int tmp = range_count(B * lc, B * rc, A[i]);
if (tmp > 0) {
remove.push_back(tmp);
}
add.push_back(range_count(l, r, A[i]));
seen.push_back(A[i]);
}
}
for (int i = B * rc; i < r; ++i) {
if (!appear[A[i]]) {
appear[A[i]] = true;
const int tmp = range_count(B * lc, B * rc, A[i]);
if (tmp > 0) {
remove.push_back(tmp);
}
add.push_back(range_count(l, r, A[i]));
seen.push_back(A[i]);
}
}
for (const int x : seen) {
appear[x] = false;
}
std::sort(remove.begin(), remove.end());
std::sort(add.begin(), add.end());
const auto& read = precalc[lc][rc];
const int A = read.size(), B = remove.size(), C = add.size();
int i = 0, j = 0, k = 0;
while (i < A or k < C) {
int val = MAX;
if (i < A) {
val = std::min(val, read[i].first);
}
if (k < C) {
val = std::min(val, add[k]);
}
int cnt = 0;
if (i < A and val == read[i].first) {
cnt += read[i].second;
i += 1;
}
while (j < B and val == remove[j]) {
j += 1;
cnt -= 1;
}
while (k < C and val == add[k]) {
k += 1;
cnt += 1;
}
if (cnt > 0) {
list.emplace_back(val, cnt);
}
}
}
const int len = r - l;
i64 ans = sum_k(len);
const auto add_to = [&](const i64 s, const int a, const int n) {
ans += (n * s + sum_k(n) * a) * len;
ans -= n * s * s + 2 * s * sum_k(n) * a + sum_k2(n) * a * a;
};
int left = 0, right = 0;
for (const auto& [a, b] : list) {
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 -= (i64)left * (len - left);
std::cout << ans << '\n';
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
8780 KB |
Output is correct |
2 |
Correct |
5 ms |
8780 KB |
Output is correct |
3 |
Correct |
4 ms |
8780 KB |
Output is correct |
4 |
Correct |
4 ms |
8780 KB |
Output is correct |
5 |
Correct |
4 ms |
8780 KB |
Output is correct |
6 |
Correct |
5 ms |
8780 KB |
Output is correct |
7 |
Correct |
5 ms |
8748 KB |
Output is correct |
8 |
Correct |
5 ms |
8780 KB |
Output is correct |
9 |
Correct |
6 ms |
8780 KB |
Output is correct |
10 |
Correct |
5 ms |
8824 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
8780 KB |
Output is correct |
2 |
Correct |
5 ms |
8848 KB |
Output is correct |
3 |
Correct |
9 ms |
10000 KB |
Output is correct |
4 |
Correct |
34 ms |
11224 KB |
Output is correct |
5 |
Correct |
118 ms |
14808 KB |
Output is correct |
6 |
Correct |
230 ms |
20272 KB |
Output is correct |
7 |
Correct |
222 ms |
20244 KB |
Output is correct |
8 |
Correct |
220 ms |
20508 KB |
Output is correct |
9 |
Correct |
247 ms |
20060 KB |
Output is correct |
10 |
Correct |
226 ms |
20332 KB |
Output is correct |
11 |
Correct |
230 ms |
20296 KB |
Output is correct |
12 |
Correct |
263 ms |
20248 KB |
Output is correct |
13 |
Correct |
213 ms |
20228 KB |
Output is correct |
14 |
Correct |
225 ms |
20436 KB |
Output is correct |
15 |
Correct |
241 ms |
20092 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
8780 KB |
Output is correct |
2 |
Correct |
5 ms |
8848 KB |
Output is correct |
3 |
Correct |
9 ms |
10000 KB |
Output is correct |
4 |
Correct |
34 ms |
11224 KB |
Output is correct |
5 |
Correct |
118 ms |
14808 KB |
Output is correct |
6 |
Correct |
230 ms |
20272 KB |
Output is correct |
7 |
Correct |
222 ms |
20244 KB |
Output is correct |
8 |
Correct |
220 ms |
20508 KB |
Output is correct |
9 |
Correct |
247 ms |
20060 KB |
Output is correct |
10 |
Correct |
226 ms |
20332 KB |
Output is correct |
11 |
Correct |
230 ms |
20296 KB |
Output is correct |
12 |
Correct |
263 ms |
20248 KB |
Output is correct |
13 |
Correct |
213 ms |
20228 KB |
Output is correct |
14 |
Correct |
225 ms |
20436 KB |
Output is correct |
15 |
Correct |
241 ms |
20092 KB |
Output is correct |
16 |
Correct |
4 ms |
8780 KB |
Output is correct |
17 |
Correct |
5 ms |
8848 KB |
Output is correct |
18 |
Correct |
7 ms |
10052 KB |
Output is correct |
19 |
Correct |
40 ms |
11940 KB |
Output is correct |
20 |
Correct |
127 ms |
17260 KB |
Output is correct |
21 |
Correct |
269 ms |
25668 KB |
Output is correct |
22 |
Correct |
263 ms |
26016 KB |
Output is correct |
23 |
Correct |
274 ms |
25944 KB |
Output is correct |
24 |
Correct |
275 ms |
25996 KB |
Output is correct |
25 |
Correct |
269 ms |
26020 KB |
Output is correct |
26 |
Correct |
297 ms |
25788 KB |
Output is correct |
27 |
Correct |
275 ms |
25744 KB |
Output is correct |
28 |
Correct |
263 ms |
26000 KB |
Output is correct |
29 |
Correct |
280 ms |
25856 KB |
Output is correct |
30 |
Correct |
266 ms |
25868 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
8780 KB |
Output is correct |
2 |
Correct |
5 ms |
8848 KB |
Output is correct |
3 |
Correct |
9 ms |
10000 KB |
Output is correct |
4 |
Correct |
34 ms |
11224 KB |
Output is correct |
5 |
Correct |
118 ms |
14808 KB |
Output is correct |
6 |
Correct |
230 ms |
20272 KB |
Output is correct |
7 |
Correct |
222 ms |
20244 KB |
Output is correct |
8 |
Correct |
220 ms |
20508 KB |
Output is correct |
9 |
Correct |
247 ms |
20060 KB |
Output is correct |
10 |
Correct |
226 ms |
20332 KB |
Output is correct |
11 |
Correct |
230 ms |
20296 KB |
Output is correct |
12 |
Correct |
263 ms |
20248 KB |
Output is correct |
13 |
Correct |
213 ms |
20228 KB |
Output is correct |
14 |
Correct |
225 ms |
20436 KB |
Output is correct |
15 |
Correct |
241 ms |
20092 KB |
Output is correct |
16 |
Correct |
4 ms |
8780 KB |
Output is correct |
17 |
Correct |
5 ms |
8848 KB |
Output is correct |
18 |
Correct |
7 ms |
10052 KB |
Output is correct |
19 |
Correct |
40 ms |
11940 KB |
Output is correct |
20 |
Correct |
127 ms |
17260 KB |
Output is correct |
21 |
Correct |
269 ms |
25668 KB |
Output is correct |
22 |
Correct |
263 ms |
26016 KB |
Output is correct |
23 |
Correct |
274 ms |
25944 KB |
Output is correct |
24 |
Correct |
275 ms |
25996 KB |
Output is correct |
25 |
Correct |
269 ms |
26020 KB |
Output is correct |
26 |
Correct |
297 ms |
25788 KB |
Output is correct |
27 |
Correct |
275 ms |
25744 KB |
Output is correct |
28 |
Correct |
263 ms |
26000 KB |
Output is correct |
29 |
Correct |
280 ms |
25856 KB |
Output is correct |
30 |
Correct |
266 ms |
25868 KB |
Output is correct |
31 |
Correct |
5 ms |
8848 KB |
Output is correct |
32 |
Correct |
6 ms |
8848 KB |
Output is correct |
33 |
Correct |
5 ms |
8848 KB |
Output is correct |
34 |
Correct |
7 ms |
10000 KB |
Output is correct |
35 |
Correct |
10 ms |
10024 KB |
Output is correct |
36 |
Correct |
8 ms |
10000 KB |
Output is correct |
37 |
Correct |
63 ms |
11756 KB |
Output is correct |
38 |
Correct |
74 ms |
11304 KB |
Output is correct |
39 |
Correct |
281 ms |
17676 KB |
Output is correct |
40 |
Correct |
1146 ms |
58836 KB |
Output is correct |
41 |
Correct |
2739 ms |
143292 KB |
Output is correct |
42 |
Correct |
2686 ms |
142704 KB |
Output is correct |
43 |
Correct |
2644 ms |
143716 KB |
Output is correct |
44 |
Correct |
2667 ms |
142860 KB |
Output is correct |
45 |
Correct |
2652 ms |
143396 KB |
Output is correct |
46 |
Correct |
2638 ms |
142444 KB |
Output is correct |
47 |
Correct |
2682 ms |
143088 KB |
Output is correct |
48 |
Correct |
2635 ms |
142904 KB |
Output is correct |
49 |
Correct |
2667 ms |
142944 KB |
Output is correct |
50 |
Correct |
2681 ms |
144232 KB |
Output is correct |
51 |
Correct |
2659 ms |
142764 KB |
Output is correct |
52 |
Correct |
2682 ms |
142736 KB |
Output is correct |
53 |
Correct |
2698 ms |
143700 KB |
Output is correct |
54 |
Correct |
2724 ms |
142848 KB |
Output is correct |
55 |
Correct |
2658 ms |
142992 KB |
Output is correct |
56 |
Correct |
2667 ms |
142072 KB |
Output is correct |
57 |
Correct |
2739 ms |
141916 KB |
Output is correct |
58 |
Correct |
2700 ms |
143632 KB |
Output is correct |
59 |
Correct |
2634 ms |
142972 KB |
Output is correct |
60 |
Correct |
2706 ms |
142988 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
8780 KB |
Output is correct |
2 |
Correct |
5 ms |
8780 KB |
Output is correct |
3 |
Correct |
4 ms |
8780 KB |
Output is correct |
4 |
Correct |
4 ms |
8780 KB |
Output is correct |
5 |
Correct |
4 ms |
8780 KB |
Output is correct |
6 |
Correct |
5 ms |
8780 KB |
Output is correct |
7 |
Correct |
5 ms |
8748 KB |
Output is correct |
8 |
Correct |
5 ms |
8780 KB |
Output is correct |
9 |
Correct |
6 ms |
8780 KB |
Output is correct |
10 |
Correct |
5 ms |
8824 KB |
Output is correct |
11 |
Correct |
4 ms |
8780 KB |
Output is correct |
12 |
Correct |
5 ms |
8848 KB |
Output is correct |
13 |
Correct |
9 ms |
10000 KB |
Output is correct |
14 |
Correct |
34 ms |
11224 KB |
Output is correct |
15 |
Correct |
118 ms |
14808 KB |
Output is correct |
16 |
Correct |
230 ms |
20272 KB |
Output is correct |
17 |
Correct |
222 ms |
20244 KB |
Output is correct |
18 |
Correct |
220 ms |
20508 KB |
Output is correct |
19 |
Correct |
247 ms |
20060 KB |
Output is correct |
20 |
Correct |
226 ms |
20332 KB |
Output is correct |
21 |
Correct |
230 ms |
20296 KB |
Output is correct |
22 |
Correct |
263 ms |
20248 KB |
Output is correct |
23 |
Correct |
213 ms |
20228 KB |
Output is correct |
24 |
Correct |
225 ms |
20436 KB |
Output is correct |
25 |
Correct |
241 ms |
20092 KB |
Output is correct |
26 |
Correct |
4 ms |
8780 KB |
Output is correct |
27 |
Correct |
5 ms |
8848 KB |
Output is correct |
28 |
Correct |
7 ms |
10052 KB |
Output is correct |
29 |
Correct |
40 ms |
11940 KB |
Output is correct |
30 |
Correct |
127 ms |
17260 KB |
Output is correct |
31 |
Correct |
269 ms |
25668 KB |
Output is correct |
32 |
Correct |
263 ms |
26016 KB |
Output is correct |
33 |
Correct |
274 ms |
25944 KB |
Output is correct |
34 |
Correct |
275 ms |
25996 KB |
Output is correct |
35 |
Correct |
269 ms |
26020 KB |
Output is correct |
36 |
Correct |
297 ms |
25788 KB |
Output is correct |
37 |
Correct |
275 ms |
25744 KB |
Output is correct |
38 |
Correct |
263 ms |
26000 KB |
Output is correct |
39 |
Correct |
280 ms |
25856 KB |
Output is correct |
40 |
Correct |
266 ms |
25868 KB |
Output is correct |
41 |
Correct |
5 ms |
8848 KB |
Output is correct |
42 |
Correct |
6 ms |
8848 KB |
Output is correct |
43 |
Correct |
5 ms |
8848 KB |
Output is correct |
44 |
Correct |
7 ms |
10000 KB |
Output is correct |
45 |
Correct |
10 ms |
10024 KB |
Output is correct |
46 |
Correct |
8 ms |
10000 KB |
Output is correct |
47 |
Correct |
63 ms |
11756 KB |
Output is correct |
48 |
Correct |
74 ms |
11304 KB |
Output is correct |
49 |
Correct |
281 ms |
17676 KB |
Output is correct |
50 |
Correct |
1146 ms |
58836 KB |
Output is correct |
51 |
Correct |
2739 ms |
143292 KB |
Output is correct |
52 |
Correct |
2686 ms |
142704 KB |
Output is correct |
53 |
Correct |
2644 ms |
143716 KB |
Output is correct |
54 |
Correct |
2667 ms |
142860 KB |
Output is correct |
55 |
Correct |
2652 ms |
143396 KB |
Output is correct |
56 |
Correct |
2638 ms |
142444 KB |
Output is correct |
57 |
Correct |
2682 ms |
143088 KB |
Output is correct |
58 |
Correct |
2635 ms |
142904 KB |
Output is correct |
59 |
Correct |
2667 ms |
142944 KB |
Output is correct |
60 |
Correct |
2681 ms |
144232 KB |
Output is correct |
61 |
Correct |
2659 ms |
142764 KB |
Output is correct |
62 |
Correct |
2682 ms |
142736 KB |
Output is correct |
63 |
Correct |
2698 ms |
143700 KB |
Output is correct |
64 |
Correct |
2724 ms |
142848 KB |
Output is correct |
65 |
Correct |
2658 ms |
142992 KB |
Output is correct |
66 |
Correct |
2667 ms |
142072 KB |
Output is correct |
67 |
Correct |
2739 ms |
141916 KB |
Output is correct |
68 |
Correct |
2700 ms |
143632 KB |
Output is correct |
69 |
Correct |
2634 ms |
142972 KB |
Output is correct |
70 |
Correct |
2706 ms |
142988 KB |
Output is correct |
71 |
Correct |
79 ms |
10888 KB |
Output is correct |
72 |
Correct |
80 ms |
10888 KB |
Output is correct |
73 |
Correct |
86 ms |
10944 KB |
Output is correct |
74 |
Correct |
94 ms |
10868 KB |
Output is correct |
75 |
Correct |
83 ms |
10860 KB |
Output is correct |
76 |
Correct |
330 ms |
13372 KB |
Output is correct |
77 |
Correct |
359 ms |
13292 KB |
Output is correct |
78 |
Correct |
350 ms |
13284 KB |
Output is correct |
79 |
Correct |
339 ms |
13324 KB |
Output is correct |
80 |
Correct |
332 ms |
13368 KB |
Output is correct |
81 |
Correct |
1416 ms |
23668 KB |
Output is correct |
82 |
Correct |
1430 ms |
23556 KB |
Output is correct |
83 |
Correct |
1386 ms |
23808 KB |
Output is correct |
84 |
Correct |
1414 ms |
23516 KB |
Output is correct |
85 |
Correct |
1395 ms |
24360 KB |
Output is correct |
86 |
Correct |
1318 ms |
19360 KB |
Output is correct |
87 |
Correct |
1355 ms |
19460 KB |
Output is correct |
88 |
Correct |
1308 ms |
18820 KB |
Output is correct |
89 |
Correct |
1301 ms |
19348 KB |
Output is correct |
90 |
Correct |
1261 ms |
19168 KB |
Output is correct |
91 |
Correct |
2300 ms |
22604 KB |
Output is correct |
92 |
Correct |
2285 ms |
22580 KB |
Output is correct |
93 |
Correct |
2253 ms |
22520 KB |
Output is correct |
94 |
Correct |
2210 ms |
22168 KB |
Output is correct |
95 |
Correct |
2221 ms |
22524 KB |
Output is correct |
96 |
Correct |
1683 ms |
22144 KB |
Output is correct |
97 |
Correct |
1710 ms |
22280 KB |
Output is correct |
98 |
Correct |
1708 ms |
22212 KB |
Output is correct |
99 |
Correct |
1674 ms |
22168 KB |
Output is correct |
100 |
Correct |
1687 ms |
22032 KB |
Output is correct |
101 |
Correct |
1680 ms |
22284 KB |
Output is correct |
102 |
Correct |
1698 ms |
22108 KB |
Output is correct |
103 |
Correct |
1690 ms |
22164 KB |
Output is correct |
104 |
Correct |
1688 ms |
22196 KB |
Output is correct |
105 |
Correct |
1705 ms |
22380 KB |
Output is correct |
106 |
Correct |
1371 ms |
22748 KB |
Output is correct |
107 |
Correct |
1378 ms |
22756 KB |
Output is correct |
108 |
Correct |
1400 ms |
22676 KB |
Output is correct |
109 |
Correct |
1383 ms |
22888 KB |
Output is correct |
110 |
Correct |
1390 ms |
22672 KB |
Output is correct |
111 |
Correct |
1380 ms |
22748 KB |
Output is correct |
112 |
Correct |
1391 ms |
22564 KB |
Output is correct |
113 |
Correct |
1364 ms |
22684 KB |
Output is correct |
114 |
Correct |
1414 ms |
22944 KB |
Output is correct |
115 |
Correct |
1390 ms |
22680 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
8780 KB |
Output is correct |
2 |
Correct |
5 ms |
8780 KB |
Output is correct |
3 |
Correct |
4 ms |
8780 KB |
Output is correct |
4 |
Correct |
4 ms |
8780 KB |
Output is correct |
5 |
Correct |
4 ms |
8780 KB |
Output is correct |
6 |
Correct |
5 ms |
8780 KB |
Output is correct |
7 |
Correct |
5 ms |
8748 KB |
Output is correct |
8 |
Correct |
5 ms |
8780 KB |
Output is correct |
9 |
Correct |
6 ms |
8780 KB |
Output is correct |
10 |
Correct |
5 ms |
8824 KB |
Output is correct |
11 |
Correct |
4 ms |
8780 KB |
Output is correct |
12 |
Correct |
5 ms |
8848 KB |
Output is correct |
13 |
Correct |
9 ms |
10000 KB |
Output is correct |
14 |
Correct |
34 ms |
11224 KB |
Output is correct |
15 |
Correct |
118 ms |
14808 KB |
Output is correct |
16 |
Correct |
230 ms |
20272 KB |
Output is correct |
17 |
Correct |
222 ms |
20244 KB |
Output is correct |
18 |
Correct |
220 ms |
20508 KB |
Output is correct |
19 |
Correct |
247 ms |
20060 KB |
Output is correct |
20 |
Correct |
226 ms |
20332 KB |
Output is correct |
21 |
Correct |
230 ms |
20296 KB |
Output is correct |
22 |
Correct |
263 ms |
20248 KB |
Output is correct |
23 |
Correct |
213 ms |
20228 KB |
Output is correct |
24 |
Correct |
225 ms |
20436 KB |
Output is correct |
25 |
Correct |
241 ms |
20092 KB |
Output is correct |
26 |
Correct |
4 ms |
8780 KB |
Output is correct |
27 |
Correct |
5 ms |
8848 KB |
Output is correct |
28 |
Correct |
7 ms |
10052 KB |
Output is correct |
29 |
Correct |
40 ms |
11940 KB |
Output is correct |
30 |
Correct |
127 ms |
17260 KB |
Output is correct |
31 |
Correct |
269 ms |
25668 KB |
Output is correct |
32 |
Correct |
263 ms |
26016 KB |
Output is correct |
33 |
Correct |
274 ms |
25944 KB |
Output is correct |
34 |
Correct |
275 ms |
25996 KB |
Output is correct |
35 |
Correct |
269 ms |
26020 KB |
Output is correct |
36 |
Correct |
297 ms |
25788 KB |
Output is correct |
37 |
Correct |
275 ms |
25744 KB |
Output is correct |
38 |
Correct |
263 ms |
26000 KB |
Output is correct |
39 |
Correct |
280 ms |
25856 KB |
Output is correct |
40 |
Correct |
266 ms |
25868 KB |
Output is correct |
41 |
Correct |
5 ms |
8848 KB |
Output is correct |
42 |
Correct |
6 ms |
8848 KB |
Output is correct |
43 |
Correct |
5 ms |
8848 KB |
Output is correct |
44 |
Correct |
7 ms |
10000 KB |
Output is correct |
45 |
Correct |
10 ms |
10024 KB |
Output is correct |
46 |
Correct |
8 ms |
10000 KB |
Output is correct |
47 |
Correct |
63 ms |
11756 KB |
Output is correct |
48 |
Correct |
74 ms |
11304 KB |
Output is correct |
49 |
Correct |
281 ms |
17676 KB |
Output is correct |
50 |
Correct |
1146 ms |
58836 KB |
Output is correct |
51 |
Correct |
2739 ms |
143292 KB |
Output is correct |
52 |
Correct |
2686 ms |
142704 KB |
Output is correct |
53 |
Correct |
2644 ms |
143716 KB |
Output is correct |
54 |
Correct |
2667 ms |
142860 KB |
Output is correct |
55 |
Correct |
2652 ms |
143396 KB |
Output is correct |
56 |
Correct |
2638 ms |
142444 KB |
Output is correct |
57 |
Correct |
2682 ms |
143088 KB |
Output is correct |
58 |
Correct |
2635 ms |
142904 KB |
Output is correct |
59 |
Correct |
2667 ms |
142944 KB |
Output is correct |
60 |
Correct |
2681 ms |
144232 KB |
Output is correct |
61 |
Correct |
2659 ms |
142764 KB |
Output is correct |
62 |
Correct |
2682 ms |
142736 KB |
Output is correct |
63 |
Correct |
2698 ms |
143700 KB |
Output is correct |
64 |
Correct |
2724 ms |
142848 KB |
Output is correct |
65 |
Correct |
2658 ms |
142992 KB |
Output is correct |
66 |
Correct |
2667 ms |
142072 KB |
Output is correct |
67 |
Correct |
2739 ms |
141916 KB |
Output is correct |
68 |
Correct |
2700 ms |
143632 KB |
Output is correct |
69 |
Correct |
2634 ms |
142972 KB |
Output is correct |
70 |
Correct |
2706 ms |
142988 KB |
Output is correct |
71 |
Correct |
79 ms |
10888 KB |
Output is correct |
72 |
Correct |
80 ms |
10888 KB |
Output is correct |
73 |
Correct |
86 ms |
10944 KB |
Output is correct |
74 |
Correct |
94 ms |
10868 KB |
Output is correct |
75 |
Correct |
83 ms |
10860 KB |
Output is correct |
76 |
Correct |
330 ms |
13372 KB |
Output is correct |
77 |
Correct |
359 ms |
13292 KB |
Output is correct |
78 |
Correct |
350 ms |
13284 KB |
Output is correct |
79 |
Correct |
339 ms |
13324 KB |
Output is correct |
80 |
Correct |
332 ms |
13368 KB |
Output is correct |
81 |
Correct |
1416 ms |
23668 KB |
Output is correct |
82 |
Correct |
1430 ms |
23556 KB |
Output is correct |
83 |
Correct |
1386 ms |
23808 KB |
Output is correct |
84 |
Correct |
1414 ms |
23516 KB |
Output is correct |
85 |
Correct |
1395 ms |
24360 KB |
Output is correct |
86 |
Correct |
1318 ms |
19360 KB |
Output is correct |
87 |
Correct |
1355 ms |
19460 KB |
Output is correct |
88 |
Correct |
1308 ms |
18820 KB |
Output is correct |
89 |
Correct |
1301 ms |
19348 KB |
Output is correct |
90 |
Correct |
1261 ms |
19168 KB |
Output is correct |
91 |
Correct |
2300 ms |
22604 KB |
Output is correct |
92 |
Correct |
2285 ms |
22580 KB |
Output is correct |
93 |
Correct |
2253 ms |
22520 KB |
Output is correct |
94 |
Correct |
2210 ms |
22168 KB |
Output is correct |
95 |
Correct |
2221 ms |
22524 KB |
Output is correct |
96 |
Correct |
1683 ms |
22144 KB |
Output is correct |
97 |
Correct |
1710 ms |
22280 KB |
Output is correct |
98 |
Correct |
1708 ms |
22212 KB |
Output is correct |
99 |
Correct |
1674 ms |
22168 KB |
Output is correct |
100 |
Correct |
1687 ms |
22032 KB |
Output is correct |
101 |
Correct |
1680 ms |
22284 KB |
Output is correct |
102 |
Correct |
1698 ms |
22108 KB |
Output is correct |
103 |
Correct |
1690 ms |
22164 KB |
Output is correct |
104 |
Correct |
1688 ms |
22196 KB |
Output is correct |
105 |
Correct |
1705 ms |
22380 KB |
Output is correct |
106 |
Correct |
1371 ms |
22748 KB |
Output is correct |
107 |
Correct |
1378 ms |
22756 KB |
Output is correct |
108 |
Correct |
1400 ms |
22676 KB |
Output is correct |
109 |
Correct |
1383 ms |
22888 KB |
Output is correct |
110 |
Correct |
1390 ms |
22672 KB |
Output is correct |
111 |
Correct |
1380 ms |
22748 KB |
Output is correct |
112 |
Correct |
1391 ms |
22564 KB |
Output is correct |
113 |
Correct |
1364 ms |
22684 KB |
Output is correct |
114 |
Correct |
1414 ms |
22944 KB |
Output is correct |
115 |
Correct |
1390 ms |
22680 KB |
Output is correct |
116 |
Runtime error |
700 ms |
20648 KB |
Execution killed with signal 11 |
117 |
Halted |
0 ms |
0 KB |
- |