//Challenge: Accepted
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
#ifdef zisk
void debug(){cout << endl;}
template<class T, class ... U> void debug(T a, U ... b){cout << a << " ", debug(b...);}
template<class T> void pary(T l, T r) {
while (l != r) cout << *l << " ", l++;
cout << endl;
}
#else
#define debug(...) 0
#define pary(...) 0
#endif
#define ll long long
#define maxn 300005
#define mod 998244353
#define pii pair<int, int>
#define ff first
#define ss second
#define io ios_base::sync_with_stdio(0);cin.tie(0);
const int bs = 1300;
struct query{
int l, r, id;
query(){l = r = id = 0;}
query(int a, int b, int c){l = a, r = b, id = c;}
};
int a[maxn], c[maxn], occ[maxn];
int lef[maxn], rig[maxn];
ll ans[maxn];
int distinct = 0;
void add(int col) {
int &p = c[col];
if (p == 0) distinct++;
if (occ[p] == 1) {
if (occ[p+1]) {
rig[lef[p]] = rig[p];
lef[rig[p]] = lef[p];
} else {
rig[lef[p]] = p+1;
lef[rig[p]] = p+1;
rig[p+1] = rig[p];
lef[p+1] = lef[p];
}
lef[p] = 0, rig[p] = maxn-1;
} else if (occ[p+1]==0) {
rig[p+1] = rig[p];
lef[p+1] = p;
lef[rig[p]] = p+1;
rig[p] = p+1;
}
occ[p]--, occ[p+1]++;
p++;
}
void del(int col) {
int &p = c[col];
if (p == 1) distinct--;
if (occ[p] == 1) {
if (occ[p-1]) {
rig[lef[p]] = rig[p];
lef[rig[p]] = lef[p];
} else {
rig[lef[p]] = p-1;
lef[rig[p]] = p-1;
rig[p-1] = rig[p];
lef[p-1] = lef[p];
}
lef[p] = 0, rig[p] = maxn-1;
} else if (occ[p-1]==0) {
rig[p-1] = p;
lef[p-1] = lef[p];
rig[lef[p]] = p-1;
lef[p] = p-1;
}
occ[p]--, occ[p-1]++;
p--;
}
int tot;
ll quad[maxn], cube[maxn];
ll getval(ll A, ll P, ll K) { //sum of A^2 + (A+P)^2 + ... + (A+(K-1)P)^2 + A + (A+P) + ... + (A + (K-1)P)
return K * A * (A+1) + quad[K] * (2*A+1) * P + cube[K] * P * P;
}
ll getans() {
int cur = rig[0];
ll ret = 0;
ll lc = 0, rc = 0;
while (cur <= tot) {
if (lc > rc) {
swap(lc, rc);
}
ll p = cur;
//debug(cur, occ[p]);
ll pl = (occ[p] + 1)/2, pr = occ[p] / 2;
ret += getval(lc, p, pl) + getval(rc, p, pr);
ret += getval(tot - lc - p * pl, p, pl) + getval(tot - rc - p * pr, p, pr);
lc += pl * p, rc += pr * p;
cur = rig[cur];
}
return ret / 2;
}
int main() {
io
for (ll i = 1;i < maxn;i++) {
quad[i] = i * (i-1) / 2;
cube[i] = (i-1) * i * (2 * i - 1) / 6;
}
ll n, q;
cin >> n >> q;
for (int i = 0;i < n;i++) {
cin >> a[i];
}
for (int i = 0;i <= n;i++) rig[i] = maxn-1;
occ[0] = maxn-1;
vector<query> que;
for (int i = 0;i < q;i++) {
int l, r;
cin >> l >> r;
l--, r--;
que.push_back(query(l, r, i));
}
sort(que.begin(), que.end(), [&](query x, query y){
return x.l / bs == y.l / bs ? ((x.l / bs & 1) ? x.r < y.r : x.r > y.r) : (x.l < y.l);});
int cl = 0, cr = -1;
for (auto [l, r, id]:que) {
while (cr < r) add(a[++cr]);
while (cl > l) add(a[--cl]);
while (cr > r) del(a[cr--]);
while (cl < l) del(a[cl++]);
ans[id] = quad[r - l + 2] * distinct;
tot = r - l + 1;
ans[id] -= getans();
}
for (int i = 0;i < q;i++) cout << ans[i] << "\n";
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
4948 KB |
Output is correct |
2 |
Correct |
3 ms |
5024 KB |
Output is correct |
3 |
Correct |
3 ms |
5024 KB |
Output is correct |
4 |
Correct |
3 ms |
4948 KB |
Output is correct |
5 |
Correct |
3 ms |
4948 KB |
Output is correct |
6 |
Correct |
3 ms |
4948 KB |
Output is correct |
7 |
Correct |
3 ms |
4948 KB |
Output is correct |
8 |
Correct |
3 ms |
4948 KB |
Output is correct |
9 |
Correct |
3 ms |
4948 KB |
Output is correct |
10 |
Correct |
3 ms |
4948 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
5028 KB |
Output is correct |
2 |
Correct |
3 ms |
4948 KB |
Output is correct |
3 |
Correct |
4 ms |
5076 KB |
Output is correct |
4 |
Correct |
9 ms |
6064 KB |
Output is correct |
5 |
Correct |
18 ms |
7256 KB |
Output is correct |
6 |
Correct |
22 ms |
7892 KB |
Output is correct |
7 |
Correct |
21 ms |
8728 KB |
Output is correct |
8 |
Correct |
20 ms |
7884 KB |
Output is correct |
9 |
Correct |
20 ms |
7904 KB |
Output is correct |
10 |
Correct |
21 ms |
8224 KB |
Output is correct |
11 |
Correct |
21 ms |
8036 KB |
Output is correct |
12 |
Correct |
22 ms |
7876 KB |
Output is correct |
13 |
Correct |
21 ms |
7884 KB |
Output is correct |
14 |
Correct |
27 ms |
8052 KB |
Output is correct |
15 |
Correct |
21 ms |
8056 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
5028 KB |
Output is correct |
2 |
Correct |
3 ms |
4948 KB |
Output is correct |
3 |
Correct |
4 ms |
5076 KB |
Output is correct |
4 |
Correct |
9 ms |
6064 KB |
Output is correct |
5 |
Correct |
18 ms |
7256 KB |
Output is correct |
6 |
Correct |
22 ms |
7892 KB |
Output is correct |
7 |
Correct |
21 ms |
8728 KB |
Output is correct |
8 |
Correct |
20 ms |
7884 KB |
Output is correct |
9 |
Correct |
20 ms |
7904 KB |
Output is correct |
10 |
Correct |
21 ms |
8224 KB |
Output is correct |
11 |
Correct |
21 ms |
8036 KB |
Output is correct |
12 |
Correct |
22 ms |
7876 KB |
Output is correct |
13 |
Correct |
21 ms |
7884 KB |
Output is correct |
14 |
Correct |
27 ms |
8052 KB |
Output is correct |
15 |
Correct |
21 ms |
8056 KB |
Output is correct |
16 |
Correct |
3 ms |
4948 KB |
Output is correct |
17 |
Correct |
3 ms |
5028 KB |
Output is correct |
18 |
Correct |
3 ms |
5164 KB |
Output is correct |
19 |
Correct |
13 ms |
6100 KB |
Output is correct |
20 |
Correct |
15 ms |
6968 KB |
Output is correct |
21 |
Correct |
29 ms |
7928 KB |
Output is correct |
22 |
Correct |
24 ms |
7788 KB |
Output is correct |
23 |
Correct |
25 ms |
7816 KB |
Output is correct |
24 |
Correct |
24 ms |
7756 KB |
Output is correct |
25 |
Correct |
23 ms |
7736 KB |
Output is correct |
26 |
Correct |
22 ms |
7756 KB |
Output is correct |
27 |
Correct |
22 ms |
7764 KB |
Output is correct |
28 |
Correct |
22 ms |
7996 KB |
Output is correct |
29 |
Correct |
22 ms |
7800 KB |
Output is correct |
30 |
Correct |
21 ms |
7756 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
5028 KB |
Output is correct |
2 |
Correct |
3 ms |
4948 KB |
Output is correct |
3 |
Correct |
4 ms |
5076 KB |
Output is correct |
4 |
Correct |
9 ms |
6064 KB |
Output is correct |
5 |
Correct |
18 ms |
7256 KB |
Output is correct |
6 |
Correct |
22 ms |
7892 KB |
Output is correct |
7 |
Correct |
21 ms |
8728 KB |
Output is correct |
8 |
Correct |
20 ms |
7884 KB |
Output is correct |
9 |
Correct |
20 ms |
7904 KB |
Output is correct |
10 |
Correct |
21 ms |
8224 KB |
Output is correct |
11 |
Correct |
21 ms |
8036 KB |
Output is correct |
12 |
Correct |
22 ms |
7876 KB |
Output is correct |
13 |
Correct |
21 ms |
7884 KB |
Output is correct |
14 |
Correct |
27 ms |
8052 KB |
Output is correct |
15 |
Correct |
21 ms |
8056 KB |
Output is correct |
16 |
Correct |
3 ms |
4948 KB |
Output is correct |
17 |
Correct |
3 ms |
5028 KB |
Output is correct |
18 |
Correct |
3 ms |
5164 KB |
Output is correct |
19 |
Correct |
13 ms |
6100 KB |
Output is correct |
20 |
Correct |
15 ms |
6968 KB |
Output is correct |
21 |
Correct |
29 ms |
7928 KB |
Output is correct |
22 |
Correct |
24 ms |
7788 KB |
Output is correct |
23 |
Correct |
25 ms |
7816 KB |
Output is correct |
24 |
Correct |
24 ms |
7756 KB |
Output is correct |
25 |
Correct |
23 ms |
7736 KB |
Output is correct |
26 |
Correct |
22 ms |
7756 KB |
Output is correct |
27 |
Correct |
22 ms |
7764 KB |
Output is correct |
28 |
Correct |
22 ms |
7996 KB |
Output is correct |
29 |
Correct |
22 ms |
7800 KB |
Output is correct |
30 |
Correct |
21 ms |
7756 KB |
Output is correct |
31 |
Correct |
3 ms |
5032 KB |
Output is correct |
32 |
Correct |
3 ms |
4948 KB |
Output is correct |
33 |
Correct |
3 ms |
5076 KB |
Output is correct |
34 |
Correct |
5 ms |
5076 KB |
Output is correct |
35 |
Correct |
4 ms |
5076 KB |
Output is correct |
36 |
Correct |
4 ms |
5076 KB |
Output is correct |
37 |
Correct |
10 ms |
5556 KB |
Output is correct |
38 |
Correct |
6 ms |
5460 KB |
Output is correct |
39 |
Correct |
11 ms |
5904 KB |
Output is correct |
40 |
Correct |
19 ms |
6700 KB |
Output is correct |
41 |
Correct |
24 ms |
7500 KB |
Output is correct |
42 |
Correct |
24 ms |
7500 KB |
Output is correct |
43 |
Correct |
24 ms |
7468 KB |
Output is correct |
44 |
Correct |
23 ms |
7464 KB |
Output is correct |
45 |
Correct |
26 ms |
7440 KB |
Output is correct |
46 |
Correct |
28 ms |
7504 KB |
Output is correct |
47 |
Correct |
25 ms |
7544 KB |
Output is correct |
48 |
Correct |
28 ms |
7456 KB |
Output is correct |
49 |
Correct |
25 ms |
7432 KB |
Output is correct |
50 |
Correct |
23 ms |
7508 KB |
Output is correct |
51 |
Correct |
23 ms |
7500 KB |
Output is correct |
52 |
Correct |
23 ms |
7436 KB |
Output is correct |
53 |
Correct |
26 ms |
7472 KB |
Output is correct |
54 |
Correct |
24 ms |
7508 KB |
Output is correct |
55 |
Correct |
25 ms |
7520 KB |
Output is correct |
56 |
Correct |
25 ms |
7492 KB |
Output is correct |
57 |
Correct |
24 ms |
7408 KB |
Output is correct |
58 |
Correct |
24 ms |
7544 KB |
Output is correct |
59 |
Correct |
24 ms |
7532 KB |
Output is correct |
60 |
Correct |
23 ms |
7520 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
4948 KB |
Output is correct |
2 |
Correct |
3 ms |
5024 KB |
Output is correct |
3 |
Correct |
3 ms |
5024 KB |
Output is correct |
4 |
Correct |
3 ms |
4948 KB |
Output is correct |
5 |
Correct |
3 ms |
4948 KB |
Output is correct |
6 |
Correct |
3 ms |
4948 KB |
Output is correct |
7 |
Correct |
3 ms |
4948 KB |
Output is correct |
8 |
Correct |
3 ms |
4948 KB |
Output is correct |
9 |
Correct |
3 ms |
4948 KB |
Output is correct |
10 |
Correct |
3 ms |
4948 KB |
Output is correct |
11 |
Correct |
3 ms |
5028 KB |
Output is correct |
12 |
Correct |
3 ms |
4948 KB |
Output is correct |
13 |
Correct |
4 ms |
5076 KB |
Output is correct |
14 |
Correct |
9 ms |
6064 KB |
Output is correct |
15 |
Correct |
18 ms |
7256 KB |
Output is correct |
16 |
Correct |
22 ms |
7892 KB |
Output is correct |
17 |
Correct |
21 ms |
8728 KB |
Output is correct |
18 |
Correct |
20 ms |
7884 KB |
Output is correct |
19 |
Correct |
20 ms |
7904 KB |
Output is correct |
20 |
Correct |
21 ms |
8224 KB |
Output is correct |
21 |
Correct |
21 ms |
8036 KB |
Output is correct |
22 |
Correct |
22 ms |
7876 KB |
Output is correct |
23 |
Correct |
21 ms |
7884 KB |
Output is correct |
24 |
Correct |
27 ms |
8052 KB |
Output is correct |
25 |
Correct |
21 ms |
8056 KB |
Output is correct |
26 |
Correct |
3 ms |
4948 KB |
Output is correct |
27 |
Correct |
3 ms |
5028 KB |
Output is correct |
28 |
Correct |
3 ms |
5164 KB |
Output is correct |
29 |
Correct |
13 ms |
6100 KB |
Output is correct |
30 |
Correct |
15 ms |
6968 KB |
Output is correct |
31 |
Correct |
29 ms |
7928 KB |
Output is correct |
32 |
Correct |
24 ms |
7788 KB |
Output is correct |
33 |
Correct |
25 ms |
7816 KB |
Output is correct |
34 |
Correct |
24 ms |
7756 KB |
Output is correct |
35 |
Correct |
23 ms |
7736 KB |
Output is correct |
36 |
Correct |
22 ms |
7756 KB |
Output is correct |
37 |
Correct |
22 ms |
7764 KB |
Output is correct |
38 |
Correct |
22 ms |
7996 KB |
Output is correct |
39 |
Correct |
22 ms |
7800 KB |
Output is correct |
40 |
Correct |
21 ms |
7756 KB |
Output is correct |
41 |
Correct |
3 ms |
5032 KB |
Output is correct |
42 |
Correct |
3 ms |
4948 KB |
Output is correct |
43 |
Correct |
3 ms |
5076 KB |
Output is correct |
44 |
Correct |
5 ms |
5076 KB |
Output is correct |
45 |
Correct |
4 ms |
5076 KB |
Output is correct |
46 |
Correct |
4 ms |
5076 KB |
Output is correct |
47 |
Correct |
10 ms |
5556 KB |
Output is correct |
48 |
Correct |
6 ms |
5460 KB |
Output is correct |
49 |
Correct |
11 ms |
5904 KB |
Output is correct |
50 |
Correct |
19 ms |
6700 KB |
Output is correct |
51 |
Correct |
24 ms |
7500 KB |
Output is correct |
52 |
Correct |
24 ms |
7500 KB |
Output is correct |
53 |
Correct |
24 ms |
7468 KB |
Output is correct |
54 |
Correct |
23 ms |
7464 KB |
Output is correct |
55 |
Correct |
26 ms |
7440 KB |
Output is correct |
56 |
Correct |
28 ms |
7504 KB |
Output is correct |
57 |
Correct |
25 ms |
7544 KB |
Output is correct |
58 |
Correct |
28 ms |
7456 KB |
Output is correct |
59 |
Correct |
25 ms |
7432 KB |
Output is correct |
60 |
Correct |
23 ms |
7508 KB |
Output is correct |
61 |
Correct |
23 ms |
7500 KB |
Output is correct |
62 |
Correct |
23 ms |
7436 KB |
Output is correct |
63 |
Correct |
26 ms |
7472 KB |
Output is correct |
64 |
Correct |
24 ms |
7508 KB |
Output is correct |
65 |
Correct |
25 ms |
7520 KB |
Output is correct |
66 |
Correct |
25 ms |
7492 KB |
Output is correct |
67 |
Correct |
24 ms |
7408 KB |
Output is correct |
68 |
Correct |
24 ms |
7544 KB |
Output is correct |
69 |
Correct |
24 ms |
7532 KB |
Output is correct |
70 |
Correct |
23 ms |
7520 KB |
Output is correct |
71 |
Correct |
7 ms |
5516 KB |
Output is correct |
72 |
Correct |
7 ms |
5548 KB |
Output is correct |
73 |
Correct |
7 ms |
5548 KB |
Output is correct |
74 |
Correct |
7 ms |
5544 KB |
Output is correct |
75 |
Correct |
7 ms |
5460 KB |
Output is correct |
76 |
Correct |
11 ms |
6004 KB |
Output is correct |
77 |
Correct |
13 ms |
5972 KB |
Output is correct |
78 |
Correct |
11 ms |
5976 KB |
Output is correct |
79 |
Correct |
15 ms |
5884 KB |
Output is correct |
80 |
Correct |
10 ms |
5972 KB |
Output is correct |
81 |
Correct |
17 ms |
6708 KB |
Output is correct |
82 |
Correct |
17 ms |
6692 KB |
Output is correct |
83 |
Correct |
17 ms |
6740 KB |
Output is correct |
84 |
Correct |
17 ms |
6704 KB |
Output is correct |
85 |
Correct |
17 ms |
6692 KB |
Output is correct |
86 |
Correct |
26 ms |
6744 KB |
Output is correct |
87 |
Correct |
22 ms |
6796 KB |
Output is correct |
88 |
Correct |
23 ms |
6848 KB |
Output is correct |
89 |
Correct |
19 ms |
6740 KB |
Output is correct |
90 |
Correct |
19 ms |
6696 KB |
Output is correct |
91 |
Correct |
31 ms |
7928 KB |
Output is correct |
92 |
Correct |
26 ms |
7852 KB |
Output is correct |
93 |
Correct |
29 ms |
7840 KB |
Output is correct |
94 |
Correct |
34 ms |
7864 KB |
Output is correct |
95 |
Correct |
30 ms |
7932 KB |
Output is correct |
96 |
Correct |
40 ms |
8400 KB |
Output is correct |
97 |
Correct |
44 ms |
8292 KB |
Output is correct |
98 |
Correct |
32 ms |
8372 KB |
Output is correct |
99 |
Correct |
32 ms |
8360 KB |
Output is correct |
100 |
Correct |
36 ms |
8360 KB |
Output is correct |
101 |
Correct |
33 ms |
8404 KB |
Output is correct |
102 |
Correct |
37 ms |
8384 KB |
Output is correct |
103 |
Correct |
38 ms |
8536 KB |
Output is correct |
104 |
Correct |
36 ms |
8328 KB |
Output is correct |
105 |
Correct |
31 ms |
8380 KB |
Output is correct |
106 |
Correct |
33 ms |
8604 KB |
Output is correct |
107 |
Correct |
42 ms |
8560 KB |
Output is correct |
108 |
Correct |
32 ms |
8500 KB |
Output is correct |
109 |
Correct |
38 ms |
8536 KB |
Output is correct |
110 |
Correct |
33 ms |
8524 KB |
Output is correct |
111 |
Correct |
32 ms |
8496 KB |
Output is correct |
112 |
Correct |
31 ms |
8608 KB |
Output is correct |
113 |
Correct |
33 ms |
8536 KB |
Output is correct |
114 |
Correct |
34 ms |
8608 KB |
Output is correct |
115 |
Correct |
34 ms |
8592 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
4948 KB |
Output is correct |
2 |
Correct |
3 ms |
5024 KB |
Output is correct |
3 |
Correct |
3 ms |
5024 KB |
Output is correct |
4 |
Correct |
3 ms |
4948 KB |
Output is correct |
5 |
Correct |
3 ms |
4948 KB |
Output is correct |
6 |
Correct |
3 ms |
4948 KB |
Output is correct |
7 |
Correct |
3 ms |
4948 KB |
Output is correct |
8 |
Correct |
3 ms |
4948 KB |
Output is correct |
9 |
Correct |
3 ms |
4948 KB |
Output is correct |
10 |
Correct |
3 ms |
4948 KB |
Output is correct |
11 |
Correct |
3 ms |
5028 KB |
Output is correct |
12 |
Correct |
3 ms |
4948 KB |
Output is correct |
13 |
Correct |
4 ms |
5076 KB |
Output is correct |
14 |
Correct |
9 ms |
6064 KB |
Output is correct |
15 |
Correct |
18 ms |
7256 KB |
Output is correct |
16 |
Correct |
22 ms |
7892 KB |
Output is correct |
17 |
Correct |
21 ms |
8728 KB |
Output is correct |
18 |
Correct |
20 ms |
7884 KB |
Output is correct |
19 |
Correct |
20 ms |
7904 KB |
Output is correct |
20 |
Correct |
21 ms |
8224 KB |
Output is correct |
21 |
Correct |
21 ms |
8036 KB |
Output is correct |
22 |
Correct |
22 ms |
7876 KB |
Output is correct |
23 |
Correct |
21 ms |
7884 KB |
Output is correct |
24 |
Correct |
27 ms |
8052 KB |
Output is correct |
25 |
Correct |
21 ms |
8056 KB |
Output is correct |
26 |
Correct |
3 ms |
4948 KB |
Output is correct |
27 |
Correct |
3 ms |
5028 KB |
Output is correct |
28 |
Correct |
3 ms |
5164 KB |
Output is correct |
29 |
Correct |
13 ms |
6100 KB |
Output is correct |
30 |
Correct |
15 ms |
6968 KB |
Output is correct |
31 |
Correct |
29 ms |
7928 KB |
Output is correct |
32 |
Correct |
24 ms |
7788 KB |
Output is correct |
33 |
Correct |
25 ms |
7816 KB |
Output is correct |
34 |
Correct |
24 ms |
7756 KB |
Output is correct |
35 |
Correct |
23 ms |
7736 KB |
Output is correct |
36 |
Correct |
22 ms |
7756 KB |
Output is correct |
37 |
Correct |
22 ms |
7764 KB |
Output is correct |
38 |
Correct |
22 ms |
7996 KB |
Output is correct |
39 |
Correct |
22 ms |
7800 KB |
Output is correct |
40 |
Correct |
21 ms |
7756 KB |
Output is correct |
41 |
Correct |
3 ms |
5032 KB |
Output is correct |
42 |
Correct |
3 ms |
4948 KB |
Output is correct |
43 |
Correct |
3 ms |
5076 KB |
Output is correct |
44 |
Correct |
5 ms |
5076 KB |
Output is correct |
45 |
Correct |
4 ms |
5076 KB |
Output is correct |
46 |
Correct |
4 ms |
5076 KB |
Output is correct |
47 |
Correct |
10 ms |
5556 KB |
Output is correct |
48 |
Correct |
6 ms |
5460 KB |
Output is correct |
49 |
Correct |
11 ms |
5904 KB |
Output is correct |
50 |
Correct |
19 ms |
6700 KB |
Output is correct |
51 |
Correct |
24 ms |
7500 KB |
Output is correct |
52 |
Correct |
24 ms |
7500 KB |
Output is correct |
53 |
Correct |
24 ms |
7468 KB |
Output is correct |
54 |
Correct |
23 ms |
7464 KB |
Output is correct |
55 |
Correct |
26 ms |
7440 KB |
Output is correct |
56 |
Correct |
28 ms |
7504 KB |
Output is correct |
57 |
Correct |
25 ms |
7544 KB |
Output is correct |
58 |
Correct |
28 ms |
7456 KB |
Output is correct |
59 |
Correct |
25 ms |
7432 KB |
Output is correct |
60 |
Correct |
23 ms |
7508 KB |
Output is correct |
61 |
Correct |
23 ms |
7500 KB |
Output is correct |
62 |
Correct |
23 ms |
7436 KB |
Output is correct |
63 |
Correct |
26 ms |
7472 KB |
Output is correct |
64 |
Correct |
24 ms |
7508 KB |
Output is correct |
65 |
Correct |
25 ms |
7520 KB |
Output is correct |
66 |
Correct |
25 ms |
7492 KB |
Output is correct |
67 |
Correct |
24 ms |
7408 KB |
Output is correct |
68 |
Correct |
24 ms |
7544 KB |
Output is correct |
69 |
Correct |
24 ms |
7532 KB |
Output is correct |
70 |
Correct |
23 ms |
7520 KB |
Output is correct |
71 |
Correct |
7 ms |
5516 KB |
Output is correct |
72 |
Correct |
7 ms |
5548 KB |
Output is correct |
73 |
Correct |
7 ms |
5548 KB |
Output is correct |
74 |
Correct |
7 ms |
5544 KB |
Output is correct |
75 |
Correct |
7 ms |
5460 KB |
Output is correct |
76 |
Correct |
11 ms |
6004 KB |
Output is correct |
77 |
Correct |
13 ms |
5972 KB |
Output is correct |
78 |
Correct |
11 ms |
5976 KB |
Output is correct |
79 |
Correct |
15 ms |
5884 KB |
Output is correct |
80 |
Correct |
10 ms |
5972 KB |
Output is correct |
81 |
Correct |
17 ms |
6708 KB |
Output is correct |
82 |
Correct |
17 ms |
6692 KB |
Output is correct |
83 |
Correct |
17 ms |
6740 KB |
Output is correct |
84 |
Correct |
17 ms |
6704 KB |
Output is correct |
85 |
Correct |
17 ms |
6692 KB |
Output is correct |
86 |
Correct |
26 ms |
6744 KB |
Output is correct |
87 |
Correct |
22 ms |
6796 KB |
Output is correct |
88 |
Correct |
23 ms |
6848 KB |
Output is correct |
89 |
Correct |
19 ms |
6740 KB |
Output is correct |
90 |
Correct |
19 ms |
6696 KB |
Output is correct |
91 |
Correct |
31 ms |
7928 KB |
Output is correct |
92 |
Correct |
26 ms |
7852 KB |
Output is correct |
93 |
Correct |
29 ms |
7840 KB |
Output is correct |
94 |
Correct |
34 ms |
7864 KB |
Output is correct |
95 |
Correct |
30 ms |
7932 KB |
Output is correct |
96 |
Correct |
40 ms |
8400 KB |
Output is correct |
97 |
Correct |
44 ms |
8292 KB |
Output is correct |
98 |
Correct |
32 ms |
8372 KB |
Output is correct |
99 |
Correct |
32 ms |
8360 KB |
Output is correct |
100 |
Correct |
36 ms |
8360 KB |
Output is correct |
101 |
Correct |
33 ms |
8404 KB |
Output is correct |
102 |
Correct |
37 ms |
8384 KB |
Output is correct |
103 |
Correct |
38 ms |
8536 KB |
Output is correct |
104 |
Correct |
36 ms |
8328 KB |
Output is correct |
105 |
Correct |
31 ms |
8380 KB |
Output is correct |
106 |
Correct |
33 ms |
8604 KB |
Output is correct |
107 |
Correct |
42 ms |
8560 KB |
Output is correct |
108 |
Correct |
32 ms |
8500 KB |
Output is correct |
109 |
Correct |
38 ms |
8536 KB |
Output is correct |
110 |
Correct |
33 ms |
8524 KB |
Output is correct |
111 |
Correct |
32 ms |
8496 KB |
Output is correct |
112 |
Correct |
31 ms |
8608 KB |
Output is correct |
113 |
Correct |
33 ms |
8536 KB |
Output is correct |
114 |
Correct |
34 ms |
8608 KB |
Output is correct |
115 |
Correct |
34 ms |
8592 KB |
Output is correct |
116 |
Correct |
292 ms |
6748 KB |
Output is correct |
117 |
Correct |
303 ms |
6708 KB |
Output is correct |
118 |
Correct |
344 ms |
7204 KB |
Output is correct |
119 |
Correct |
308 ms |
7184 KB |
Output is correct |
120 |
Correct |
259 ms |
7184 KB |
Output is correct |
121 |
Correct |
340 ms |
7580 KB |
Output is correct |
122 |
Correct |
274 ms |
7676 KB |
Output is correct |
123 |
Correct |
538 ms |
8496 KB |
Output is correct |
124 |
Correct |
370 ms |
8500 KB |
Output is correct |
125 |
Correct |
359 ms |
8520 KB |
Output is correct |
126 |
Correct |
892 ms |
9248 KB |
Output is correct |
127 |
Correct |
900 ms |
9244 KB |
Output is correct |
128 |
Correct |
888 ms |
9344 KB |
Output is correct |
129 |
Correct |
884 ms |
9232 KB |
Output is correct |
130 |
Correct |
932 ms |
9220 KB |
Output is correct |
131 |
Correct |
995 ms |
9384 KB |
Output is correct |
132 |
Correct |
1010 ms |
9384 KB |
Output is correct |
133 |
Correct |
1010 ms |
9504 KB |
Output is correct |
134 |
Correct |
1054 ms |
9512 KB |
Output is correct |
135 |
Correct |
1082 ms |
9524 KB |
Output is correct |
136 |
Correct |
1046 ms |
9532 KB |
Output is correct |
137 |
Correct |
1060 ms |
9532 KB |
Output is correct |
138 |
Correct |
1049 ms |
9532 KB |
Output is correct |
139 |
Correct |
1039 ms |
9500 KB |
Output is correct |
140 |
Correct |
1080 ms |
9516 KB |
Output is correct |
141 |
Correct |
891 ms |
9528 KB |
Output is correct |
142 |
Correct |
923 ms |
9516 KB |
Output is correct |
143 |
Correct |
926 ms |
9544 KB |
Output is correct |
144 |
Correct |
921 ms |
9536 KB |
Output is correct |
145 |
Correct |
902 ms |
9536 KB |
Output is correct |
146 |
Correct |
560 ms |
9660 KB |
Output is correct |
147 |
Correct |
537 ms |
9632 KB |
Output is correct |
148 |
Correct |
583 ms |
9668 KB |
Output is correct |
149 |
Correct |
563 ms |
9668 KB |
Output is correct |
150 |
Correct |
564 ms |
9672 KB |
Output is correct |
151 |
Correct |
557 ms |
9684 KB |
Output is correct |
152 |
Correct |
541 ms |
9680 KB |
Output is correct |
153 |
Correct |
587 ms |
9676 KB |
Output is correct |
154 |
Correct |
555 ms |
9676 KB |
Output is correct |
155 |
Correct |
506 ms |
9664 KB |
Output is correct |
156 |
Correct |
986 ms |
10064 KB |
Output is correct |
157 |
Correct |
993 ms |
10112 KB |
Output is correct |
158 |
Correct |
1040 ms |
9972 KB |
Output is correct |
159 |
Correct |
1018 ms |
9976 KB |
Output is correct |
160 |
Correct |
1027 ms |
9996 KB |
Output is correct |
161 |
Correct |
881 ms |
10152 KB |
Output is correct |
162 |
Correct |
850 ms |
10012 KB |
Output is correct |
163 |
Correct |
830 ms |
9984 KB |
Output is correct |
164 |
Correct |
843 ms |
10004 KB |
Output is correct |
165 |
Correct |
849 ms |
9956 KB |
Output is correct |
166 |
Correct |
902 ms |
9848 KB |
Output is correct |
167 |
Correct |
934 ms |
9740 KB |
Output is correct |
168 |
Correct |
923 ms |
9752 KB |
Output is correct |
169 |
Correct |
939 ms |
9820 KB |
Output is correct |
170 |
Correct |
905 ms |
9772 KB |
Output is correct |
171 |
Correct |
896 ms |
9632 KB |
Output is correct |
172 |
Correct |
896 ms |
9672 KB |
Output is correct |
173 |
Correct |
879 ms |
9632 KB |
Output is correct |
174 |
Correct |
888 ms |
9648 KB |
Output is correct |
175 |
Correct |
898 ms |
9684 KB |
Output is correct |