//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 = 1100;
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) + (tot - K*P-A)*(tot-K*P-A+1)) + quad[K] * (2*(tot-K*P+1)) * P + 2*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);
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 |
4948 KB |
Output is correct |
4 |
Correct |
3 ms |
4948 KB |
Output is correct |
5 |
Correct |
3 ms |
5024 KB |
Output is correct |
6 |
Correct |
3 ms |
4948 KB |
Output is correct |
7 |
Correct |
3 ms |
4988 KB |
Output is correct |
8 |
Correct |
3 ms |
5020 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 |
4 ms |
5032 KB |
Output is correct |
3 |
Correct |
4 ms |
5076 KB |
Output is correct |
4 |
Correct |
9 ms |
6100 KB |
Output is correct |
5 |
Correct |
15 ms |
7260 KB |
Output is correct |
6 |
Correct |
22 ms |
7972 KB |
Output is correct |
7 |
Correct |
22 ms |
8856 KB |
Output is correct |
8 |
Correct |
21 ms |
7924 KB |
Output is correct |
9 |
Correct |
22 ms |
7932 KB |
Output is correct |
10 |
Correct |
22 ms |
8328 KB |
Output is correct |
11 |
Correct |
24 ms |
8084 KB |
Output is correct |
12 |
Correct |
22 ms |
8052 KB |
Output is correct |
13 |
Correct |
21 ms |
7980 KB |
Output is correct |
14 |
Correct |
21 ms |
8140 KB |
Output is correct |
15 |
Correct |
23 ms |
8068 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
5028 KB |
Output is correct |
2 |
Correct |
4 ms |
5032 KB |
Output is correct |
3 |
Correct |
4 ms |
5076 KB |
Output is correct |
4 |
Correct |
9 ms |
6100 KB |
Output is correct |
5 |
Correct |
15 ms |
7260 KB |
Output is correct |
6 |
Correct |
22 ms |
7972 KB |
Output is correct |
7 |
Correct |
22 ms |
8856 KB |
Output is correct |
8 |
Correct |
21 ms |
7924 KB |
Output is correct |
9 |
Correct |
22 ms |
7932 KB |
Output is correct |
10 |
Correct |
22 ms |
8328 KB |
Output is correct |
11 |
Correct |
24 ms |
8084 KB |
Output is correct |
12 |
Correct |
22 ms |
8052 KB |
Output is correct |
13 |
Correct |
21 ms |
7980 KB |
Output is correct |
14 |
Correct |
21 ms |
8140 KB |
Output is correct |
15 |
Correct |
23 ms |
8068 KB |
Output is correct |
16 |
Correct |
4 ms |
4948 KB |
Output is correct |
17 |
Correct |
3 ms |
4948 KB |
Output is correct |
18 |
Correct |
4 ms |
5076 KB |
Output is correct |
19 |
Correct |
10 ms |
6064 KB |
Output is correct |
20 |
Correct |
17 ms |
6996 KB |
Output is correct |
21 |
Correct |
27 ms |
8012 KB |
Output is correct |
22 |
Correct |
33 ms |
7844 KB |
Output is correct |
23 |
Correct |
22 ms |
7980 KB |
Output is correct |
24 |
Correct |
22 ms |
7920 KB |
Output is correct |
25 |
Correct |
24 ms |
7864 KB |
Output is correct |
26 |
Correct |
23 ms |
7892 KB |
Output is correct |
27 |
Correct |
32 ms |
7884 KB |
Output is correct |
28 |
Correct |
31 ms |
8140 KB |
Output is correct |
29 |
Correct |
26 ms |
7912 KB |
Output is correct |
30 |
Correct |
23 ms |
7880 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
5028 KB |
Output is correct |
2 |
Correct |
4 ms |
5032 KB |
Output is correct |
3 |
Correct |
4 ms |
5076 KB |
Output is correct |
4 |
Correct |
9 ms |
6100 KB |
Output is correct |
5 |
Correct |
15 ms |
7260 KB |
Output is correct |
6 |
Correct |
22 ms |
7972 KB |
Output is correct |
7 |
Correct |
22 ms |
8856 KB |
Output is correct |
8 |
Correct |
21 ms |
7924 KB |
Output is correct |
9 |
Correct |
22 ms |
7932 KB |
Output is correct |
10 |
Correct |
22 ms |
8328 KB |
Output is correct |
11 |
Correct |
24 ms |
8084 KB |
Output is correct |
12 |
Correct |
22 ms |
8052 KB |
Output is correct |
13 |
Correct |
21 ms |
7980 KB |
Output is correct |
14 |
Correct |
21 ms |
8140 KB |
Output is correct |
15 |
Correct |
23 ms |
8068 KB |
Output is correct |
16 |
Correct |
4 ms |
4948 KB |
Output is correct |
17 |
Correct |
3 ms |
4948 KB |
Output is correct |
18 |
Correct |
4 ms |
5076 KB |
Output is correct |
19 |
Correct |
10 ms |
6064 KB |
Output is correct |
20 |
Correct |
17 ms |
6996 KB |
Output is correct |
21 |
Correct |
27 ms |
8012 KB |
Output is correct |
22 |
Correct |
33 ms |
7844 KB |
Output is correct |
23 |
Correct |
22 ms |
7980 KB |
Output is correct |
24 |
Correct |
22 ms |
7920 KB |
Output is correct |
25 |
Correct |
24 ms |
7864 KB |
Output is correct |
26 |
Correct |
23 ms |
7892 KB |
Output is correct |
27 |
Correct |
32 ms |
7884 KB |
Output is correct |
28 |
Correct |
31 ms |
8140 KB |
Output is correct |
29 |
Correct |
26 ms |
7912 KB |
Output is correct |
30 |
Correct |
23 ms |
7880 KB |
Output is correct |
31 |
Correct |
4 ms |
4948 KB |
Output is correct |
32 |
Correct |
3 ms |
5076 KB |
Output is correct |
33 |
Correct |
3 ms |
4948 KB |
Output is correct |
34 |
Correct |
5 ms |
5044 KB |
Output is correct |
35 |
Correct |
5 ms |
5088 KB |
Output is correct |
36 |
Correct |
3 ms |
5076 KB |
Output is correct |
37 |
Correct |
10 ms |
5588 KB |
Output is correct |
38 |
Correct |
6 ms |
5588 KB |
Output is correct |
39 |
Correct |
9 ms |
6100 KB |
Output is correct |
40 |
Correct |
18 ms |
7252 KB |
Output is correct |
41 |
Correct |
33 ms |
8024 KB |
Output is correct |
42 |
Correct |
26 ms |
8020 KB |
Output is correct |
43 |
Correct |
29 ms |
8024 KB |
Output is correct |
44 |
Correct |
26 ms |
8036 KB |
Output is correct |
45 |
Correct |
26 ms |
7992 KB |
Output is correct |
46 |
Correct |
25 ms |
8012 KB |
Output is correct |
47 |
Correct |
29 ms |
7964 KB |
Output is correct |
48 |
Correct |
30 ms |
8024 KB |
Output is correct |
49 |
Correct |
28 ms |
7936 KB |
Output is correct |
50 |
Correct |
24 ms |
7916 KB |
Output is correct |
51 |
Correct |
24 ms |
8012 KB |
Output is correct |
52 |
Correct |
35 ms |
7948 KB |
Output is correct |
53 |
Correct |
24 ms |
8020 KB |
Output is correct |
54 |
Correct |
27 ms |
7944 KB |
Output is correct |
55 |
Correct |
30 ms |
7976 KB |
Output is correct |
56 |
Correct |
25 ms |
7980 KB |
Output is correct |
57 |
Correct |
26 ms |
7976 KB |
Output is correct |
58 |
Correct |
25 ms |
7960 KB |
Output is correct |
59 |
Correct |
26 ms |
8036 KB |
Output is correct |
60 |
Correct |
25 ms |
7932 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 |
4948 KB |
Output is correct |
4 |
Correct |
3 ms |
4948 KB |
Output is correct |
5 |
Correct |
3 ms |
5024 KB |
Output is correct |
6 |
Correct |
3 ms |
4948 KB |
Output is correct |
7 |
Correct |
3 ms |
4988 KB |
Output is correct |
8 |
Correct |
3 ms |
5020 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 |
4 ms |
5032 KB |
Output is correct |
13 |
Correct |
4 ms |
5076 KB |
Output is correct |
14 |
Correct |
9 ms |
6100 KB |
Output is correct |
15 |
Correct |
15 ms |
7260 KB |
Output is correct |
16 |
Correct |
22 ms |
7972 KB |
Output is correct |
17 |
Correct |
22 ms |
8856 KB |
Output is correct |
18 |
Correct |
21 ms |
7924 KB |
Output is correct |
19 |
Correct |
22 ms |
7932 KB |
Output is correct |
20 |
Correct |
22 ms |
8328 KB |
Output is correct |
21 |
Correct |
24 ms |
8084 KB |
Output is correct |
22 |
Correct |
22 ms |
8052 KB |
Output is correct |
23 |
Correct |
21 ms |
7980 KB |
Output is correct |
24 |
Correct |
21 ms |
8140 KB |
Output is correct |
25 |
Correct |
23 ms |
8068 KB |
Output is correct |
26 |
Correct |
4 ms |
4948 KB |
Output is correct |
27 |
Correct |
3 ms |
4948 KB |
Output is correct |
28 |
Correct |
4 ms |
5076 KB |
Output is correct |
29 |
Correct |
10 ms |
6064 KB |
Output is correct |
30 |
Correct |
17 ms |
6996 KB |
Output is correct |
31 |
Correct |
27 ms |
8012 KB |
Output is correct |
32 |
Correct |
33 ms |
7844 KB |
Output is correct |
33 |
Correct |
22 ms |
7980 KB |
Output is correct |
34 |
Correct |
22 ms |
7920 KB |
Output is correct |
35 |
Correct |
24 ms |
7864 KB |
Output is correct |
36 |
Correct |
23 ms |
7892 KB |
Output is correct |
37 |
Correct |
32 ms |
7884 KB |
Output is correct |
38 |
Correct |
31 ms |
8140 KB |
Output is correct |
39 |
Correct |
26 ms |
7912 KB |
Output is correct |
40 |
Correct |
23 ms |
7880 KB |
Output is correct |
41 |
Correct |
4 ms |
4948 KB |
Output is correct |
42 |
Correct |
3 ms |
5076 KB |
Output is correct |
43 |
Correct |
3 ms |
4948 KB |
Output is correct |
44 |
Correct |
5 ms |
5044 KB |
Output is correct |
45 |
Correct |
5 ms |
5088 KB |
Output is correct |
46 |
Correct |
3 ms |
5076 KB |
Output is correct |
47 |
Correct |
10 ms |
5588 KB |
Output is correct |
48 |
Correct |
6 ms |
5588 KB |
Output is correct |
49 |
Correct |
9 ms |
6100 KB |
Output is correct |
50 |
Correct |
18 ms |
7252 KB |
Output is correct |
51 |
Correct |
33 ms |
8024 KB |
Output is correct |
52 |
Correct |
26 ms |
8020 KB |
Output is correct |
53 |
Correct |
29 ms |
8024 KB |
Output is correct |
54 |
Correct |
26 ms |
8036 KB |
Output is correct |
55 |
Correct |
26 ms |
7992 KB |
Output is correct |
56 |
Correct |
25 ms |
8012 KB |
Output is correct |
57 |
Correct |
29 ms |
7964 KB |
Output is correct |
58 |
Correct |
30 ms |
8024 KB |
Output is correct |
59 |
Correct |
28 ms |
7936 KB |
Output is correct |
60 |
Correct |
24 ms |
7916 KB |
Output is correct |
61 |
Correct |
24 ms |
8012 KB |
Output is correct |
62 |
Correct |
35 ms |
7948 KB |
Output is correct |
63 |
Correct |
24 ms |
8020 KB |
Output is correct |
64 |
Correct |
27 ms |
7944 KB |
Output is correct |
65 |
Correct |
30 ms |
7976 KB |
Output is correct |
66 |
Correct |
25 ms |
7980 KB |
Output is correct |
67 |
Correct |
26 ms |
7976 KB |
Output is correct |
68 |
Correct |
25 ms |
7960 KB |
Output is correct |
69 |
Correct |
26 ms |
8036 KB |
Output is correct |
70 |
Correct |
25 ms |
7932 KB |
Output is correct |
71 |
Correct |
8 ms |
5588 KB |
Output is correct |
72 |
Correct |
6 ms |
5604 KB |
Output is correct |
73 |
Correct |
7 ms |
5588 KB |
Output is correct |
74 |
Correct |
7 ms |
5552 KB |
Output is correct |
75 |
Correct |
7 ms |
5608 KB |
Output is correct |
76 |
Correct |
10 ms |
6248 KB |
Output is correct |
77 |
Correct |
10 ms |
6228 KB |
Output is correct |
78 |
Correct |
11 ms |
6268 KB |
Output is correct |
79 |
Correct |
10 ms |
6256 KB |
Output is correct |
80 |
Correct |
16 ms |
6220 KB |
Output is correct |
81 |
Correct |
20 ms |
7256 KB |
Output is correct |
82 |
Correct |
27 ms |
7196 KB |
Output is correct |
83 |
Correct |
19 ms |
7228 KB |
Output is correct |
84 |
Correct |
20 ms |
7244 KB |
Output is correct |
85 |
Correct |
19 ms |
7220 KB |
Output is correct |
86 |
Correct |
28 ms |
7232 KB |
Output is correct |
87 |
Correct |
20 ms |
7212 KB |
Output is correct |
88 |
Correct |
27 ms |
7248 KB |
Output is correct |
89 |
Correct |
20 ms |
7280 KB |
Output is correct |
90 |
Correct |
20 ms |
7308 KB |
Output is correct |
91 |
Correct |
31 ms |
8424 KB |
Output is correct |
92 |
Correct |
30 ms |
8360 KB |
Output is correct |
93 |
Correct |
30 ms |
8356 KB |
Output is correct |
94 |
Correct |
28 ms |
8396 KB |
Output is correct |
95 |
Correct |
34 ms |
8468 KB |
Output is correct |
96 |
Correct |
36 ms |
8972 KB |
Output is correct |
97 |
Correct |
44 ms |
9016 KB |
Output is correct |
98 |
Correct |
36 ms |
8908 KB |
Output is correct |
99 |
Correct |
40 ms |
8940 KB |
Output is correct |
100 |
Correct |
32 ms |
8928 KB |
Output is correct |
101 |
Correct |
34 ms |
8896 KB |
Output is correct |
102 |
Correct |
45 ms |
9008 KB |
Output is correct |
103 |
Correct |
34 ms |
8976 KB |
Output is correct |
104 |
Correct |
33 ms |
8944 KB |
Output is correct |
105 |
Correct |
33 ms |
8980 KB |
Output is correct |
106 |
Correct |
34 ms |
9180 KB |
Output is correct |
107 |
Correct |
45 ms |
9216 KB |
Output is correct |
108 |
Correct |
35 ms |
9216 KB |
Output is correct |
109 |
Correct |
37 ms |
9188 KB |
Output is correct |
110 |
Correct |
34 ms |
9148 KB |
Output is correct |
111 |
Correct |
33 ms |
9164 KB |
Output is correct |
112 |
Correct |
34 ms |
9224 KB |
Output is correct |
113 |
Correct |
36 ms |
9140 KB |
Output is correct |
114 |
Correct |
34 ms |
9152 KB |
Output is correct |
115 |
Correct |
34 ms |
9164 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 |
4948 KB |
Output is correct |
4 |
Correct |
3 ms |
4948 KB |
Output is correct |
5 |
Correct |
3 ms |
5024 KB |
Output is correct |
6 |
Correct |
3 ms |
4948 KB |
Output is correct |
7 |
Correct |
3 ms |
4988 KB |
Output is correct |
8 |
Correct |
3 ms |
5020 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 |
4 ms |
5032 KB |
Output is correct |
13 |
Correct |
4 ms |
5076 KB |
Output is correct |
14 |
Correct |
9 ms |
6100 KB |
Output is correct |
15 |
Correct |
15 ms |
7260 KB |
Output is correct |
16 |
Correct |
22 ms |
7972 KB |
Output is correct |
17 |
Correct |
22 ms |
8856 KB |
Output is correct |
18 |
Correct |
21 ms |
7924 KB |
Output is correct |
19 |
Correct |
22 ms |
7932 KB |
Output is correct |
20 |
Correct |
22 ms |
8328 KB |
Output is correct |
21 |
Correct |
24 ms |
8084 KB |
Output is correct |
22 |
Correct |
22 ms |
8052 KB |
Output is correct |
23 |
Correct |
21 ms |
7980 KB |
Output is correct |
24 |
Correct |
21 ms |
8140 KB |
Output is correct |
25 |
Correct |
23 ms |
8068 KB |
Output is correct |
26 |
Correct |
4 ms |
4948 KB |
Output is correct |
27 |
Correct |
3 ms |
4948 KB |
Output is correct |
28 |
Correct |
4 ms |
5076 KB |
Output is correct |
29 |
Correct |
10 ms |
6064 KB |
Output is correct |
30 |
Correct |
17 ms |
6996 KB |
Output is correct |
31 |
Correct |
27 ms |
8012 KB |
Output is correct |
32 |
Correct |
33 ms |
7844 KB |
Output is correct |
33 |
Correct |
22 ms |
7980 KB |
Output is correct |
34 |
Correct |
22 ms |
7920 KB |
Output is correct |
35 |
Correct |
24 ms |
7864 KB |
Output is correct |
36 |
Correct |
23 ms |
7892 KB |
Output is correct |
37 |
Correct |
32 ms |
7884 KB |
Output is correct |
38 |
Correct |
31 ms |
8140 KB |
Output is correct |
39 |
Correct |
26 ms |
7912 KB |
Output is correct |
40 |
Correct |
23 ms |
7880 KB |
Output is correct |
41 |
Correct |
4 ms |
4948 KB |
Output is correct |
42 |
Correct |
3 ms |
5076 KB |
Output is correct |
43 |
Correct |
3 ms |
4948 KB |
Output is correct |
44 |
Correct |
5 ms |
5044 KB |
Output is correct |
45 |
Correct |
5 ms |
5088 KB |
Output is correct |
46 |
Correct |
3 ms |
5076 KB |
Output is correct |
47 |
Correct |
10 ms |
5588 KB |
Output is correct |
48 |
Correct |
6 ms |
5588 KB |
Output is correct |
49 |
Correct |
9 ms |
6100 KB |
Output is correct |
50 |
Correct |
18 ms |
7252 KB |
Output is correct |
51 |
Correct |
33 ms |
8024 KB |
Output is correct |
52 |
Correct |
26 ms |
8020 KB |
Output is correct |
53 |
Correct |
29 ms |
8024 KB |
Output is correct |
54 |
Correct |
26 ms |
8036 KB |
Output is correct |
55 |
Correct |
26 ms |
7992 KB |
Output is correct |
56 |
Correct |
25 ms |
8012 KB |
Output is correct |
57 |
Correct |
29 ms |
7964 KB |
Output is correct |
58 |
Correct |
30 ms |
8024 KB |
Output is correct |
59 |
Correct |
28 ms |
7936 KB |
Output is correct |
60 |
Correct |
24 ms |
7916 KB |
Output is correct |
61 |
Correct |
24 ms |
8012 KB |
Output is correct |
62 |
Correct |
35 ms |
7948 KB |
Output is correct |
63 |
Correct |
24 ms |
8020 KB |
Output is correct |
64 |
Correct |
27 ms |
7944 KB |
Output is correct |
65 |
Correct |
30 ms |
7976 KB |
Output is correct |
66 |
Correct |
25 ms |
7980 KB |
Output is correct |
67 |
Correct |
26 ms |
7976 KB |
Output is correct |
68 |
Correct |
25 ms |
7960 KB |
Output is correct |
69 |
Correct |
26 ms |
8036 KB |
Output is correct |
70 |
Correct |
25 ms |
7932 KB |
Output is correct |
71 |
Correct |
8 ms |
5588 KB |
Output is correct |
72 |
Correct |
6 ms |
5604 KB |
Output is correct |
73 |
Correct |
7 ms |
5588 KB |
Output is correct |
74 |
Correct |
7 ms |
5552 KB |
Output is correct |
75 |
Correct |
7 ms |
5608 KB |
Output is correct |
76 |
Correct |
10 ms |
6248 KB |
Output is correct |
77 |
Correct |
10 ms |
6228 KB |
Output is correct |
78 |
Correct |
11 ms |
6268 KB |
Output is correct |
79 |
Correct |
10 ms |
6256 KB |
Output is correct |
80 |
Correct |
16 ms |
6220 KB |
Output is correct |
81 |
Correct |
20 ms |
7256 KB |
Output is correct |
82 |
Correct |
27 ms |
7196 KB |
Output is correct |
83 |
Correct |
19 ms |
7228 KB |
Output is correct |
84 |
Correct |
20 ms |
7244 KB |
Output is correct |
85 |
Correct |
19 ms |
7220 KB |
Output is correct |
86 |
Correct |
28 ms |
7232 KB |
Output is correct |
87 |
Correct |
20 ms |
7212 KB |
Output is correct |
88 |
Correct |
27 ms |
7248 KB |
Output is correct |
89 |
Correct |
20 ms |
7280 KB |
Output is correct |
90 |
Correct |
20 ms |
7308 KB |
Output is correct |
91 |
Correct |
31 ms |
8424 KB |
Output is correct |
92 |
Correct |
30 ms |
8360 KB |
Output is correct |
93 |
Correct |
30 ms |
8356 KB |
Output is correct |
94 |
Correct |
28 ms |
8396 KB |
Output is correct |
95 |
Correct |
34 ms |
8468 KB |
Output is correct |
96 |
Correct |
36 ms |
8972 KB |
Output is correct |
97 |
Correct |
44 ms |
9016 KB |
Output is correct |
98 |
Correct |
36 ms |
8908 KB |
Output is correct |
99 |
Correct |
40 ms |
8940 KB |
Output is correct |
100 |
Correct |
32 ms |
8928 KB |
Output is correct |
101 |
Correct |
34 ms |
8896 KB |
Output is correct |
102 |
Correct |
45 ms |
9008 KB |
Output is correct |
103 |
Correct |
34 ms |
8976 KB |
Output is correct |
104 |
Correct |
33 ms |
8944 KB |
Output is correct |
105 |
Correct |
33 ms |
8980 KB |
Output is correct |
106 |
Correct |
34 ms |
9180 KB |
Output is correct |
107 |
Correct |
45 ms |
9216 KB |
Output is correct |
108 |
Correct |
35 ms |
9216 KB |
Output is correct |
109 |
Correct |
37 ms |
9188 KB |
Output is correct |
110 |
Correct |
34 ms |
9148 KB |
Output is correct |
111 |
Correct |
33 ms |
9164 KB |
Output is correct |
112 |
Correct |
34 ms |
9224 KB |
Output is correct |
113 |
Correct |
36 ms |
9140 KB |
Output is correct |
114 |
Correct |
34 ms |
9152 KB |
Output is correct |
115 |
Correct |
34 ms |
9164 KB |
Output is correct |
116 |
Correct |
270 ms |
7124 KB |
Output is correct |
117 |
Correct |
281 ms |
7100 KB |
Output is correct |
118 |
Correct |
292 ms |
7716 KB |
Output is correct |
119 |
Correct |
274 ms |
7704 KB |
Output is correct |
120 |
Correct |
230 ms |
7700 KB |
Output is correct |
121 |
Correct |
295 ms |
8088 KB |
Output is correct |
122 |
Correct |
230 ms |
8204 KB |
Output is correct |
123 |
Correct |
508 ms |
8888 KB |
Output is correct |
124 |
Correct |
326 ms |
8988 KB |
Output is correct |
125 |
Correct |
342 ms |
9128 KB |
Output is correct |
126 |
Correct |
863 ms |
9796 KB |
Output is correct |
127 |
Correct |
864 ms |
9748 KB |
Output is correct |
128 |
Correct |
861 ms |
9776 KB |
Output is correct |
129 |
Correct |
881 ms |
9744 KB |
Output is correct |
130 |
Correct |
883 ms |
9792 KB |
Output is correct |
131 |
Correct |
914 ms |
9900 KB |
Output is correct |
132 |
Correct |
924 ms |
9664 KB |
Output is correct |
133 |
Correct |
918 ms |
9664 KB |
Output is correct |
134 |
Correct |
966 ms |
9664 KB |
Output is correct |
135 |
Correct |
917 ms |
9764 KB |
Output is correct |
136 |
Correct |
923 ms |
9800 KB |
Output is correct |
137 |
Correct |
927 ms |
9668 KB |
Output is correct |
138 |
Correct |
912 ms |
9692 KB |
Output is correct |
139 |
Correct |
920 ms |
9668 KB |
Output is correct |
140 |
Correct |
935 ms |
9756 KB |
Output is correct |
141 |
Correct |
776 ms |
9676 KB |
Output is correct |
142 |
Correct |
798 ms |
9748 KB |
Output is correct |
143 |
Correct |
804 ms |
9664 KB |
Output is correct |
144 |
Correct |
785 ms |
9668 KB |
Output is correct |
145 |
Correct |
794 ms |
9668 KB |
Output is correct |
146 |
Correct |
495 ms |
9792 KB |
Output is correct |
147 |
Correct |
508 ms |
9788 KB |
Output is correct |
148 |
Correct |
495 ms |
9792 KB |
Output is correct |
149 |
Correct |
530 ms |
9796 KB |
Output is correct |
150 |
Correct |
498 ms |
9796 KB |
Output is correct |
151 |
Correct |
547 ms |
9856 KB |
Output is correct |
152 |
Correct |
535 ms |
9796 KB |
Output is correct |
153 |
Correct |
534 ms |
9972 KB |
Output is correct |
154 |
Correct |
531 ms |
10036 KB |
Output is correct |
155 |
Correct |
537 ms |
10028 KB |
Output is correct |
156 |
Correct |
902 ms |
10564 KB |
Output is correct |
157 |
Correct |
910 ms |
10500 KB |
Output is correct |
158 |
Correct |
916 ms |
10448 KB |
Output is correct |
159 |
Correct |
907 ms |
10364 KB |
Output is correct |
160 |
Correct |
899 ms |
10436 KB |
Output is correct |
161 |
Correct |
847 ms |
10564 KB |
Output is correct |
162 |
Correct |
833 ms |
10400 KB |
Output is correct |
163 |
Correct |
850 ms |
10348 KB |
Output is correct |
164 |
Correct |
861 ms |
10392 KB |
Output is correct |
165 |
Correct |
841 ms |
10328 KB |
Output is correct |
166 |
Correct |
876 ms |
10296 KB |
Output is correct |
167 |
Correct |
881 ms |
10180 KB |
Output is correct |
168 |
Correct |
878 ms |
10136 KB |
Output is correct |
169 |
Correct |
887 ms |
10184 KB |
Output is correct |
170 |
Correct |
874 ms |
10172 KB |
Output is correct |
171 |
Correct |
870 ms |
10008 KB |
Output is correct |
172 |
Correct |
921 ms |
10052 KB |
Output is correct |
173 |
Correct |
882 ms |
10404 KB |
Output is correct |
174 |
Correct |
896 ms |
10408 KB |
Output is correct |
175 |
Correct |
930 ms |
10452 KB |
Output is correct |