# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
576023 |
2022-06-12T05:22:56 Z |
8e7 |
Diversity (CEOI21_diversity) |
C++17 |
|
1044 ms |
11156 KB |
//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 = 1000;
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";
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
4948 KB |
Output is correct |
2 |
Correct |
3 ms |
5028 KB |
Output is correct |
3 |
Correct |
3 ms |
5024 KB |
Output is correct |
4 |
Correct |
4 ms |
4948 KB |
Output is correct |
5 |
Correct |
3 ms |
4948 KB |
Output is correct |
6 |
Correct |
4 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 |
4 ms |
5028 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
4948 KB |
Output is correct |
2 |
Correct |
5 ms |
4948 KB |
Output is correct |
3 |
Correct |
4 ms |
5076 KB |
Output is correct |
4 |
Correct |
13 ms |
6188 KB |
Output is correct |
5 |
Correct |
23 ms |
7492 KB |
Output is correct |
6 |
Correct |
27 ms |
8396 KB |
Output is correct |
7 |
Correct |
35 ms |
9156 KB |
Output is correct |
8 |
Correct |
21 ms |
8372 KB |
Output is correct |
9 |
Correct |
22 ms |
8404 KB |
Output is correct |
10 |
Correct |
24 ms |
8844 KB |
Output is correct |
11 |
Correct |
23 ms |
8484 KB |
Output is correct |
12 |
Correct |
22 ms |
8380 KB |
Output is correct |
13 |
Correct |
20 ms |
8396 KB |
Output is correct |
14 |
Correct |
23 ms |
8544 KB |
Output is correct |
15 |
Correct |
22 ms |
8512 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
4948 KB |
Output is correct |
2 |
Correct |
5 ms |
4948 KB |
Output is correct |
3 |
Correct |
4 ms |
5076 KB |
Output is correct |
4 |
Correct |
13 ms |
6188 KB |
Output is correct |
5 |
Correct |
23 ms |
7492 KB |
Output is correct |
6 |
Correct |
27 ms |
8396 KB |
Output is correct |
7 |
Correct |
35 ms |
9156 KB |
Output is correct |
8 |
Correct |
21 ms |
8372 KB |
Output is correct |
9 |
Correct |
22 ms |
8404 KB |
Output is correct |
10 |
Correct |
24 ms |
8844 KB |
Output is correct |
11 |
Correct |
23 ms |
8484 KB |
Output is correct |
12 |
Correct |
22 ms |
8380 KB |
Output is correct |
13 |
Correct |
20 ms |
8396 KB |
Output is correct |
14 |
Correct |
23 ms |
8544 KB |
Output is correct |
15 |
Correct |
22 ms |
8512 KB |
Output is correct |
16 |
Correct |
3 ms |
5024 KB |
Output is correct |
17 |
Correct |
3 ms |
4948 KB |
Output is correct |
18 |
Correct |
4 ms |
5076 KB |
Output is correct |
19 |
Correct |
15 ms |
6176 KB |
Output is correct |
20 |
Correct |
24 ms |
7276 KB |
Output is correct |
21 |
Correct |
26 ms |
8640 KB |
Output is correct |
22 |
Correct |
26 ms |
8352 KB |
Output is correct |
23 |
Correct |
24 ms |
8528 KB |
Output is correct |
24 |
Correct |
25 ms |
8352 KB |
Output is correct |
25 |
Correct |
27 ms |
8404 KB |
Output is correct |
26 |
Correct |
24 ms |
8464 KB |
Output is correct |
27 |
Correct |
26 ms |
8480 KB |
Output is correct |
28 |
Correct |
24 ms |
8632 KB |
Output is correct |
29 |
Correct |
28 ms |
8332 KB |
Output is correct |
30 |
Correct |
35 ms |
8520 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
4948 KB |
Output is correct |
2 |
Correct |
5 ms |
4948 KB |
Output is correct |
3 |
Correct |
4 ms |
5076 KB |
Output is correct |
4 |
Correct |
13 ms |
6188 KB |
Output is correct |
5 |
Correct |
23 ms |
7492 KB |
Output is correct |
6 |
Correct |
27 ms |
8396 KB |
Output is correct |
7 |
Correct |
35 ms |
9156 KB |
Output is correct |
8 |
Correct |
21 ms |
8372 KB |
Output is correct |
9 |
Correct |
22 ms |
8404 KB |
Output is correct |
10 |
Correct |
24 ms |
8844 KB |
Output is correct |
11 |
Correct |
23 ms |
8484 KB |
Output is correct |
12 |
Correct |
22 ms |
8380 KB |
Output is correct |
13 |
Correct |
20 ms |
8396 KB |
Output is correct |
14 |
Correct |
23 ms |
8544 KB |
Output is correct |
15 |
Correct |
22 ms |
8512 KB |
Output is correct |
16 |
Correct |
3 ms |
5024 KB |
Output is correct |
17 |
Correct |
3 ms |
4948 KB |
Output is correct |
18 |
Correct |
4 ms |
5076 KB |
Output is correct |
19 |
Correct |
15 ms |
6176 KB |
Output is correct |
20 |
Correct |
24 ms |
7276 KB |
Output is correct |
21 |
Correct |
26 ms |
8640 KB |
Output is correct |
22 |
Correct |
26 ms |
8352 KB |
Output is correct |
23 |
Correct |
24 ms |
8528 KB |
Output is correct |
24 |
Correct |
25 ms |
8352 KB |
Output is correct |
25 |
Correct |
27 ms |
8404 KB |
Output is correct |
26 |
Correct |
24 ms |
8464 KB |
Output is correct |
27 |
Correct |
26 ms |
8480 KB |
Output is correct |
28 |
Correct |
24 ms |
8632 KB |
Output is correct |
29 |
Correct |
28 ms |
8332 KB |
Output is correct |
30 |
Correct |
35 ms |
8520 KB |
Output is correct |
31 |
Correct |
3 ms |
5076 KB |
Output is correct |
32 |
Correct |
3 ms |
4948 KB |
Output is correct |
33 |
Correct |
3 ms |
4948 KB |
Output is correct |
34 |
Correct |
5 ms |
5040 KB |
Output is correct |
35 |
Correct |
3 ms |
5076 KB |
Output is correct |
36 |
Correct |
5 ms |
5160 KB |
Output is correct |
37 |
Correct |
7 ms |
5588 KB |
Output is correct |
38 |
Correct |
7 ms |
5552 KB |
Output is correct |
39 |
Correct |
14 ms |
6216 KB |
Output is correct |
40 |
Correct |
17 ms |
7344 KB |
Output is correct |
41 |
Correct |
30 ms |
8576 KB |
Output is correct |
42 |
Correct |
29 ms |
8448 KB |
Output is correct |
43 |
Correct |
31 ms |
8528 KB |
Output is correct |
44 |
Correct |
35 ms |
8460 KB |
Output is correct |
45 |
Correct |
27 ms |
8512 KB |
Output is correct |
46 |
Correct |
30 ms |
8436 KB |
Output is correct |
47 |
Correct |
25 ms |
8532 KB |
Output is correct |
48 |
Correct |
27 ms |
8468 KB |
Output is correct |
49 |
Correct |
37 ms |
8496 KB |
Output is correct |
50 |
Correct |
30 ms |
8460 KB |
Output is correct |
51 |
Correct |
40 ms |
8472 KB |
Output is correct |
52 |
Correct |
33 ms |
8480 KB |
Output is correct |
53 |
Correct |
28 ms |
8448 KB |
Output is correct |
54 |
Correct |
27 ms |
8440 KB |
Output is correct |
55 |
Correct |
36 ms |
8524 KB |
Output is correct |
56 |
Correct |
25 ms |
8452 KB |
Output is correct |
57 |
Correct |
26 ms |
8472 KB |
Output is correct |
58 |
Correct |
25 ms |
8528 KB |
Output is correct |
59 |
Correct |
28 ms |
8540 KB |
Output is correct |
60 |
Correct |
29 ms |
8436 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
4948 KB |
Output is correct |
2 |
Correct |
3 ms |
5028 KB |
Output is correct |
3 |
Correct |
3 ms |
5024 KB |
Output is correct |
4 |
Correct |
4 ms |
4948 KB |
Output is correct |
5 |
Correct |
3 ms |
4948 KB |
Output is correct |
6 |
Correct |
4 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 |
4 ms |
5028 KB |
Output is correct |
11 |
Correct |
3 ms |
4948 KB |
Output is correct |
12 |
Correct |
5 ms |
4948 KB |
Output is correct |
13 |
Correct |
4 ms |
5076 KB |
Output is correct |
14 |
Correct |
13 ms |
6188 KB |
Output is correct |
15 |
Correct |
23 ms |
7492 KB |
Output is correct |
16 |
Correct |
27 ms |
8396 KB |
Output is correct |
17 |
Correct |
35 ms |
9156 KB |
Output is correct |
18 |
Correct |
21 ms |
8372 KB |
Output is correct |
19 |
Correct |
22 ms |
8404 KB |
Output is correct |
20 |
Correct |
24 ms |
8844 KB |
Output is correct |
21 |
Correct |
23 ms |
8484 KB |
Output is correct |
22 |
Correct |
22 ms |
8380 KB |
Output is correct |
23 |
Correct |
20 ms |
8396 KB |
Output is correct |
24 |
Correct |
23 ms |
8544 KB |
Output is correct |
25 |
Correct |
22 ms |
8512 KB |
Output is correct |
26 |
Correct |
3 ms |
5024 KB |
Output is correct |
27 |
Correct |
3 ms |
4948 KB |
Output is correct |
28 |
Correct |
4 ms |
5076 KB |
Output is correct |
29 |
Correct |
15 ms |
6176 KB |
Output is correct |
30 |
Correct |
24 ms |
7276 KB |
Output is correct |
31 |
Correct |
26 ms |
8640 KB |
Output is correct |
32 |
Correct |
26 ms |
8352 KB |
Output is correct |
33 |
Correct |
24 ms |
8528 KB |
Output is correct |
34 |
Correct |
25 ms |
8352 KB |
Output is correct |
35 |
Correct |
27 ms |
8404 KB |
Output is correct |
36 |
Correct |
24 ms |
8464 KB |
Output is correct |
37 |
Correct |
26 ms |
8480 KB |
Output is correct |
38 |
Correct |
24 ms |
8632 KB |
Output is correct |
39 |
Correct |
28 ms |
8332 KB |
Output is correct |
40 |
Correct |
35 ms |
8520 KB |
Output is correct |
41 |
Correct |
3 ms |
5076 KB |
Output is correct |
42 |
Correct |
3 ms |
4948 KB |
Output is correct |
43 |
Correct |
3 ms |
4948 KB |
Output is correct |
44 |
Correct |
5 ms |
5040 KB |
Output is correct |
45 |
Correct |
3 ms |
5076 KB |
Output is correct |
46 |
Correct |
5 ms |
5160 KB |
Output is correct |
47 |
Correct |
7 ms |
5588 KB |
Output is correct |
48 |
Correct |
7 ms |
5552 KB |
Output is correct |
49 |
Correct |
14 ms |
6216 KB |
Output is correct |
50 |
Correct |
17 ms |
7344 KB |
Output is correct |
51 |
Correct |
30 ms |
8576 KB |
Output is correct |
52 |
Correct |
29 ms |
8448 KB |
Output is correct |
53 |
Correct |
31 ms |
8528 KB |
Output is correct |
54 |
Correct |
35 ms |
8460 KB |
Output is correct |
55 |
Correct |
27 ms |
8512 KB |
Output is correct |
56 |
Correct |
30 ms |
8436 KB |
Output is correct |
57 |
Correct |
25 ms |
8532 KB |
Output is correct |
58 |
Correct |
27 ms |
8468 KB |
Output is correct |
59 |
Correct |
37 ms |
8496 KB |
Output is correct |
60 |
Correct |
30 ms |
8460 KB |
Output is correct |
61 |
Correct |
40 ms |
8472 KB |
Output is correct |
62 |
Correct |
33 ms |
8480 KB |
Output is correct |
63 |
Correct |
28 ms |
8448 KB |
Output is correct |
64 |
Correct |
27 ms |
8440 KB |
Output is correct |
65 |
Correct |
36 ms |
8524 KB |
Output is correct |
66 |
Correct |
25 ms |
8452 KB |
Output is correct |
67 |
Correct |
26 ms |
8472 KB |
Output is correct |
68 |
Correct |
25 ms |
8528 KB |
Output is correct |
69 |
Correct |
28 ms |
8540 KB |
Output is correct |
70 |
Correct |
29 ms |
8436 KB |
Output is correct |
71 |
Correct |
7 ms |
5564 KB |
Output is correct |
72 |
Correct |
7 ms |
5548 KB |
Output is correct |
73 |
Correct |
6 ms |
5552 KB |
Output is correct |
74 |
Correct |
7 ms |
5576 KB |
Output is correct |
75 |
Correct |
9 ms |
5716 KB |
Output is correct |
76 |
Correct |
12 ms |
6208 KB |
Output is correct |
77 |
Correct |
11 ms |
6356 KB |
Output is correct |
78 |
Correct |
13 ms |
6256 KB |
Output is correct |
79 |
Correct |
11 ms |
6228 KB |
Output is correct |
80 |
Correct |
10 ms |
6228 KB |
Output is correct |
81 |
Correct |
18 ms |
7508 KB |
Output is correct |
82 |
Correct |
18 ms |
7552 KB |
Output is correct |
83 |
Correct |
20 ms |
7488 KB |
Output is correct |
84 |
Correct |
19 ms |
7592 KB |
Output is correct |
85 |
Correct |
19 ms |
7496 KB |
Output is correct |
86 |
Correct |
21 ms |
7724 KB |
Output is correct |
87 |
Correct |
22 ms |
7644 KB |
Output is correct |
88 |
Correct |
22 ms |
7636 KB |
Output is correct |
89 |
Correct |
21 ms |
7628 KB |
Output is correct |
90 |
Correct |
28 ms |
7708 KB |
Output is correct |
91 |
Correct |
29 ms |
9420 KB |
Output is correct |
92 |
Correct |
30 ms |
9420 KB |
Output is correct |
93 |
Correct |
39 ms |
9324 KB |
Output is correct |
94 |
Correct |
28 ms |
9304 KB |
Output is correct |
95 |
Correct |
34 ms |
9420 KB |
Output is correct |
96 |
Correct |
36 ms |
9824 KB |
Output is correct |
97 |
Correct |
39 ms |
9788 KB |
Output is correct |
98 |
Correct |
35 ms |
9788 KB |
Output is correct |
99 |
Correct |
33 ms |
9744 KB |
Output is correct |
100 |
Correct |
33 ms |
9800 KB |
Output is correct |
101 |
Correct |
33 ms |
9820 KB |
Output is correct |
102 |
Correct |
35 ms |
9812 KB |
Output is correct |
103 |
Correct |
32 ms |
9804 KB |
Output is correct |
104 |
Correct |
33 ms |
9804 KB |
Output is correct |
105 |
Correct |
33 ms |
9708 KB |
Output is correct |
106 |
Correct |
36 ms |
9964 KB |
Output is correct |
107 |
Correct |
34 ms |
9924 KB |
Output is correct |
108 |
Correct |
38 ms |
10012 KB |
Output is correct |
109 |
Correct |
35 ms |
9932 KB |
Output is correct |
110 |
Correct |
39 ms |
10036 KB |
Output is correct |
111 |
Correct |
41 ms |
9944 KB |
Output is correct |
112 |
Correct |
37 ms |
10012 KB |
Output is correct |
113 |
Correct |
33 ms |
9932 KB |
Output is correct |
114 |
Correct |
34 ms |
10016 KB |
Output is correct |
115 |
Correct |
42 ms |
9932 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
4948 KB |
Output is correct |
2 |
Correct |
3 ms |
5028 KB |
Output is correct |
3 |
Correct |
3 ms |
5024 KB |
Output is correct |
4 |
Correct |
4 ms |
4948 KB |
Output is correct |
5 |
Correct |
3 ms |
4948 KB |
Output is correct |
6 |
Correct |
4 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 |
4 ms |
5028 KB |
Output is correct |
11 |
Correct |
3 ms |
4948 KB |
Output is correct |
12 |
Correct |
5 ms |
4948 KB |
Output is correct |
13 |
Correct |
4 ms |
5076 KB |
Output is correct |
14 |
Correct |
13 ms |
6188 KB |
Output is correct |
15 |
Correct |
23 ms |
7492 KB |
Output is correct |
16 |
Correct |
27 ms |
8396 KB |
Output is correct |
17 |
Correct |
35 ms |
9156 KB |
Output is correct |
18 |
Correct |
21 ms |
8372 KB |
Output is correct |
19 |
Correct |
22 ms |
8404 KB |
Output is correct |
20 |
Correct |
24 ms |
8844 KB |
Output is correct |
21 |
Correct |
23 ms |
8484 KB |
Output is correct |
22 |
Correct |
22 ms |
8380 KB |
Output is correct |
23 |
Correct |
20 ms |
8396 KB |
Output is correct |
24 |
Correct |
23 ms |
8544 KB |
Output is correct |
25 |
Correct |
22 ms |
8512 KB |
Output is correct |
26 |
Correct |
3 ms |
5024 KB |
Output is correct |
27 |
Correct |
3 ms |
4948 KB |
Output is correct |
28 |
Correct |
4 ms |
5076 KB |
Output is correct |
29 |
Correct |
15 ms |
6176 KB |
Output is correct |
30 |
Correct |
24 ms |
7276 KB |
Output is correct |
31 |
Correct |
26 ms |
8640 KB |
Output is correct |
32 |
Correct |
26 ms |
8352 KB |
Output is correct |
33 |
Correct |
24 ms |
8528 KB |
Output is correct |
34 |
Correct |
25 ms |
8352 KB |
Output is correct |
35 |
Correct |
27 ms |
8404 KB |
Output is correct |
36 |
Correct |
24 ms |
8464 KB |
Output is correct |
37 |
Correct |
26 ms |
8480 KB |
Output is correct |
38 |
Correct |
24 ms |
8632 KB |
Output is correct |
39 |
Correct |
28 ms |
8332 KB |
Output is correct |
40 |
Correct |
35 ms |
8520 KB |
Output is correct |
41 |
Correct |
3 ms |
5076 KB |
Output is correct |
42 |
Correct |
3 ms |
4948 KB |
Output is correct |
43 |
Correct |
3 ms |
4948 KB |
Output is correct |
44 |
Correct |
5 ms |
5040 KB |
Output is correct |
45 |
Correct |
3 ms |
5076 KB |
Output is correct |
46 |
Correct |
5 ms |
5160 KB |
Output is correct |
47 |
Correct |
7 ms |
5588 KB |
Output is correct |
48 |
Correct |
7 ms |
5552 KB |
Output is correct |
49 |
Correct |
14 ms |
6216 KB |
Output is correct |
50 |
Correct |
17 ms |
7344 KB |
Output is correct |
51 |
Correct |
30 ms |
8576 KB |
Output is correct |
52 |
Correct |
29 ms |
8448 KB |
Output is correct |
53 |
Correct |
31 ms |
8528 KB |
Output is correct |
54 |
Correct |
35 ms |
8460 KB |
Output is correct |
55 |
Correct |
27 ms |
8512 KB |
Output is correct |
56 |
Correct |
30 ms |
8436 KB |
Output is correct |
57 |
Correct |
25 ms |
8532 KB |
Output is correct |
58 |
Correct |
27 ms |
8468 KB |
Output is correct |
59 |
Correct |
37 ms |
8496 KB |
Output is correct |
60 |
Correct |
30 ms |
8460 KB |
Output is correct |
61 |
Correct |
40 ms |
8472 KB |
Output is correct |
62 |
Correct |
33 ms |
8480 KB |
Output is correct |
63 |
Correct |
28 ms |
8448 KB |
Output is correct |
64 |
Correct |
27 ms |
8440 KB |
Output is correct |
65 |
Correct |
36 ms |
8524 KB |
Output is correct |
66 |
Correct |
25 ms |
8452 KB |
Output is correct |
67 |
Correct |
26 ms |
8472 KB |
Output is correct |
68 |
Correct |
25 ms |
8528 KB |
Output is correct |
69 |
Correct |
28 ms |
8540 KB |
Output is correct |
70 |
Correct |
29 ms |
8436 KB |
Output is correct |
71 |
Correct |
7 ms |
5564 KB |
Output is correct |
72 |
Correct |
7 ms |
5548 KB |
Output is correct |
73 |
Correct |
6 ms |
5552 KB |
Output is correct |
74 |
Correct |
7 ms |
5576 KB |
Output is correct |
75 |
Correct |
9 ms |
5716 KB |
Output is correct |
76 |
Correct |
12 ms |
6208 KB |
Output is correct |
77 |
Correct |
11 ms |
6356 KB |
Output is correct |
78 |
Correct |
13 ms |
6256 KB |
Output is correct |
79 |
Correct |
11 ms |
6228 KB |
Output is correct |
80 |
Correct |
10 ms |
6228 KB |
Output is correct |
81 |
Correct |
18 ms |
7508 KB |
Output is correct |
82 |
Correct |
18 ms |
7552 KB |
Output is correct |
83 |
Correct |
20 ms |
7488 KB |
Output is correct |
84 |
Correct |
19 ms |
7592 KB |
Output is correct |
85 |
Correct |
19 ms |
7496 KB |
Output is correct |
86 |
Correct |
21 ms |
7724 KB |
Output is correct |
87 |
Correct |
22 ms |
7644 KB |
Output is correct |
88 |
Correct |
22 ms |
7636 KB |
Output is correct |
89 |
Correct |
21 ms |
7628 KB |
Output is correct |
90 |
Correct |
28 ms |
7708 KB |
Output is correct |
91 |
Correct |
29 ms |
9420 KB |
Output is correct |
92 |
Correct |
30 ms |
9420 KB |
Output is correct |
93 |
Correct |
39 ms |
9324 KB |
Output is correct |
94 |
Correct |
28 ms |
9304 KB |
Output is correct |
95 |
Correct |
34 ms |
9420 KB |
Output is correct |
96 |
Correct |
36 ms |
9824 KB |
Output is correct |
97 |
Correct |
39 ms |
9788 KB |
Output is correct |
98 |
Correct |
35 ms |
9788 KB |
Output is correct |
99 |
Correct |
33 ms |
9744 KB |
Output is correct |
100 |
Correct |
33 ms |
9800 KB |
Output is correct |
101 |
Correct |
33 ms |
9820 KB |
Output is correct |
102 |
Correct |
35 ms |
9812 KB |
Output is correct |
103 |
Correct |
32 ms |
9804 KB |
Output is correct |
104 |
Correct |
33 ms |
9804 KB |
Output is correct |
105 |
Correct |
33 ms |
9708 KB |
Output is correct |
106 |
Correct |
36 ms |
9964 KB |
Output is correct |
107 |
Correct |
34 ms |
9924 KB |
Output is correct |
108 |
Correct |
38 ms |
10012 KB |
Output is correct |
109 |
Correct |
35 ms |
9932 KB |
Output is correct |
110 |
Correct |
39 ms |
10036 KB |
Output is correct |
111 |
Correct |
41 ms |
9944 KB |
Output is correct |
112 |
Correct |
37 ms |
10012 KB |
Output is correct |
113 |
Correct |
33 ms |
9932 KB |
Output is correct |
114 |
Correct |
34 ms |
10016 KB |
Output is correct |
115 |
Correct |
42 ms |
9932 KB |
Output is correct |
116 |
Correct |
250 ms |
7132 KB |
Output is correct |
117 |
Correct |
260 ms |
7120 KB |
Output is correct |
118 |
Correct |
285 ms |
7708 KB |
Output is correct |
119 |
Correct |
272 ms |
7812 KB |
Output is correct |
120 |
Correct |
215 ms |
7872 KB |
Output is correct |
121 |
Correct |
302 ms |
8416 KB |
Output is correct |
122 |
Correct |
256 ms |
8468 KB |
Output is correct |
123 |
Correct |
544 ms |
9760 KB |
Output is correct |
124 |
Correct |
350 ms |
9940 KB |
Output is correct |
125 |
Correct |
380 ms |
10036 KB |
Output is correct |
126 |
Correct |
960 ms |
10716 KB |
Output is correct |
127 |
Correct |
968 ms |
10724 KB |
Output is correct |
128 |
Correct |
985 ms |
10740 KB |
Output is correct |
129 |
Correct |
964 ms |
10712 KB |
Output is correct |
130 |
Correct |
955 ms |
10840 KB |
Output is correct |
131 |
Correct |
1039 ms |
10828 KB |
Output is correct |
132 |
Correct |
1040 ms |
10820 KB |
Output is correct |
133 |
Correct |
1025 ms |
10820 KB |
Output is correct |
134 |
Correct |
1044 ms |
10816 KB |
Output is correct |
135 |
Correct |
1036 ms |
10864 KB |
Output is correct |
136 |
Correct |
1033 ms |
10840 KB |
Output is correct |
137 |
Correct |
1020 ms |
10824 KB |
Output is correct |
138 |
Correct |
1014 ms |
10848 KB |
Output is correct |
139 |
Correct |
998 ms |
10956 KB |
Output is correct |
140 |
Correct |
1028 ms |
10764 KB |
Output is correct |
141 |
Correct |
859 ms |
10812 KB |
Output is correct |
142 |
Correct |
879 ms |
10816 KB |
Output is correct |
143 |
Correct |
873 ms |
10816 KB |
Output is correct |
144 |
Correct |
851 ms |
10820 KB |
Output is correct |
145 |
Correct |
848 ms |
10820 KB |
Output is correct |
146 |
Correct |
538 ms |
10816 KB |
Output is correct |
147 |
Correct |
533 ms |
10924 KB |
Output is correct |
148 |
Correct |
538 ms |
10816 KB |
Output is correct |
149 |
Correct |
531 ms |
10840 KB |
Output is correct |
150 |
Correct |
551 ms |
10820 KB |
Output is correct |
151 |
Correct |
570 ms |
10948 KB |
Output is correct |
152 |
Correct |
567 ms |
10836 KB |
Output is correct |
153 |
Correct |
578 ms |
10708 KB |
Output is correct |
154 |
Correct |
569 ms |
10820 KB |
Output is correct |
155 |
Correct |
561 ms |
10804 KB |
Output is correct |
156 |
Correct |
983 ms |
11092 KB |
Output is correct |
157 |
Correct |
981 ms |
11156 KB |
Output is correct |
158 |
Correct |
993 ms |
10924 KB |
Output is correct |
159 |
Correct |
956 ms |
10876 KB |
Output is correct |
160 |
Correct |
959 ms |
10952 KB |
Output is correct |
161 |
Correct |
879 ms |
11080 KB |
Output is correct |
162 |
Correct |
876 ms |
10912 KB |
Output is correct |
163 |
Correct |
866 ms |
10864 KB |
Output is correct |
164 |
Correct |
880 ms |
10904 KB |
Output is correct |
165 |
Correct |
883 ms |
10832 KB |
Output is correct |
166 |
Correct |
943 ms |
10792 KB |
Output is correct |
167 |
Correct |
946 ms |
10636 KB |
Output is correct |
168 |
Correct |
949 ms |
10644 KB |
Output is correct |
169 |
Correct |
952 ms |
10696 KB |
Output is correct |
170 |
Correct |
948 ms |
10660 KB |
Output is correct |
171 |
Correct |
926 ms |
10524 KB |
Output is correct |
172 |
Correct |
921 ms |
10520 KB |
Output is correct |
173 |
Correct |
923 ms |
10524 KB |
Output is correct |
174 |
Correct |
914 ms |
10532 KB |
Output is correct |
175 |
Correct |
919 ms |
10652 KB |
Output is correct |