#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(S.find(cnt[i]));
cnt2[cnt[i]]--;
cnt[i] += diff;
if (cnt2[cnt[i]] == 0) S.insert(cnt[i]);
cnt2[cnt[i]]++;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cin >> n >> q; b = 1000;
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);
vector< pair<int, ll> > v;
for (auto iter = S.begin(); iter != S.end(); iter++) {
v.emplace_back(*iter, cnt2[*iter]);
}
sort(v.begin(), v.end());
int sz = v.size(), p = sz + 1, q = sz, tot = 0;
for (int i = sz - 1; i >= 0; i--) {
ll sm = (v[i].second)/2, la = v[i].second - sm;
if (tot % 2 == 0) {
reord[--p] = make_pair(v[i].first, sm);
reord[++q] = make_pair(v[i].first, la);
}
else {
reord[--p] = make_pair(v[i].first, la);
reord[++q] = make_pair(v[i].first, sm);
}
tot += v[i].second;
}
ll res = 0, sum = 0, xsum = 0, s = 0;
for (int i = p; i <= q; i++) {
ll a = reord[i].first, k = reord[i].second;
//cout << a << " " << k << "\n";
res += k * a * (a + 1) / 2;
res += a * a * k * (k + 1) * (k + 2) / 6 - a * a * k;
res += a * k * (2 * s + k + 3) / 2 * sum;
res -= a * k * xsum;
sum += a * k;
xsum += a * k * (2 * s + k + 1) / 2;
s += k;
}
ans[Q[i].idx] = res;
}
for (int i = 1; i <= q; i++) cout << ans[i] << "\n";
return 0;
}
# |
Verdict |
Execution time |
Memory |
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 |
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 |
1 ms |
340 KB |
Output is correct |
9 |
Correct |
1 ms |
340 KB |
Output is correct |
10 |
Correct |
0 ms |
340 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
3 |
Correct |
2 ms |
340 KB |
Output is correct |
4 |
Correct |
14 ms |
956 KB |
Output is correct |
5 |
Correct |
28 ms |
1704 KB |
Output is correct |
6 |
Correct |
35 ms |
1964 KB |
Output is correct |
7 |
Correct |
33 ms |
2776 KB |
Output is correct |
8 |
Correct |
43 ms |
1912 KB |
Output is correct |
9 |
Correct |
43 ms |
1932 KB |
Output is correct |
10 |
Correct |
42 ms |
2236 KB |
Output is correct |
11 |
Correct |
31 ms |
2004 KB |
Output is correct |
12 |
Correct |
32 ms |
1856 KB |
Output is correct |
13 |
Correct |
43 ms |
1796 KB |
Output is correct |
14 |
Correct |
39 ms |
2024 KB |
Output is correct |
15 |
Correct |
30 ms |
2052 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
3 |
Correct |
2 ms |
340 KB |
Output is correct |
4 |
Correct |
14 ms |
956 KB |
Output is correct |
5 |
Correct |
28 ms |
1704 KB |
Output is correct |
6 |
Correct |
35 ms |
1964 KB |
Output is correct |
7 |
Correct |
33 ms |
2776 KB |
Output is correct |
8 |
Correct |
43 ms |
1912 KB |
Output is correct |
9 |
Correct |
43 ms |
1932 KB |
Output is correct |
10 |
Correct |
42 ms |
2236 KB |
Output is correct |
11 |
Correct |
31 ms |
2004 KB |
Output is correct |
12 |
Correct |
32 ms |
1856 KB |
Output is correct |
13 |
Correct |
43 ms |
1796 KB |
Output is correct |
14 |
Correct |
39 ms |
2024 KB |
Output is correct |
15 |
Correct |
30 ms |
2052 KB |
Output is correct |
16 |
Correct |
0 ms |
340 KB |
Output is correct |
17 |
Correct |
1 ms |
340 KB |
Output is correct |
18 |
Correct |
2 ms |
340 KB |
Output is correct |
19 |
Correct |
14 ms |
852 KB |
Output is correct |
20 |
Correct |
29 ms |
1316 KB |
Output is correct |
21 |
Correct |
31 ms |
1924 KB |
Output is correct |
22 |
Correct |
31 ms |
1736 KB |
Output is correct |
23 |
Correct |
44 ms |
1920 KB |
Output is correct |
24 |
Correct |
31 ms |
1740 KB |
Output is correct |
25 |
Correct |
31 ms |
1864 KB |
Output is correct |
26 |
Correct |
42 ms |
1796 KB |
Output is correct |
27 |
Correct |
42 ms |
1780 KB |
Output is correct |
28 |
Correct |
44 ms |
2096 KB |
Output is correct |
29 |
Correct |
44 ms |
1740 KB |
Output is correct |
30 |
Correct |
31 ms |
1832 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
3 |
Correct |
2 ms |
340 KB |
Output is correct |
4 |
Correct |
14 ms |
956 KB |
Output is correct |
5 |
Correct |
28 ms |
1704 KB |
Output is correct |
6 |
Correct |
35 ms |
1964 KB |
Output is correct |
7 |
Correct |
33 ms |
2776 KB |
Output is correct |
8 |
Correct |
43 ms |
1912 KB |
Output is correct |
9 |
Correct |
43 ms |
1932 KB |
Output is correct |
10 |
Correct |
42 ms |
2236 KB |
Output is correct |
11 |
Correct |
31 ms |
2004 KB |
Output is correct |
12 |
Correct |
32 ms |
1856 KB |
Output is correct |
13 |
Correct |
43 ms |
1796 KB |
Output is correct |
14 |
Correct |
39 ms |
2024 KB |
Output is correct |
15 |
Correct |
30 ms |
2052 KB |
Output is correct |
16 |
Correct |
0 ms |
340 KB |
Output is correct |
17 |
Correct |
1 ms |
340 KB |
Output is correct |
18 |
Correct |
2 ms |
340 KB |
Output is correct |
19 |
Correct |
14 ms |
852 KB |
Output is correct |
20 |
Correct |
29 ms |
1316 KB |
Output is correct |
21 |
Correct |
31 ms |
1924 KB |
Output is correct |
22 |
Correct |
31 ms |
1736 KB |
Output is correct |
23 |
Correct |
44 ms |
1920 KB |
Output is correct |
24 |
Correct |
31 ms |
1740 KB |
Output is correct |
25 |
Correct |
31 ms |
1864 KB |
Output is correct |
26 |
Correct |
42 ms |
1796 KB |
Output is correct |
27 |
Correct |
42 ms |
1780 KB |
Output is correct |
28 |
Correct |
44 ms |
2096 KB |
Output is correct |
29 |
Correct |
44 ms |
1740 KB |
Output is correct |
30 |
Correct |
31 ms |
1832 KB |
Output is correct |
31 |
Correct |
1 ms |
340 KB |
Output is correct |
32 |
Correct |
1 ms |
340 KB |
Output is correct |
33 |
Correct |
0 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 |
6 ms |
468 KB |
Output is correct |
38 |
Correct |
3 ms |
468 KB |
Output is correct |
39 |
Correct |
10 ms |
752 KB |
Output is correct |
40 |
Correct |
14 ms |
1124 KB |
Output is correct |
41 |
Correct |
21 ms |
1508 KB |
Output is correct |
42 |
Correct |
33 ms |
1612 KB |
Output is correct |
43 |
Correct |
33 ms |
1608 KB |
Output is correct |
44 |
Correct |
33 ms |
1664 KB |
Output is correct |
45 |
Correct |
32 ms |
1540 KB |
Output is correct |
46 |
Correct |
21 ms |
1564 KB |
Output is correct |
47 |
Correct |
21 ms |
1528 KB |
Output is correct |
48 |
Correct |
33 ms |
1564 KB |
Output is correct |
49 |
Correct |
21 ms |
1620 KB |
Output is correct |
50 |
Correct |
33 ms |
1572 KB |
Output is correct |
51 |
Correct |
28 ms |
1596 KB |
Output is correct |
52 |
Correct |
22 ms |
1552 KB |
Output is correct |
53 |
Correct |
33 ms |
1580 KB |
Output is correct |
54 |
Correct |
21 ms |
1636 KB |
Output is correct |
55 |
Correct |
32 ms |
1560 KB |
Output is correct |
56 |
Correct |
22 ms |
1576 KB |
Output is correct |
57 |
Correct |
21 ms |
1560 KB |
Output is correct |
58 |
Correct |
21 ms |
1544 KB |
Output is correct |
59 |
Correct |
30 ms |
1552 KB |
Output is correct |
60 |
Correct |
22 ms |
1568 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
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 |
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 |
1 ms |
340 KB |
Output is correct |
9 |
Correct |
1 ms |
340 KB |
Output is correct |
10 |
Correct |
0 ms |
340 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 |
340 KB |
Output is correct |
14 |
Correct |
14 ms |
956 KB |
Output is correct |
15 |
Correct |
28 ms |
1704 KB |
Output is correct |
16 |
Correct |
35 ms |
1964 KB |
Output is correct |
17 |
Correct |
33 ms |
2776 KB |
Output is correct |
18 |
Correct |
43 ms |
1912 KB |
Output is correct |
19 |
Correct |
43 ms |
1932 KB |
Output is correct |
20 |
Correct |
42 ms |
2236 KB |
Output is correct |
21 |
Correct |
31 ms |
2004 KB |
Output is correct |
22 |
Correct |
32 ms |
1856 KB |
Output is correct |
23 |
Correct |
43 ms |
1796 KB |
Output is correct |
24 |
Correct |
39 ms |
2024 KB |
Output is correct |
25 |
Correct |
30 ms |
2052 KB |
Output is correct |
26 |
Correct |
0 ms |
340 KB |
Output is correct |
27 |
Correct |
1 ms |
340 KB |
Output is correct |
28 |
Correct |
2 ms |
340 KB |
Output is correct |
29 |
Correct |
14 ms |
852 KB |
Output is correct |
30 |
Correct |
29 ms |
1316 KB |
Output is correct |
31 |
Correct |
31 ms |
1924 KB |
Output is correct |
32 |
Correct |
31 ms |
1736 KB |
Output is correct |
33 |
Correct |
44 ms |
1920 KB |
Output is correct |
34 |
Correct |
31 ms |
1740 KB |
Output is correct |
35 |
Correct |
31 ms |
1864 KB |
Output is correct |
36 |
Correct |
42 ms |
1796 KB |
Output is correct |
37 |
Correct |
42 ms |
1780 KB |
Output is correct |
38 |
Correct |
44 ms |
2096 KB |
Output is correct |
39 |
Correct |
44 ms |
1740 KB |
Output is correct |
40 |
Correct |
31 ms |
1832 KB |
Output is correct |
41 |
Correct |
1 ms |
340 KB |
Output is correct |
42 |
Correct |
1 ms |
340 KB |
Output is correct |
43 |
Correct |
0 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 |
6 ms |
468 KB |
Output is correct |
48 |
Correct |
3 ms |
468 KB |
Output is correct |
49 |
Correct |
10 ms |
752 KB |
Output is correct |
50 |
Correct |
14 ms |
1124 KB |
Output is correct |
51 |
Correct |
21 ms |
1508 KB |
Output is correct |
52 |
Correct |
33 ms |
1612 KB |
Output is correct |
53 |
Correct |
33 ms |
1608 KB |
Output is correct |
54 |
Correct |
33 ms |
1664 KB |
Output is correct |
55 |
Correct |
32 ms |
1540 KB |
Output is correct |
56 |
Correct |
21 ms |
1564 KB |
Output is correct |
57 |
Correct |
21 ms |
1528 KB |
Output is correct |
58 |
Correct |
33 ms |
1564 KB |
Output is correct |
59 |
Correct |
21 ms |
1620 KB |
Output is correct |
60 |
Correct |
33 ms |
1572 KB |
Output is correct |
61 |
Correct |
28 ms |
1596 KB |
Output is correct |
62 |
Correct |
22 ms |
1552 KB |
Output is correct |
63 |
Correct |
33 ms |
1580 KB |
Output is correct |
64 |
Correct |
21 ms |
1636 KB |
Output is correct |
65 |
Correct |
32 ms |
1560 KB |
Output is correct |
66 |
Correct |
22 ms |
1576 KB |
Output is correct |
67 |
Correct |
21 ms |
1560 KB |
Output is correct |
68 |
Correct |
21 ms |
1544 KB |
Output is correct |
69 |
Correct |
30 ms |
1552 KB |
Output is correct |
70 |
Correct |
22 ms |
1568 KB |
Output is correct |
71 |
Correct |
3 ms |
468 KB |
Output is correct |
72 |
Correct |
5 ms |
468 KB |
Output is correct |
73 |
Correct |
5 ms |
468 KB |
Output is correct |
74 |
Correct |
3 ms |
468 KB |
Output is correct |
75 |
Correct |
5 ms |
468 KB |
Output is correct |
76 |
Correct |
6 ms |
724 KB |
Output is correct |
77 |
Correct |
10 ms |
724 KB |
Output is correct |
78 |
Correct |
6 ms |
724 KB |
Output is correct |
79 |
Correct |
10 ms |
756 KB |
Output is correct |
80 |
Correct |
10 ms |
724 KB |
Output is correct |
81 |
Correct |
18 ms |
1128 KB |
Output is correct |
82 |
Correct |
12 ms |
1228 KB |
Output is correct |
83 |
Correct |
12 ms |
1236 KB |
Output is correct |
84 |
Correct |
18 ms |
1236 KB |
Output is correct |
85 |
Correct |
12 ms |
1124 KB |
Output is correct |
86 |
Correct |
21 ms |
1252 KB |
Output is correct |
87 |
Correct |
13 ms |
1236 KB |
Output is correct |
88 |
Correct |
15 ms |
1292 KB |
Output is correct |
89 |
Correct |
13 ms |
1296 KB |
Output is correct |
90 |
Correct |
13 ms |
1236 KB |
Output is correct |
91 |
Correct |
23 ms |
2204 KB |
Output is correct |
92 |
Correct |
20 ms |
2200 KB |
Output is correct |
93 |
Correct |
21 ms |
2244 KB |
Output is correct |
94 |
Correct |
19 ms |
2320 KB |
Output is correct |
95 |
Correct |
21 ms |
2244 KB |
Output is correct |
96 |
Correct |
34 ms |
3080 KB |
Output is correct |
97 |
Correct |
33 ms |
2968 KB |
Output is correct |
98 |
Correct |
34 ms |
3088 KB |
Output is correct |
99 |
Correct |
22 ms |
2968 KB |
Output is correct |
100 |
Correct |
22 ms |
3028 KB |
Output is correct |
101 |
Correct |
22 ms |
3044 KB |
Output is correct |
102 |
Correct |
34 ms |
3064 KB |
Output is correct |
103 |
Correct |
22 ms |
3028 KB |
Output is correct |
104 |
Correct |
22 ms |
2984 KB |
Output is correct |
105 |
Correct |
22 ms |
2960 KB |
Output is correct |
106 |
Correct |
34 ms |
3440 KB |
Output is correct |
107 |
Correct |
22 ms |
3404 KB |
Output is correct |
108 |
Correct |
22 ms |
3412 KB |
Output is correct |
109 |
Correct |
22 ms |
3412 KB |
Output is correct |
110 |
Correct |
22 ms |
3476 KB |
Output is correct |
111 |
Correct |
23 ms |
3452 KB |
Output is correct |
112 |
Correct |
22 ms |
3360 KB |
Output is correct |
113 |
Correct |
34 ms |
3460 KB |
Output is correct |
114 |
Correct |
22 ms |
3436 KB |
Output is correct |
115 |
Correct |
34 ms |
3412 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
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 |
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 |
1 ms |
340 KB |
Output is correct |
9 |
Correct |
1 ms |
340 KB |
Output is correct |
10 |
Correct |
0 ms |
340 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 |
340 KB |
Output is correct |
14 |
Correct |
14 ms |
956 KB |
Output is correct |
15 |
Correct |
28 ms |
1704 KB |
Output is correct |
16 |
Correct |
35 ms |
1964 KB |
Output is correct |
17 |
Correct |
33 ms |
2776 KB |
Output is correct |
18 |
Correct |
43 ms |
1912 KB |
Output is correct |
19 |
Correct |
43 ms |
1932 KB |
Output is correct |
20 |
Correct |
42 ms |
2236 KB |
Output is correct |
21 |
Correct |
31 ms |
2004 KB |
Output is correct |
22 |
Correct |
32 ms |
1856 KB |
Output is correct |
23 |
Correct |
43 ms |
1796 KB |
Output is correct |
24 |
Correct |
39 ms |
2024 KB |
Output is correct |
25 |
Correct |
30 ms |
2052 KB |
Output is correct |
26 |
Correct |
0 ms |
340 KB |
Output is correct |
27 |
Correct |
1 ms |
340 KB |
Output is correct |
28 |
Correct |
2 ms |
340 KB |
Output is correct |
29 |
Correct |
14 ms |
852 KB |
Output is correct |
30 |
Correct |
29 ms |
1316 KB |
Output is correct |
31 |
Correct |
31 ms |
1924 KB |
Output is correct |
32 |
Correct |
31 ms |
1736 KB |
Output is correct |
33 |
Correct |
44 ms |
1920 KB |
Output is correct |
34 |
Correct |
31 ms |
1740 KB |
Output is correct |
35 |
Correct |
31 ms |
1864 KB |
Output is correct |
36 |
Correct |
42 ms |
1796 KB |
Output is correct |
37 |
Correct |
42 ms |
1780 KB |
Output is correct |
38 |
Correct |
44 ms |
2096 KB |
Output is correct |
39 |
Correct |
44 ms |
1740 KB |
Output is correct |
40 |
Correct |
31 ms |
1832 KB |
Output is correct |
41 |
Correct |
1 ms |
340 KB |
Output is correct |
42 |
Correct |
1 ms |
340 KB |
Output is correct |
43 |
Correct |
0 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 |
6 ms |
468 KB |
Output is correct |
48 |
Correct |
3 ms |
468 KB |
Output is correct |
49 |
Correct |
10 ms |
752 KB |
Output is correct |
50 |
Correct |
14 ms |
1124 KB |
Output is correct |
51 |
Correct |
21 ms |
1508 KB |
Output is correct |
52 |
Correct |
33 ms |
1612 KB |
Output is correct |
53 |
Correct |
33 ms |
1608 KB |
Output is correct |
54 |
Correct |
33 ms |
1664 KB |
Output is correct |
55 |
Correct |
32 ms |
1540 KB |
Output is correct |
56 |
Correct |
21 ms |
1564 KB |
Output is correct |
57 |
Correct |
21 ms |
1528 KB |
Output is correct |
58 |
Correct |
33 ms |
1564 KB |
Output is correct |
59 |
Correct |
21 ms |
1620 KB |
Output is correct |
60 |
Correct |
33 ms |
1572 KB |
Output is correct |
61 |
Correct |
28 ms |
1596 KB |
Output is correct |
62 |
Correct |
22 ms |
1552 KB |
Output is correct |
63 |
Correct |
33 ms |
1580 KB |
Output is correct |
64 |
Correct |
21 ms |
1636 KB |
Output is correct |
65 |
Correct |
32 ms |
1560 KB |
Output is correct |
66 |
Correct |
22 ms |
1576 KB |
Output is correct |
67 |
Correct |
21 ms |
1560 KB |
Output is correct |
68 |
Correct |
21 ms |
1544 KB |
Output is correct |
69 |
Correct |
30 ms |
1552 KB |
Output is correct |
70 |
Correct |
22 ms |
1568 KB |
Output is correct |
71 |
Correct |
3 ms |
468 KB |
Output is correct |
72 |
Correct |
5 ms |
468 KB |
Output is correct |
73 |
Correct |
5 ms |
468 KB |
Output is correct |
74 |
Correct |
3 ms |
468 KB |
Output is correct |
75 |
Correct |
5 ms |
468 KB |
Output is correct |
76 |
Correct |
6 ms |
724 KB |
Output is correct |
77 |
Correct |
10 ms |
724 KB |
Output is correct |
78 |
Correct |
6 ms |
724 KB |
Output is correct |
79 |
Correct |
10 ms |
756 KB |
Output is correct |
80 |
Correct |
10 ms |
724 KB |
Output is correct |
81 |
Correct |
18 ms |
1128 KB |
Output is correct |
82 |
Correct |
12 ms |
1228 KB |
Output is correct |
83 |
Correct |
12 ms |
1236 KB |
Output is correct |
84 |
Correct |
18 ms |
1236 KB |
Output is correct |
85 |
Correct |
12 ms |
1124 KB |
Output is correct |
86 |
Correct |
21 ms |
1252 KB |
Output is correct |
87 |
Correct |
13 ms |
1236 KB |
Output is correct |
88 |
Correct |
15 ms |
1292 KB |
Output is correct |
89 |
Correct |
13 ms |
1296 KB |
Output is correct |
90 |
Correct |
13 ms |
1236 KB |
Output is correct |
91 |
Correct |
23 ms |
2204 KB |
Output is correct |
92 |
Correct |
20 ms |
2200 KB |
Output is correct |
93 |
Correct |
21 ms |
2244 KB |
Output is correct |
94 |
Correct |
19 ms |
2320 KB |
Output is correct |
95 |
Correct |
21 ms |
2244 KB |
Output is correct |
96 |
Correct |
34 ms |
3080 KB |
Output is correct |
97 |
Correct |
33 ms |
2968 KB |
Output is correct |
98 |
Correct |
34 ms |
3088 KB |
Output is correct |
99 |
Correct |
22 ms |
2968 KB |
Output is correct |
100 |
Correct |
22 ms |
3028 KB |
Output is correct |
101 |
Correct |
22 ms |
3044 KB |
Output is correct |
102 |
Correct |
34 ms |
3064 KB |
Output is correct |
103 |
Correct |
22 ms |
3028 KB |
Output is correct |
104 |
Correct |
22 ms |
2984 KB |
Output is correct |
105 |
Correct |
22 ms |
2960 KB |
Output is correct |
106 |
Correct |
34 ms |
3440 KB |
Output is correct |
107 |
Correct |
22 ms |
3404 KB |
Output is correct |
108 |
Correct |
22 ms |
3412 KB |
Output is correct |
109 |
Correct |
22 ms |
3412 KB |
Output is correct |
110 |
Correct |
22 ms |
3476 KB |
Output is correct |
111 |
Correct |
23 ms |
3452 KB |
Output is correct |
112 |
Correct |
22 ms |
3360 KB |
Output is correct |
113 |
Correct |
34 ms |
3460 KB |
Output is correct |
114 |
Correct |
22 ms |
3436 KB |
Output is correct |
115 |
Correct |
34 ms |
3412 KB |
Output is correct |
116 |
Correct |
786 ms |
1868 KB |
Output is correct |
117 |
Correct |
525 ms |
1740 KB |
Output is correct |
118 |
Correct |
990 ms |
2052 KB |
Output is correct |
119 |
Correct |
484 ms |
2052 KB |
Output is correct |
120 |
Correct |
295 ms |
2052 KB |
Output is correct |
121 |
Correct |
599 ms |
2272 KB |
Output is correct |
122 |
Correct |
339 ms |
2264 KB |
Output is correct |
123 |
Correct |
1314 ms |
2804 KB |
Output is correct |
124 |
Correct |
476 ms |
2808 KB |
Output is correct |
125 |
Correct |
343 ms |
2832 KB |
Output is correct |
126 |
Correct |
4226 ms |
3112 KB |
Output is correct |
127 |
Correct |
4220 ms |
3092 KB |
Output is correct |
128 |
Correct |
4236 ms |
3116 KB |
Output is correct |
129 |
Correct |
4257 ms |
3080 KB |
Output is correct |
130 |
Correct |
4127 ms |
3084 KB |
Output is correct |
131 |
Correct |
3898 ms |
3200 KB |
Output is correct |
132 |
Correct |
3812 ms |
3212 KB |
Output is correct |
133 |
Correct |
3973 ms |
3208 KB |
Output is correct |
134 |
Correct |
3871 ms |
3208 KB |
Output is correct |
135 |
Correct |
3832 ms |
3208 KB |
Output is correct |
136 |
Correct |
3649 ms |
3224 KB |
Output is correct |
137 |
Correct |
3799 ms |
3208 KB |
Output is correct |
138 |
Correct |
3621 ms |
3228 KB |
Output is correct |
139 |
Correct |
3786 ms |
3208 KB |
Output is correct |
140 |
Correct |
3794 ms |
3224 KB |
Output is correct |
141 |
Correct |
2314 ms |
3232 KB |
Output is correct |
142 |
Correct |
2439 ms |
3228 KB |
Output is correct |
143 |
Correct |
2384 ms |
3228 KB |
Output is correct |
144 |
Correct |
2351 ms |
3236 KB |
Output is correct |
145 |
Correct |
2353 ms |
3148 KB |
Output is correct |
146 |
Correct |
825 ms |
3212 KB |
Output is correct |
147 |
Correct |
802 ms |
3212 KB |
Output is correct |
148 |
Correct |
823 ms |
3216 KB |
Output is correct |
149 |
Correct |
807 ms |
3208 KB |
Output is correct |
150 |
Correct |
832 ms |
3212 KB |
Output is correct |
151 |
Correct |
642 ms |
3224 KB |
Output is correct |
152 |
Correct |
643 ms |
3268 KB |
Output is correct |
153 |
Correct |
656 ms |
3228 KB |
Output is correct |
154 |
Correct |
630 ms |
3220 KB |
Output is correct |
155 |
Correct |
649 ms |
3228 KB |
Output is correct |
156 |
Correct |
2277 ms |
3780 KB |
Output is correct |
157 |
Correct |
2289 ms |
3828 KB |
Output is correct |
158 |
Correct |
2284 ms |
3684 KB |
Output is correct |
159 |
Correct |
2236 ms |
3700 KB |
Output is correct |
160 |
Correct |
2213 ms |
3704 KB |
Output is correct |
161 |
Correct |
2611 ms |
3752 KB |
Output is correct |
162 |
Correct |
2556 ms |
3616 KB |
Output is correct |
163 |
Correct |
2695 ms |
3572 KB |
Output is correct |
164 |
Correct |
2524 ms |
3612 KB |
Output is correct |
165 |
Correct |
2597 ms |
3544 KB |
Output is correct |
166 |
Correct |
3568 ms |
3288 KB |
Output is correct |
167 |
Correct |
3508 ms |
3272 KB |
Output is correct |
168 |
Correct |
3519 ms |
3276 KB |
Output is correct |
169 |
Correct |
3615 ms |
3336 KB |
Output is correct |
170 |
Correct |
3565 ms |
3296 KB |
Output is correct |
171 |
Correct |
4346 ms |
3156 KB |
Output is correct |
172 |
Correct |
4299 ms |
3160 KB |
Output is correct |
173 |
Correct |
4304 ms |
3160 KB |
Output is correct |
174 |
Correct |
4300 ms |
3180 KB |
Output is correct |
175 |
Correct |
4362 ms |
3212 KB |
Output is correct |