#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n, q, b;
int arr[303030];
ll cnt[303030], cnt2[303030], sum[303030], xsum[303030], ans[50505];
pair<ll, ll> reord[303030];
unordered_set<int> S;
const int m = 300000;
struct query{
int idx, lt, rt;
} Q[50505];
bool compare(query p, query q) {
if (p.lt/b == q.lt/b) return p.rt < q.rt;
return (p.lt/b) < (q.lt/b);
}
void add(int i, int diff) {
if (cnt2[cnt[i]] == 1) S.erase(cnt[i]);
cnt2[cnt[i]]--;
cnt[i] += diff;
if (cnt2[cnt[i]] == 0) S.insert(cnt[i]);
cnt2[cnt[i]]++;
}
ll SumOfSquare(ll x, ll y, ll a, ll k) { // \sum_{i=0}^{k-1} {(x+ia)^2 + (y+ia)^2}
return k * x * x + a * x * k * (k - 1) + a * a * k * (k - 1) * (2 * k - 1) / 6
+ k * y * y + a * y * k * (k - 1) + a * a * k * (k - 1) * (2 * k - 1) / 6;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cin >> n >> q; b = (int)sqrt(n);
for (int i = 1; i <= n; i++) cin >> arr[i];
for (int i = 1; i <= q; i++) cin >> Q[i].lt >> Q[i].rt;
for (int i = 1; i <= q; i++) Q[i].idx = i;
sort(Q + 1, Q + q + 1, compare);
Q[0].lt = 1; Q[0].rt = 0;
for (int i = 1; i <= q; i++) {
if (Q[i - 1].rt < Q[i].rt) for (int j = Q[i - 1].rt + 1; j <= Q[i].rt; j++) add(arr[j], 1);
else for (int j = Q[i].rt + 1; j <= Q[i - 1].rt; j++) add(arr[j], -1);
if (Q[i - 1].lt > Q[i].lt) for (int j = Q[i].lt; j < Q[i - 1].lt; j++) add(arr[j], 1);
else for (int j = Q[i - 1].lt; j < Q[i].lt; j++) add(arr[j], -1);
ll len = Q[i].rt - Q[i].lt + 1;
ll full_div = 0;
vector< pair<int, ll> > v;
for (auto iter = S.begin(); iter != S.end(); iter++) {
v.emplace_back(*iter, cnt2[*iter]);
full_div += cnt2[*iter];
}
sort(v.begin(), v.end());
ll res = full_div * len * (len + 1) - len * (full_div - 1);
ll l = 0, r = 0;
int tot = 0;
for (int i = 0; i < v.size(); i++) {
ll a = v[i].first, k = v[i].second;
ll sm = k/2, lr = k - k/2;
if (tot % 2 == 0) {
res -= SumOfSquare(l, len - l - a * sm, a, sm);
res -= SumOfSquare(r, len - r - a * lr, a, lr);
l = l + a * sm;
r = r + a * lr;
}
else {
res -= SumOfSquare(l, len - l - a * lr, a, lr);
res -= SumOfSquare(r, len - r - a * sm, a, sm);
l = l + a * lr;
r = r + a * sm;
}
tot += k;
}
ans[Q[i].idx] = res/2;
}
for (int i = 1; i <= q; i++) cout << ans[i] << "\n";
return 0;
}
Compilation message
diversity.cpp: In function 'int main()':
diversity.cpp:67:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
67 | for (int i = 0; i < v.size(); i++) {
| ~~^~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Correct |
0 ms |
340 KB |
Output is correct |
3 |
Correct |
0 ms |
340 KB |
Output is correct |
4 |
Correct |
1 ms |
340 KB |
Output is correct |
5 |
Correct |
0 ms |
340 KB |
Output is correct |
6 |
Correct |
0 ms |
340 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 |
340 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 |
10 ms |
852 KB |
Output is correct |
5 |
Correct |
19 ms |
1680 KB |
Output is correct |
6 |
Correct |
30 ms |
1892 KB |
Output is correct |
7 |
Correct |
32 ms |
2764 KB |
Output is correct |
8 |
Correct |
29 ms |
1816 KB |
Output is correct |
9 |
Correct |
29 ms |
1908 KB |
Output is correct |
10 |
Correct |
29 ms |
2204 KB |
Output is correct |
11 |
Correct |
29 ms |
2000 KB |
Output is correct |
12 |
Correct |
29 ms |
1868 KB |
Output is correct |
13 |
Correct |
29 ms |
1896 KB |
Output is correct |
14 |
Correct |
29 ms |
2124 KB |
Output is correct |
15 |
Correct |
29 ms |
2004 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 |
10 ms |
852 KB |
Output is correct |
5 |
Correct |
19 ms |
1680 KB |
Output is correct |
6 |
Correct |
30 ms |
1892 KB |
Output is correct |
7 |
Correct |
32 ms |
2764 KB |
Output is correct |
8 |
Correct |
29 ms |
1816 KB |
Output is correct |
9 |
Correct |
29 ms |
1908 KB |
Output is correct |
10 |
Correct |
29 ms |
2204 KB |
Output is correct |
11 |
Correct |
29 ms |
2000 KB |
Output is correct |
12 |
Correct |
29 ms |
1868 KB |
Output is correct |
13 |
Correct |
29 ms |
1896 KB |
Output is correct |
14 |
Correct |
29 ms |
2124 KB |
Output is correct |
15 |
Correct |
29 ms |
2004 KB |
Output is correct |
16 |
Correct |
0 ms |
340 KB |
Output is correct |
17 |
Correct |
1 ms |
340 KB |
Output is correct |
18 |
Correct |
1 ms |
340 KB |
Output is correct |
19 |
Correct |
11 ms |
980 KB |
Output is correct |
20 |
Correct |
19 ms |
1364 KB |
Output is correct |
21 |
Correct |
29 ms |
1996 KB |
Output is correct |
22 |
Correct |
30 ms |
1740 KB |
Output is correct |
23 |
Correct |
29 ms |
1876 KB |
Output is correct |
24 |
Correct |
30 ms |
1748 KB |
Output is correct |
25 |
Correct |
30 ms |
1752 KB |
Output is correct |
26 |
Correct |
30 ms |
1784 KB |
Output is correct |
27 |
Correct |
30 ms |
1868 KB |
Output is correct |
28 |
Correct |
30 ms |
2052 KB |
Output is correct |
29 |
Correct |
30 ms |
1748 KB |
Output is correct |
30 |
Correct |
30 ms |
1836 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 |
10 ms |
852 KB |
Output is correct |
5 |
Correct |
19 ms |
1680 KB |
Output is correct |
6 |
Correct |
30 ms |
1892 KB |
Output is correct |
7 |
Correct |
32 ms |
2764 KB |
Output is correct |
8 |
Correct |
29 ms |
1816 KB |
Output is correct |
9 |
Correct |
29 ms |
1908 KB |
Output is correct |
10 |
Correct |
29 ms |
2204 KB |
Output is correct |
11 |
Correct |
29 ms |
2000 KB |
Output is correct |
12 |
Correct |
29 ms |
1868 KB |
Output is correct |
13 |
Correct |
29 ms |
1896 KB |
Output is correct |
14 |
Correct |
29 ms |
2124 KB |
Output is correct |
15 |
Correct |
29 ms |
2004 KB |
Output is correct |
16 |
Correct |
0 ms |
340 KB |
Output is correct |
17 |
Correct |
1 ms |
340 KB |
Output is correct |
18 |
Correct |
1 ms |
340 KB |
Output is correct |
19 |
Correct |
11 ms |
980 KB |
Output is correct |
20 |
Correct |
19 ms |
1364 KB |
Output is correct |
21 |
Correct |
29 ms |
1996 KB |
Output is correct |
22 |
Correct |
30 ms |
1740 KB |
Output is correct |
23 |
Correct |
29 ms |
1876 KB |
Output is correct |
24 |
Correct |
30 ms |
1748 KB |
Output is correct |
25 |
Correct |
30 ms |
1752 KB |
Output is correct |
26 |
Correct |
30 ms |
1784 KB |
Output is correct |
27 |
Correct |
30 ms |
1868 KB |
Output is correct |
28 |
Correct |
30 ms |
2052 KB |
Output is correct |
29 |
Correct |
30 ms |
1748 KB |
Output is correct |
30 |
Correct |
30 ms |
1836 KB |
Output is correct |
31 |
Correct |
0 ms |
340 KB |
Output is correct |
32 |
Correct |
1 ms |
340 KB |
Output is correct |
33 |
Correct |
1 ms |
340 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 |
340 KB |
Output is correct |
37 |
Correct |
4 ms |
468 KB |
Output is correct |
38 |
Correct |
3 ms |
468 KB |
Output is correct |
39 |
Correct |
7 ms |
724 KB |
Output is correct |
40 |
Correct |
13 ms |
1112 KB |
Output is correct |
41 |
Correct |
21 ms |
1620 KB |
Output is correct |
42 |
Correct |
21 ms |
1560 KB |
Output is correct |
43 |
Correct |
22 ms |
1620 KB |
Output is correct |
44 |
Correct |
21 ms |
1620 KB |
Output is correct |
45 |
Correct |
23 ms |
1560 KB |
Output is correct |
46 |
Correct |
21 ms |
1544 KB |
Output is correct |
47 |
Correct |
21 ms |
1536 KB |
Output is correct |
48 |
Correct |
21 ms |
1552 KB |
Output is correct |
49 |
Correct |
21 ms |
1544 KB |
Output is correct |
50 |
Correct |
21 ms |
1564 KB |
Output is correct |
51 |
Correct |
21 ms |
1572 KB |
Output is correct |
52 |
Correct |
21 ms |
1492 KB |
Output is correct |
53 |
Correct |
21 ms |
1584 KB |
Output is correct |
54 |
Correct |
21 ms |
1568 KB |
Output is correct |
55 |
Correct |
22 ms |
1548 KB |
Output is correct |
56 |
Correct |
21 ms |
1536 KB |
Output is correct |
57 |
Correct |
21 ms |
1620 KB |
Output is correct |
58 |
Correct |
21 ms |
1560 KB |
Output is correct |
59 |
Correct |
21 ms |
1620 KB |
Output is correct |
60 |
Correct |
21 ms |
1572 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Correct |
0 ms |
340 KB |
Output is correct |
3 |
Correct |
0 ms |
340 KB |
Output is correct |
4 |
Correct |
1 ms |
340 KB |
Output is correct |
5 |
Correct |
0 ms |
340 KB |
Output is correct |
6 |
Correct |
0 ms |
340 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 |
340 KB |
Output is correct |
11 |
Correct |
0 ms |
340 KB |
Output is correct |
12 |
Correct |
1 ms |
340 KB |
Output is correct |
13 |
Correct |
1 ms |
340 KB |
Output is correct |
14 |
Correct |
10 ms |
852 KB |
Output is correct |
15 |
Correct |
19 ms |
1680 KB |
Output is correct |
16 |
Correct |
30 ms |
1892 KB |
Output is correct |
17 |
Correct |
32 ms |
2764 KB |
Output is correct |
18 |
Correct |
29 ms |
1816 KB |
Output is correct |
19 |
Correct |
29 ms |
1908 KB |
Output is correct |
20 |
Correct |
29 ms |
2204 KB |
Output is correct |
21 |
Correct |
29 ms |
2000 KB |
Output is correct |
22 |
Correct |
29 ms |
1868 KB |
Output is correct |
23 |
Correct |
29 ms |
1896 KB |
Output is correct |
24 |
Correct |
29 ms |
2124 KB |
Output is correct |
25 |
Correct |
29 ms |
2004 KB |
Output is correct |
26 |
Correct |
0 ms |
340 KB |
Output is correct |
27 |
Correct |
1 ms |
340 KB |
Output is correct |
28 |
Correct |
1 ms |
340 KB |
Output is correct |
29 |
Correct |
11 ms |
980 KB |
Output is correct |
30 |
Correct |
19 ms |
1364 KB |
Output is correct |
31 |
Correct |
29 ms |
1996 KB |
Output is correct |
32 |
Correct |
30 ms |
1740 KB |
Output is correct |
33 |
Correct |
29 ms |
1876 KB |
Output is correct |
34 |
Correct |
30 ms |
1748 KB |
Output is correct |
35 |
Correct |
30 ms |
1752 KB |
Output is correct |
36 |
Correct |
30 ms |
1784 KB |
Output is correct |
37 |
Correct |
30 ms |
1868 KB |
Output is correct |
38 |
Correct |
30 ms |
2052 KB |
Output is correct |
39 |
Correct |
30 ms |
1748 KB |
Output is correct |
40 |
Correct |
30 ms |
1836 KB |
Output is correct |
41 |
Correct |
0 ms |
340 KB |
Output is correct |
42 |
Correct |
1 ms |
340 KB |
Output is correct |
43 |
Correct |
1 ms |
340 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 |
340 KB |
Output is correct |
47 |
Correct |
4 ms |
468 KB |
Output is correct |
48 |
Correct |
3 ms |
468 KB |
Output is correct |
49 |
Correct |
7 ms |
724 KB |
Output is correct |
50 |
Correct |
13 ms |
1112 KB |
Output is correct |
51 |
Correct |
21 ms |
1620 KB |
Output is correct |
52 |
Correct |
21 ms |
1560 KB |
Output is correct |
53 |
Correct |
22 ms |
1620 KB |
Output is correct |
54 |
Correct |
21 ms |
1620 KB |
Output is correct |
55 |
Correct |
23 ms |
1560 KB |
Output is correct |
56 |
Correct |
21 ms |
1544 KB |
Output is correct |
57 |
Correct |
21 ms |
1536 KB |
Output is correct |
58 |
Correct |
21 ms |
1552 KB |
Output is correct |
59 |
Correct |
21 ms |
1544 KB |
Output is correct |
60 |
Correct |
21 ms |
1564 KB |
Output is correct |
61 |
Correct |
21 ms |
1572 KB |
Output is correct |
62 |
Correct |
21 ms |
1492 KB |
Output is correct |
63 |
Correct |
21 ms |
1584 KB |
Output is correct |
64 |
Correct |
21 ms |
1568 KB |
Output is correct |
65 |
Correct |
22 ms |
1548 KB |
Output is correct |
66 |
Correct |
21 ms |
1536 KB |
Output is correct |
67 |
Correct |
21 ms |
1620 KB |
Output is correct |
68 |
Correct |
21 ms |
1560 KB |
Output is correct |
69 |
Correct |
21 ms |
1620 KB |
Output is correct |
70 |
Correct |
21 ms |
1572 KB |
Output is correct |
71 |
Correct |
3 ms |
468 KB |
Output is correct |
72 |
Correct |
3 ms |
468 KB |
Output is correct |
73 |
Correct |
4 ms |
468 KB |
Output is correct |
74 |
Correct |
3 ms |
468 KB |
Output is correct |
75 |
Correct |
3 ms |
468 KB |
Output is correct |
76 |
Correct |
6 ms |
708 KB |
Output is correct |
77 |
Correct |
6 ms |
804 KB |
Output is correct |
78 |
Correct |
7 ms |
724 KB |
Output is correct |
79 |
Correct |
6 ms |
724 KB |
Output is correct |
80 |
Correct |
6 ms |
724 KB |
Output is correct |
81 |
Correct |
12 ms |
1188 KB |
Output is correct |
82 |
Correct |
13 ms |
1172 KB |
Output is correct |
83 |
Correct |
12 ms |
1236 KB |
Output is correct |
84 |
Correct |
11 ms |
1192 KB |
Output is correct |
85 |
Correct |
12 ms |
1236 KB |
Output is correct |
86 |
Correct |
18 ms |
1180 KB |
Output is correct |
87 |
Correct |
13 ms |
1236 KB |
Output is correct |
88 |
Correct |
13 ms |
1236 KB |
Output is correct |
89 |
Correct |
13 ms |
1236 KB |
Output is correct |
90 |
Correct |
13 ms |
1236 KB |
Output is correct |
91 |
Correct |
22 ms |
2300 KB |
Output is correct |
92 |
Correct |
19 ms |
2276 KB |
Output is correct |
93 |
Correct |
19 ms |
2292 KB |
Output is correct |
94 |
Correct |
19 ms |
2260 KB |
Output is correct |
95 |
Correct |
19 ms |
2252 KB |
Output is correct |
96 |
Correct |
22 ms |
3052 KB |
Output is correct |
97 |
Correct |
22 ms |
2988 KB |
Output is correct |
98 |
Correct |
22 ms |
2988 KB |
Output is correct |
99 |
Correct |
22 ms |
2964 KB |
Output is correct |
100 |
Correct |
22 ms |
3028 KB |
Output is correct |
101 |
Correct |
22 ms |
2992 KB |
Output is correct |
102 |
Correct |
22 ms |
3028 KB |
Output is correct |
103 |
Correct |
22 ms |
2988 KB |
Output is correct |
104 |
Correct |
22 ms |
3028 KB |
Output is correct |
105 |
Correct |
21 ms |
3028 KB |
Output is correct |
106 |
Correct |
22 ms |
3384 KB |
Output is correct |
107 |
Correct |
22 ms |
3388 KB |
Output is correct |
108 |
Correct |
22 ms |
3420 KB |
Output is correct |
109 |
Correct |
22 ms |
3480 KB |
Output is correct |
110 |
Correct |
23 ms |
3464 KB |
Output is correct |
111 |
Correct |
22 ms |
3412 KB |
Output is correct |
112 |
Correct |
24 ms |
3468 KB |
Output is correct |
113 |
Correct |
22 ms |
3384 KB |
Output is correct |
114 |
Correct |
22 ms |
3344 KB |
Output is correct |
115 |
Correct |
22 ms |
3392 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Correct |
0 ms |
340 KB |
Output is correct |
3 |
Correct |
0 ms |
340 KB |
Output is correct |
4 |
Correct |
1 ms |
340 KB |
Output is correct |
5 |
Correct |
0 ms |
340 KB |
Output is correct |
6 |
Correct |
0 ms |
340 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 |
340 KB |
Output is correct |
11 |
Correct |
0 ms |
340 KB |
Output is correct |
12 |
Correct |
1 ms |
340 KB |
Output is correct |
13 |
Correct |
1 ms |
340 KB |
Output is correct |
14 |
Correct |
10 ms |
852 KB |
Output is correct |
15 |
Correct |
19 ms |
1680 KB |
Output is correct |
16 |
Correct |
30 ms |
1892 KB |
Output is correct |
17 |
Correct |
32 ms |
2764 KB |
Output is correct |
18 |
Correct |
29 ms |
1816 KB |
Output is correct |
19 |
Correct |
29 ms |
1908 KB |
Output is correct |
20 |
Correct |
29 ms |
2204 KB |
Output is correct |
21 |
Correct |
29 ms |
2000 KB |
Output is correct |
22 |
Correct |
29 ms |
1868 KB |
Output is correct |
23 |
Correct |
29 ms |
1896 KB |
Output is correct |
24 |
Correct |
29 ms |
2124 KB |
Output is correct |
25 |
Correct |
29 ms |
2004 KB |
Output is correct |
26 |
Correct |
0 ms |
340 KB |
Output is correct |
27 |
Correct |
1 ms |
340 KB |
Output is correct |
28 |
Correct |
1 ms |
340 KB |
Output is correct |
29 |
Correct |
11 ms |
980 KB |
Output is correct |
30 |
Correct |
19 ms |
1364 KB |
Output is correct |
31 |
Correct |
29 ms |
1996 KB |
Output is correct |
32 |
Correct |
30 ms |
1740 KB |
Output is correct |
33 |
Correct |
29 ms |
1876 KB |
Output is correct |
34 |
Correct |
30 ms |
1748 KB |
Output is correct |
35 |
Correct |
30 ms |
1752 KB |
Output is correct |
36 |
Correct |
30 ms |
1784 KB |
Output is correct |
37 |
Correct |
30 ms |
1868 KB |
Output is correct |
38 |
Correct |
30 ms |
2052 KB |
Output is correct |
39 |
Correct |
30 ms |
1748 KB |
Output is correct |
40 |
Correct |
30 ms |
1836 KB |
Output is correct |
41 |
Correct |
0 ms |
340 KB |
Output is correct |
42 |
Correct |
1 ms |
340 KB |
Output is correct |
43 |
Correct |
1 ms |
340 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 |
340 KB |
Output is correct |
47 |
Correct |
4 ms |
468 KB |
Output is correct |
48 |
Correct |
3 ms |
468 KB |
Output is correct |
49 |
Correct |
7 ms |
724 KB |
Output is correct |
50 |
Correct |
13 ms |
1112 KB |
Output is correct |
51 |
Correct |
21 ms |
1620 KB |
Output is correct |
52 |
Correct |
21 ms |
1560 KB |
Output is correct |
53 |
Correct |
22 ms |
1620 KB |
Output is correct |
54 |
Correct |
21 ms |
1620 KB |
Output is correct |
55 |
Correct |
23 ms |
1560 KB |
Output is correct |
56 |
Correct |
21 ms |
1544 KB |
Output is correct |
57 |
Correct |
21 ms |
1536 KB |
Output is correct |
58 |
Correct |
21 ms |
1552 KB |
Output is correct |
59 |
Correct |
21 ms |
1544 KB |
Output is correct |
60 |
Correct |
21 ms |
1564 KB |
Output is correct |
61 |
Correct |
21 ms |
1572 KB |
Output is correct |
62 |
Correct |
21 ms |
1492 KB |
Output is correct |
63 |
Correct |
21 ms |
1584 KB |
Output is correct |
64 |
Correct |
21 ms |
1568 KB |
Output is correct |
65 |
Correct |
22 ms |
1548 KB |
Output is correct |
66 |
Correct |
21 ms |
1536 KB |
Output is correct |
67 |
Correct |
21 ms |
1620 KB |
Output is correct |
68 |
Correct |
21 ms |
1560 KB |
Output is correct |
69 |
Correct |
21 ms |
1620 KB |
Output is correct |
70 |
Correct |
21 ms |
1572 KB |
Output is correct |
71 |
Correct |
3 ms |
468 KB |
Output is correct |
72 |
Correct |
3 ms |
468 KB |
Output is correct |
73 |
Correct |
4 ms |
468 KB |
Output is correct |
74 |
Correct |
3 ms |
468 KB |
Output is correct |
75 |
Correct |
3 ms |
468 KB |
Output is correct |
76 |
Correct |
6 ms |
708 KB |
Output is correct |
77 |
Correct |
6 ms |
804 KB |
Output is correct |
78 |
Correct |
7 ms |
724 KB |
Output is correct |
79 |
Correct |
6 ms |
724 KB |
Output is correct |
80 |
Correct |
6 ms |
724 KB |
Output is correct |
81 |
Correct |
12 ms |
1188 KB |
Output is correct |
82 |
Correct |
13 ms |
1172 KB |
Output is correct |
83 |
Correct |
12 ms |
1236 KB |
Output is correct |
84 |
Correct |
11 ms |
1192 KB |
Output is correct |
85 |
Correct |
12 ms |
1236 KB |
Output is correct |
86 |
Correct |
18 ms |
1180 KB |
Output is correct |
87 |
Correct |
13 ms |
1236 KB |
Output is correct |
88 |
Correct |
13 ms |
1236 KB |
Output is correct |
89 |
Correct |
13 ms |
1236 KB |
Output is correct |
90 |
Correct |
13 ms |
1236 KB |
Output is correct |
91 |
Correct |
22 ms |
2300 KB |
Output is correct |
92 |
Correct |
19 ms |
2276 KB |
Output is correct |
93 |
Correct |
19 ms |
2292 KB |
Output is correct |
94 |
Correct |
19 ms |
2260 KB |
Output is correct |
95 |
Correct |
19 ms |
2252 KB |
Output is correct |
96 |
Correct |
22 ms |
3052 KB |
Output is correct |
97 |
Correct |
22 ms |
2988 KB |
Output is correct |
98 |
Correct |
22 ms |
2988 KB |
Output is correct |
99 |
Correct |
22 ms |
2964 KB |
Output is correct |
100 |
Correct |
22 ms |
3028 KB |
Output is correct |
101 |
Correct |
22 ms |
2992 KB |
Output is correct |
102 |
Correct |
22 ms |
3028 KB |
Output is correct |
103 |
Correct |
22 ms |
2988 KB |
Output is correct |
104 |
Correct |
22 ms |
3028 KB |
Output is correct |
105 |
Correct |
21 ms |
3028 KB |
Output is correct |
106 |
Correct |
22 ms |
3384 KB |
Output is correct |
107 |
Correct |
22 ms |
3388 KB |
Output is correct |
108 |
Correct |
22 ms |
3420 KB |
Output is correct |
109 |
Correct |
22 ms |
3480 KB |
Output is correct |
110 |
Correct |
23 ms |
3464 KB |
Output is correct |
111 |
Correct |
22 ms |
3412 KB |
Output is correct |
112 |
Correct |
24 ms |
3468 KB |
Output is correct |
113 |
Correct |
22 ms |
3384 KB |
Output is correct |
114 |
Correct |
22 ms |
3344 KB |
Output is correct |
115 |
Correct |
22 ms |
3392 KB |
Output is correct |
116 |
Correct |
196 ms |
1752 KB |
Output is correct |
117 |
Correct |
186 ms |
1720 KB |
Output is correct |
118 |
Correct |
760 ms |
2108 KB |
Output is correct |
119 |
Correct |
414 ms |
2024 KB |
Output is correct |
120 |
Correct |
265 ms |
1996 KB |
Output is correct |
121 |
Correct |
657 ms |
2256 KB |
Output is correct |
122 |
Correct |
415 ms |
2256 KB |
Output is correct |
123 |
Correct |
1806 ms |
2776 KB |
Output is correct |
124 |
Correct |
668 ms |
2804 KB |
Output is correct |
125 |
Correct |
524 ms |
2828 KB |
Output is correct |
126 |
Correct |
6075 ms |
3152 KB |
Output is correct |
127 |
Correct |
6017 ms |
3084 KB |
Output is correct |
128 |
Correct |
6078 ms |
3096 KB |
Output is correct |
129 |
Correct |
6014 ms |
3080 KB |
Output is correct |
130 |
Correct |
5974 ms |
3180 KB |
Output is correct |
131 |
Correct |
5450 ms |
3180 KB |
Output is correct |
132 |
Correct |
5496 ms |
3196 KB |
Output is correct |
133 |
Correct |
5696 ms |
3192 KB |
Output is correct |
134 |
Correct |
5500 ms |
3196 KB |
Output is correct |
135 |
Correct |
5531 ms |
3196 KB |
Output is correct |
136 |
Correct |
5353 ms |
3224 KB |
Output is correct |
137 |
Correct |
5446 ms |
3200 KB |
Output is correct |
138 |
Correct |
5316 ms |
3240 KB |
Output is correct |
139 |
Correct |
5479 ms |
3200 KB |
Output is correct |
140 |
Correct |
5447 ms |
3108 KB |
Output is correct |
141 |
Correct |
3364 ms |
3208 KB |
Output is correct |
142 |
Correct |
3506 ms |
3208 KB |
Output is correct |
143 |
Correct |
3476 ms |
3220 KB |
Output is correct |
144 |
Correct |
3428 ms |
3216 KB |
Output is correct |
145 |
Correct |
3285 ms |
3216 KB |
Output is correct |
146 |
Correct |
1139 ms |
3204 KB |
Output is correct |
147 |
Correct |
1128 ms |
3200 KB |
Output is correct |
148 |
Correct |
1176 ms |
3204 KB |
Output is correct |
149 |
Correct |
1149 ms |
3148 KB |
Output is correct |
150 |
Correct |
1142 ms |
3200 KB |
Output is correct |
151 |
Correct |
979 ms |
3336 KB |
Output is correct |
152 |
Correct |
933 ms |
3240 KB |
Output is correct |
153 |
Correct |
953 ms |
3184 KB |
Output is correct |
154 |
Correct |
947 ms |
3224 KB |
Output is correct |
155 |
Correct |
930 ms |
3196 KB |
Output is correct |
156 |
Correct |
3326 ms |
3772 KB |
Output is correct |
157 |
Correct |
3373 ms |
3820 KB |
Output is correct |
158 |
Correct |
3233 ms |
3680 KB |
Output is correct |
159 |
Correct |
3219 ms |
3692 KB |
Output is correct |
160 |
Correct |
3248 ms |
3696 KB |
Output is correct |
161 |
Correct |
3962 ms |
3756 KB |
Output is correct |
162 |
Correct |
3851 ms |
3616 KB |
Output is correct |
163 |
Correct |
4082 ms |
3564 KB |
Output is correct |
164 |
Correct |
3852 ms |
3604 KB |
Output is correct |
165 |
Correct |
3809 ms |
3552 KB |
Output is correct |
166 |
Correct |
5155 ms |
3312 KB |
Output is correct |
167 |
Correct |
5158 ms |
3256 KB |
Output is correct |
168 |
Correct |
5141 ms |
3264 KB |
Output is correct |
169 |
Correct |
5214 ms |
3324 KB |
Output is correct |
170 |
Correct |
5405 ms |
3284 KB |
Output is correct |
171 |
Correct |
6564 ms |
3416 KB |
Output is correct |
172 |
Correct |
6357 ms |
3428 KB |
Output is correct |
173 |
Correct |
6204 ms |
3536 KB |
Output is correct |
174 |
Correct |
6823 ms |
3544 KB |
Output is correct |
175 |
Correct |
6168 ms |
3588 KB |
Output is correct |