# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
576022 |
2022-06-12T05:17:59 Z |
8e7 |
Diversity (CEOI21_diversity) |
C++17 |
|
2686 ms |
12100 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 = 500;
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.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();
debug(l, r, distinct, getans(), ans[id]);
}
for (int i = 0;i < q;i++) cout << ans[i] << "\n";
}
Compilation message
diversity.cpp: In function 'int main()':
diversity.cpp:13:20: warning: statement has no effect [-Wunused-value]
13 | #define debug(...) 0
| ^
diversity.cpp:139:3: note: in expansion of macro 'debug'
139 | debug(l, r, distinct, getans(), ans[id]);
| ^~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
4948 KB |
Output is correct |
2 |
Correct |
3 ms |
4948 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 |
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 |
5024 KB |
Output is correct |
9 |
Correct |
3 ms |
5028 KB |
Output is correct |
10 |
Correct |
2 ms |
5028 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
5028 KB |
Output is correct |
2 |
Correct |
4 ms |
5032 KB |
Output is correct |
3 |
Correct |
4 ms |
5124 KB |
Output is correct |
4 |
Correct |
8 ms |
6204 KB |
Output is correct |
5 |
Correct |
22 ms |
7612 KB |
Output is correct |
6 |
Correct |
29 ms |
8476 KB |
Output is correct |
7 |
Correct |
29 ms |
9256 KB |
Output is correct |
8 |
Correct |
20 ms |
8412 KB |
Output is correct |
9 |
Correct |
21 ms |
8396 KB |
Output is correct |
10 |
Correct |
26 ms |
8780 KB |
Output is correct |
11 |
Correct |
21 ms |
8476 KB |
Output is correct |
12 |
Correct |
20 ms |
8464 KB |
Output is correct |
13 |
Correct |
22 ms |
8404 KB |
Output is correct |
14 |
Correct |
22 ms |
8564 KB |
Output is correct |
15 |
Correct |
23 ms |
8524 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
5028 KB |
Output is correct |
2 |
Correct |
4 ms |
5032 KB |
Output is correct |
3 |
Correct |
4 ms |
5124 KB |
Output is correct |
4 |
Correct |
8 ms |
6204 KB |
Output is correct |
5 |
Correct |
22 ms |
7612 KB |
Output is correct |
6 |
Correct |
29 ms |
8476 KB |
Output is correct |
7 |
Correct |
29 ms |
9256 KB |
Output is correct |
8 |
Correct |
20 ms |
8412 KB |
Output is correct |
9 |
Correct |
21 ms |
8396 KB |
Output is correct |
10 |
Correct |
26 ms |
8780 KB |
Output is correct |
11 |
Correct |
21 ms |
8476 KB |
Output is correct |
12 |
Correct |
20 ms |
8464 KB |
Output is correct |
13 |
Correct |
22 ms |
8404 KB |
Output is correct |
14 |
Correct |
22 ms |
8564 KB |
Output is correct |
15 |
Correct |
23 ms |
8524 KB |
Output is correct |
16 |
Correct |
3 ms |
4948 KB |
Output is correct |
17 |
Correct |
4 ms |
4948 KB |
Output is correct |
18 |
Correct |
3 ms |
5072 KB |
Output is correct |
19 |
Correct |
9 ms |
6228 KB |
Output is correct |
20 |
Correct |
16 ms |
7380 KB |
Output is correct |
21 |
Correct |
22 ms |
8652 KB |
Output is correct |
22 |
Correct |
26 ms |
8420 KB |
Output is correct |
23 |
Correct |
24 ms |
8532 KB |
Output is correct |
24 |
Correct |
23 ms |
8396 KB |
Output is correct |
25 |
Correct |
24 ms |
8404 KB |
Output is correct |
26 |
Correct |
25 ms |
8332 KB |
Output is correct |
27 |
Correct |
23 ms |
8492 KB |
Output is correct |
28 |
Correct |
22 ms |
8664 KB |
Output is correct |
29 |
Correct |
22 ms |
8432 KB |
Output is correct |
30 |
Correct |
21 ms |
8532 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
5028 KB |
Output is correct |
2 |
Correct |
4 ms |
5032 KB |
Output is correct |
3 |
Correct |
4 ms |
5124 KB |
Output is correct |
4 |
Correct |
8 ms |
6204 KB |
Output is correct |
5 |
Correct |
22 ms |
7612 KB |
Output is correct |
6 |
Correct |
29 ms |
8476 KB |
Output is correct |
7 |
Correct |
29 ms |
9256 KB |
Output is correct |
8 |
Correct |
20 ms |
8412 KB |
Output is correct |
9 |
Correct |
21 ms |
8396 KB |
Output is correct |
10 |
Correct |
26 ms |
8780 KB |
Output is correct |
11 |
Correct |
21 ms |
8476 KB |
Output is correct |
12 |
Correct |
20 ms |
8464 KB |
Output is correct |
13 |
Correct |
22 ms |
8404 KB |
Output is correct |
14 |
Correct |
22 ms |
8564 KB |
Output is correct |
15 |
Correct |
23 ms |
8524 KB |
Output is correct |
16 |
Correct |
3 ms |
4948 KB |
Output is correct |
17 |
Correct |
4 ms |
4948 KB |
Output is correct |
18 |
Correct |
3 ms |
5072 KB |
Output is correct |
19 |
Correct |
9 ms |
6228 KB |
Output is correct |
20 |
Correct |
16 ms |
7380 KB |
Output is correct |
21 |
Correct |
22 ms |
8652 KB |
Output is correct |
22 |
Correct |
26 ms |
8420 KB |
Output is correct |
23 |
Correct |
24 ms |
8532 KB |
Output is correct |
24 |
Correct |
23 ms |
8396 KB |
Output is correct |
25 |
Correct |
24 ms |
8404 KB |
Output is correct |
26 |
Correct |
25 ms |
8332 KB |
Output is correct |
27 |
Correct |
23 ms |
8492 KB |
Output is correct |
28 |
Correct |
22 ms |
8664 KB |
Output is correct |
29 |
Correct |
22 ms |
8432 KB |
Output is correct |
30 |
Correct |
21 ms |
8532 KB |
Output is correct |
31 |
Correct |
3 ms |
5060 KB |
Output is correct |
32 |
Correct |
2 ms |
4948 KB |
Output is correct |
33 |
Correct |
3 ms |
4948 KB |
Output is correct |
34 |
Correct |
3 ms |
5076 KB |
Output is correct |
35 |
Correct |
5 ms |
5076 KB |
Output is correct |
36 |
Correct |
3 ms |
5088 KB |
Output is correct |
37 |
Correct |
6 ms |
5588 KB |
Output is correct |
38 |
Correct |
6 ms |
5588 KB |
Output is correct |
39 |
Correct |
14 ms |
6156 KB |
Output is correct |
40 |
Correct |
18 ms |
7396 KB |
Output is correct |
41 |
Correct |
26 ms |
8464 KB |
Output is correct |
42 |
Correct |
24 ms |
8524 KB |
Output is correct |
43 |
Correct |
23 ms |
8524 KB |
Output is correct |
44 |
Correct |
27 ms |
8524 KB |
Output is correct |
45 |
Correct |
30 ms |
8504 KB |
Output is correct |
46 |
Correct |
26 ms |
8484 KB |
Output is correct |
47 |
Correct |
24 ms |
8460 KB |
Output is correct |
48 |
Correct |
30 ms |
8456 KB |
Output is correct |
49 |
Correct |
24 ms |
8460 KB |
Output is correct |
50 |
Correct |
24 ms |
8456 KB |
Output is correct |
51 |
Correct |
24 ms |
8524 KB |
Output is correct |
52 |
Correct |
26 ms |
8500 KB |
Output is correct |
53 |
Correct |
23 ms |
8460 KB |
Output is correct |
54 |
Correct |
24 ms |
8492 KB |
Output is correct |
55 |
Correct |
27 ms |
8704 KB |
Output is correct |
56 |
Correct |
32 ms |
8500 KB |
Output is correct |
57 |
Correct |
31 ms |
8452 KB |
Output is correct |
58 |
Correct |
26 ms |
8464 KB |
Output is correct |
59 |
Correct |
24 ms |
8472 KB |
Output is correct |
60 |
Correct |
23 ms |
8536 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
4948 KB |
Output is correct |
2 |
Correct |
3 ms |
4948 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 |
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 |
5024 KB |
Output is correct |
9 |
Correct |
3 ms |
5028 KB |
Output is correct |
10 |
Correct |
2 ms |
5028 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 |
5124 KB |
Output is correct |
14 |
Correct |
8 ms |
6204 KB |
Output is correct |
15 |
Correct |
22 ms |
7612 KB |
Output is correct |
16 |
Correct |
29 ms |
8476 KB |
Output is correct |
17 |
Correct |
29 ms |
9256 KB |
Output is correct |
18 |
Correct |
20 ms |
8412 KB |
Output is correct |
19 |
Correct |
21 ms |
8396 KB |
Output is correct |
20 |
Correct |
26 ms |
8780 KB |
Output is correct |
21 |
Correct |
21 ms |
8476 KB |
Output is correct |
22 |
Correct |
20 ms |
8464 KB |
Output is correct |
23 |
Correct |
22 ms |
8404 KB |
Output is correct |
24 |
Correct |
22 ms |
8564 KB |
Output is correct |
25 |
Correct |
23 ms |
8524 KB |
Output is correct |
26 |
Correct |
3 ms |
4948 KB |
Output is correct |
27 |
Correct |
4 ms |
4948 KB |
Output is correct |
28 |
Correct |
3 ms |
5072 KB |
Output is correct |
29 |
Correct |
9 ms |
6228 KB |
Output is correct |
30 |
Correct |
16 ms |
7380 KB |
Output is correct |
31 |
Correct |
22 ms |
8652 KB |
Output is correct |
32 |
Correct |
26 ms |
8420 KB |
Output is correct |
33 |
Correct |
24 ms |
8532 KB |
Output is correct |
34 |
Correct |
23 ms |
8396 KB |
Output is correct |
35 |
Correct |
24 ms |
8404 KB |
Output is correct |
36 |
Correct |
25 ms |
8332 KB |
Output is correct |
37 |
Correct |
23 ms |
8492 KB |
Output is correct |
38 |
Correct |
22 ms |
8664 KB |
Output is correct |
39 |
Correct |
22 ms |
8432 KB |
Output is correct |
40 |
Correct |
21 ms |
8532 KB |
Output is correct |
41 |
Correct |
3 ms |
5060 KB |
Output is correct |
42 |
Correct |
2 ms |
4948 KB |
Output is correct |
43 |
Correct |
3 ms |
4948 KB |
Output is correct |
44 |
Correct |
3 ms |
5076 KB |
Output is correct |
45 |
Correct |
5 ms |
5076 KB |
Output is correct |
46 |
Correct |
3 ms |
5088 KB |
Output is correct |
47 |
Correct |
6 ms |
5588 KB |
Output is correct |
48 |
Correct |
6 ms |
5588 KB |
Output is correct |
49 |
Correct |
14 ms |
6156 KB |
Output is correct |
50 |
Correct |
18 ms |
7396 KB |
Output is correct |
51 |
Correct |
26 ms |
8464 KB |
Output is correct |
52 |
Correct |
24 ms |
8524 KB |
Output is correct |
53 |
Correct |
23 ms |
8524 KB |
Output is correct |
54 |
Correct |
27 ms |
8524 KB |
Output is correct |
55 |
Correct |
30 ms |
8504 KB |
Output is correct |
56 |
Correct |
26 ms |
8484 KB |
Output is correct |
57 |
Correct |
24 ms |
8460 KB |
Output is correct |
58 |
Correct |
30 ms |
8456 KB |
Output is correct |
59 |
Correct |
24 ms |
8460 KB |
Output is correct |
60 |
Correct |
24 ms |
8456 KB |
Output is correct |
61 |
Correct |
24 ms |
8524 KB |
Output is correct |
62 |
Correct |
26 ms |
8500 KB |
Output is correct |
63 |
Correct |
23 ms |
8460 KB |
Output is correct |
64 |
Correct |
24 ms |
8492 KB |
Output is correct |
65 |
Correct |
27 ms |
8704 KB |
Output is correct |
66 |
Correct |
32 ms |
8500 KB |
Output is correct |
67 |
Correct |
31 ms |
8452 KB |
Output is correct |
68 |
Correct |
26 ms |
8464 KB |
Output is correct |
69 |
Correct |
24 ms |
8472 KB |
Output is correct |
70 |
Correct |
23 ms |
8536 KB |
Output is correct |
71 |
Correct |
6 ms |
5588 KB |
Output is correct |
72 |
Correct |
6 ms |
5660 KB |
Output is correct |
73 |
Correct |
7 ms |
5588 KB |
Output is correct |
74 |
Correct |
7 ms |
5664 KB |
Output is correct |
75 |
Correct |
6 ms |
5588 KB |
Output is correct |
76 |
Correct |
11 ms |
6228 KB |
Output is correct |
77 |
Correct |
10 ms |
6192 KB |
Output is correct |
78 |
Correct |
12 ms |
6304 KB |
Output is correct |
79 |
Correct |
10 ms |
6320 KB |
Output is correct |
80 |
Correct |
10 ms |
6324 KB |
Output is correct |
81 |
Correct |
18 ms |
7500 KB |
Output is correct |
82 |
Correct |
17 ms |
7584 KB |
Output is correct |
83 |
Correct |
22 ms |
7588 KB |
Output is correct |
84 |
Correct |
17 ms |
7584 KB |
Output is correct |
85 |
Correct |
17 ms |
7604 KB |
Output is correct |
86 |
Correct |
21 ms |
7724 KB |
Output is correct |
87 |
Correct |
22 ms |
7628 KB |
Output is correct |
88 |
Correct |
19 ms |
7644 KB |
Output is correct |
89 |
Correct |
19 ms |
7700 KB |
Output is correct |
90 |
Correct |
18 ms |
7632 KB |
Output is correct |
91 |
Correct |
28 ms |
9384 KB |
Output is correct |
92 |
Correct |
27 ms |
9420 KB |
Output is correct |
93 |
Correct |
28 ms |
9436 KB |
Output is correct |
94 |
Correct |
28 ms |
9420 KB |
Output is correct |
95 |
Correct |
30 ms |
9416 KB |
Output is correct |
96 |
Correct |
35 ms |
9932 KB |
Output is correct |
97 |
Correct |
36 ms |
10012 KB |
Output is correct |
98 |
Correct |
32 ms |
10020 KB |
Output is correct |
99 |
Correct |
32 ms |
9988 KB |
Output is correct |
100 |
Correct |
36 ms |
10028 KB |
Output is correct |
101 |
Correct |
35 ms |
10048 KB |
Output is correct |
102 |
Correct |
35 ms |
10008 KB |
Output is correct |
103 |
Correct |
35 ms |
10104 KB |
Output is correct |
104 |
Correct |
32 ms |
9924 KB |
Output is correct |
105 |
Correct |
33 ms |
10056 KB |
Output is correct |
106 |
Correct |
31 ms |
10264 KB |
Output is correct |
107 |
Correct |
42 ms |
10260 KB |
Output is correct |
108 |
Correct |
33 ms |
10264 KB |
Output is correct |
109 |
Correct |
35 ms |
10272 KB |
Output is correct |
110 |
Correct |
32 ms |
10188 KB |
Output is correct |
111 |
Correct |
36 ms |
10172 KB |
Output is correct |
112 |
Correct |
35 ms |
10232 KB |
Output is correct |
113 |
Correct |
32 ms |
10208 KB |
Output is correct |
114 |
Correct |
32 ms |
10204 KB |
Output is correct |
115 |
Correct |
36 ms |
10200 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
4948 KB |
Output is correct |
2 |
Correct |
3 ms |
4948 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 |
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 |
5024 KB |
Output is correct |
9 |
Correct |
3 ms |
5028 KB |
Output is correct |
10 |
Correct |
2 ms |
5028 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 |
5124 KB |
Output is correct |
14 |
Correct |
8 ms |
6204 KB |
Output is correct |
15 |
Correct |
22 ms |
7612 KB |
Output is correct |
16 |
Correct |
29 ms |
8476 KB |
Output is correct |
17 |
Correct |
29 ms |
9256 KB |
Output is correct |
18 |
Correct |
20 ms |
8412 KB |
Output is correct |
19 |
Correct |
21 ms |
8396 KB |
Output is correct |
20 |
Correct |
26 ms |
8780 KB |
Output is correct |
21 |
Correct |
21 ms |
8476 KB |
Output is correct |
22 |
Correct |
20 ms |
8464 KB |
Output is correct |
23 |
Correct |
22 ms |
8404 KB |
Output is correct |
24 |
Correct |
22 ms |
8564 KB |
Output is correct |
25 |
Correct |
23 ms |
8524 KB |
Output is correct |
26 |
Correct |
3 ms |
4948 KB |
Output is correct |
27 |
Correct |
4 ms |
4948 KB |
Output is correct |
28 |
Correct |
3 ms |
5072 KB |
Output is correct |
29 |
Correct |
9 ms |
6228 KB |
Output is correct |
30 |
Correct |
16 ms |
7380 KB |
Output is correct |
31 |
Correct |
22 ms |
8652 KB |
Output is correct |
32 |
Correct |
26 ms |
8420 KB |
Output is correct |
33 |
Correct |
24 ms |
8532 KB |
Output is correct |
34 |
Correct |
23 ms |
8396 KB |
Output is correct |
35 |
Correct |
24 ms |
8404 KB |
Output is correct |
36 |
Correct |
25 ms |
8332 KB |
Output is correct |
37 |
Correct |
23 ms |
8492 KB |
Output is correct |
38 |
Correct |
22 ms |
8664 KB |
Output is correct |
39 |
Correct |
22 ms |
8432 KB |
Output is correct |
40 |
Correct |
21 ms |
8532 KB |
Output is correct |
41 |
Correct |
3 ms |
5060 KB |
Output is correct |
42 |
Correct |
2 ms |
4948 KB |
Output is correct |
43 |
Correct |
3 ms |
4948 KB |
Output is correct |
44 |
Correct |
3 ms |
5076 KB |
Output is correct |
45 |
Correct |
5 ms |
5076 KB |
Output is correct |
46 |
Correct |
3 ms |
5088 KB |
Output is correct |
47 |
Correct |
6 ms |
5588 KB |
Output is correct |
48 |
Correct |
6 ms |
5588 KB |
Output is correct |
49 |
Correct |
14 ms |
6156 KB |
Output is correct |
50 |
Correct |
18 ms |
7396 KB |
Output is correct |
51 |
Correct |
26 ms |
8464 KB |
Output is correct |
52 |
Correct |
24 ms |
8524 KB |
Output is correct |
53 |
Correct |
23 ms |
8524 KB |
Output is correct |
54 |
Correct |
27 ms |
8524 KB |
Output is correct |
55 |
Correct |
30 ms |
8504 KB |
Output is correct |
56 |
Correct |
26 ms |
8484 KB |
Output is correct |
57 |
Correct |
24 ms |
8460 KB |
Output is correct |
58 |
Correct |
30 ms |
8456 KB |
Output is correct |
59 |
Correct |
24 ms |
8460 KB |
Output is correct |
60 |
Correct |
24 ms |
8456 KB |
Output is correct |
61 |
Correct |
24 ms |
8524 KB |
Output is correct |
62 |
Correct |
26 ms |
8500 KB |
Output is correct |
63 |
Correct |
23 ms |
8460 KB |
Output is correct |
64 |
Correct |
24 ms |
8492 KB |
Output is correct |
65 |
Correct |
27 ms |
8704 KB |
Output is correct |
66 |
Correct |
32 ms |
8500 KB |
Output is correct |
67 |
Correct |
31 ms |
8452 KB |
Output is correct |
68 |
Correct |
26 ms |
8464 KB |
Output is correct |
69 |
Correct |
24 ms |
8472 KB |
Output is correct |
70 |
Correct |
23 ms |
8536 KB |
Output is correct |
71 |
Correct |
6 ms |
5588 KB |
Output is correct |
72 |
Correct |
6 ms |
5660 KB |
Output is correct |
73 |
Correct |
7 ms |
5588 KB |
Output is correct |
74 |
Correct |
7 ms |
5664 KB |
Output is correct |
75 |
Correct |
6 ms |
5588 KB |
Output is correct |
76 |
Correct |
11 ms |
6228 KB |
Output is correct |
77 |
Correct |
10 ms |
6192 KB |
Output is correct |
78 |
Correct |
12 ms |
6304 KB |
Output is correct |
79 |
Correct |
10 ms |
6320 KB |
Output is correct |
80 |
Correct |
10 ms |
6324 KB |
Output is correct |
81 |
Correct |
18 ms |
7500 KB |
Output is correct |
82 |
Correct |
17 ms |
7584 KB |
Output is correct |
83 |
Correct |
22 ms |
7588 KB |
Output is correct |
84 |
Correct |
17 ms |
7584 KB |
Output is correct |
85 |
Correct |
17 ms |
7604 KB |
Output is correct |
86 |
Correct |
21 ms |
7724 KB |
Output is correct |
87 |
Correct |
22 ms |
7628 KB |
Output is correct |
88 |
Correct |
19 ms |
7644 KB |
Output is correct |
89 |
Correct |
19 ms |
7700 KB |
Output is correct |
90 |
Correct |
18 ms |
7632 KB |
Output is correct |
91 |
Correct |
28 ms |
9384 KB |
Output is correct |
92 |
Correct |
27 ms |
9420 KB |
Output is correct |
93 |
Correct |
28 ms |
9436 KB |
Output is correct |
94 |
Correct |
28 ms |
9420 KB |
Output is correct |
95 |
Correct |
30 ms |
9416 KB |
Output is correct |
96 |
Correct |
35 ms |
9932 KB |
Output is correct |
97 |
Correct |
36 ms |
10012 KB |
Output is correct |
98 |
Correct |
32 ms |
10020 KB |
Output is correct |
99 |
Correct |
32 ms |
9988 KB |
Output is correct |
100 |
Correct |
36 ms |
10028 KB |
Output is correct |
101 |
Correct |
35 ms |
10048 KB |
Output is correct |
102 |
Correct |
35 ms |
10008 KB |
Output is correct |
103 |
Correct |
35 ms |
10104 KB |
Output is correct |
104 |
Correct |
32 ms |
9924 KB |
Output is correct |
105 |
Correct |
33 ms |
10056 KB |
Output is correct |
106 |
Correct |
31 ms |
10264 KB |
Output is correct |
107 |
Correct |
42 ms |
10260 KB |
Output is correct |
108 |
Correct |
33 ms |
10264 KB |
Output is correct |
109 |
Correct |
35 ms |
10272 KB |
Output is correct |
110 |
Correct |
32 ms |
10188 KB |
Output is correct |
111 |
Correct |
36 ms |
10172 KB |
Output is correct |
112 |
Correct |
35 ms |
10232 KB |
Output is correct |
113 |
Correct |
32 ms |
10208 KB |
Output is correct |
114 |
Correct |
32 ms |
10204 KB |
Output is correct |
115 |
Correct |
36 ms |
10200 KB |
Output is correct |
116 |
Correct |
154 ms |
7212 KB |
Output is correct |
117 |
Correct |
161 ms |
7180 KB |
Output is correct |
118 |
Correct |
233 ms |
7760 KB |
Output is correct |
119 |
Correct |
219 ms |
7908 KB |
Output is correct |
120 |
Correct |
185 ms |
7872 KB |
Output is correct |
121 |
Correct |
351 ms |
8428 KB |
Output is correct |
122 |
Correct |
286 ms |
8468 KB |
Output is correct |
123 |
Correct |
1020 ms |
9768 KB |
Output is correct |
124 |
Correct |
674 ms |
9948 KB |
Output is correct |
125 |
Correct |
714 ms |
9968 KB |
Output is correct |
126 |
Correct |
2449 ms |
10784 KB |
Output is correct |
127 |
Correct |
2451 ms |
10772 KB |
Output is correct |
128 |
Correct |
2515 ms |
10780 KB |
Output is correct |
129 |
Correct |
2478 ms |
10776 KB |
Output is correct |
130 |
Correct |
2472 ms |
10764 KB |
Output is correct |
131 |
Correct |
2592 ms |
10924 KB |
Output is correct |
132 |
Correct |
2564 ms |
10928 KB |
Output is correct |
133 |
Correct |
2546 ms |
10908 KB |
Output is correct |
134 |
Correct |
2588 ms |
10912 KB |
Output is correct |
135 |
Correct |
2590 ms |
10932 KB |
Output is correct |
136 |
Correct |
2566 ms |
10940 KB |
Output is correct |
137 |
Correct |
2590 ms |
10940 KB |
Output is correct |
138 |
Correct |
2578 ms |
11044 KB |
Output is correct |
139 |
Correct |
2613 ms |
10912 KB |
Output is correct |
140 |
Correct |
2606 ms |
10928 KB |
Output is correct |
141 |
Correct |
2127 ms |
10940 KB |
Output is correct |
142 |
Correct |
2180 ms |
10948 KB |
Output is correct |
143 |
Correct |
2186 ms |
10896 KB |
Output is correct |
144 |
Correct |
2205 ms |
10952 KB |
Output is correct |
145 |
Correct |
2158 ms |
11000 KB |
Output is correct |
146 |
Correct |
1311 ms |
11208 KB |
Output is correct |
147 |
Correct |
1325 ms |
11164 KB |
Output is correct |
148 |
Correct |
1367 ms |
11208 KB |
Output is correct |
149 |
Correct |
1332 ms |
11328 KB |
Output is correct |
150 |
Correct |
1344 ms |
11320 KB |
Output is correct |
151 |
Correct |
1476 ms |
11392 KB |
Output is correct |
152 |
Correct |
1454 ms |
11260 KB |
Output is correct |
153 |
Correct |
1487 ms |
11260 KB |
Output is correct |
154 |
Correct |
1471 ms |
11376 KB |
Output is correct |
155 |
Correct |
1495 ms |
11260 KB |
Output is correct |
156 |
Correct |
2675 ms |
11916 KB |
Output is correct |
157 |
Correct |
2675 ms |
11968 KB |
Output is correct |
158 |
Correct |
2675 ms |
11864 KB |
Output is correct |
159 |
Correct |
2686 ms |
11840 KB |
Output is correct |
160 |
Correct |
2661 ms |
11900 KB |
Output is correct |
161 |
Correct |
2598 ms |
12100 KB |
Output is correct |
162 |
Correct |
2579 ms |
11964 KB |
Output is correct |
163 |
Correct |
2588 ms |
11912 KB |
Output is correct |
164 |
Correct |
2580 ms |
11936 KB |
Output is correct |
165 |
Correct |
2567 ms |
11896 KB |
Output is correct |
166 |
Correct |
2517 ms |
11528 KB |
Output is correct |
167 |
Correct |
2525 ms |
11476 KB |
Output is correct |
168 |
Correct |
2550 ms |
11484 KB |
Output is correct |
169 |
Correct |
2540 ms |
11524 KB |
Output is correct |
170 |
Correct |
2555 ms |
11504 KB |
Output is correct |
171 |
Correct |
2416 ms |
11440 KB |
Output is correct |
172 |
Correct |
2435 ms |
11444 KB |
Output is correct |
173 |
Correct |
2402 ms |
11436 KB |
Output is correct |
174 |
Correct |
2333 ms |
11456 KB |
Output is correct |
175 |
Correct |
2360 ms |
11500 KB |
Output is correct |