#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef vector<ll> vi;
typedef pair<ll, ll> pii;
typedef vector<pii> vpii;
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
const ll INF = 1e18;
int N, Q;
int A[300007];
ll ans[50005];
int freq[300007];
int cnt[300007];
unordered_set<int> S;
int stuff[300007];
int idx;
ll tmp;
int pref, suff, n;
struct query
{
int l, r, idx;
};
ll totalLengthOfSubsequences(ll x)
{
return x * (x + 1) * (x + 2) / 6;
}
void doStuff(ll x, ll y)
{
ll len = x * y;
// if both are in set
tmp += x * x * (totalLengthOfSubsequences(y) - y) + y * x * (x + 1) / 2;
// if one is inside the other isn't
tmp += (n - len) * (x * y * (y + 1) / 2);
// if both are outside
tmp += y * pref * (n - pref - len);
pref += len;
swap(pref, suff);
}
void add(int x)
{
if (freq[x] > 0)
--cnt[freq[x]];
++freq[x];
++cnt[freq[x]];
if (cnt[freq[x]] == 1)
stuff[idx++] = freq[x];
}
void sub(int x)
{
--cnt[freq[x]];
--freq[x];
if (freq[x])
{
++cnt[freq[x]];
if (cnt[freq[x]] == 1)
stuff[idx++] = freq[x];
}
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cin >> N >> Q;
for (int i = 0; i < N; ++i)
cin >> A[i];
vector<query> Qu(Q);
for (int i = 0; i < Q; ++i)
cin >> Qu[i].l >> Qu[i].r, Qu[i].idx = i, --Qu[i].l;
int sq = ceil(sqrt(N));
auto cmp = [&](const query &a, const query &b)
{ if (a.l / sq == b.l / sq)
return a.r < b.r;
else
return a.l < b.l; };
sort(all(Qu), cmp);
int lx = 0, rx = 0;
fill(freq, freq + *max_element(A, A + N) + 1, 0);
fill(cnt, cnt + N + 3, 0);
for (query q : Qu)
{
while (rx < q.r)
add(A[rx++]);
while (lx > q.l)
add(A[--lx]);
while (rx > q.r)
sub(A[--rx]);
while (lx < q.l)
sub(A[lx++]);
n = q.r - q.l;
pref = 0, suff = 0;
tmp = 0;
for (int i = 0; i < idx;)
{
if (cnt[stuff[i]] <= 0)
swap(stuff[i], stuff[--idx]);
else
cnt[stuff[i]] *= -1, ++i;
}
sort(stuff, stuff + idx);
for (int i = 0; i < idx; ++i)
{
ll x = stuff[i];
cnt[x] *= -1;
doStuff(x, (cnt[x] + 1) / 2);
if (cnt[x] > 1)
{
doStuff(x, cnt[x] / 2);
if (cnt[x] & 1)
swap(pref, suff);
}
}
ans[q.idx] = tmp;
}
for (int i = 0; i < Q; ++i)
cout << ans[i] << "\n";
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
428 KB |
Output is correct |
2 |
Correct |
0 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
1 ms |
336 KB |
Output is correct |
5 |
Correct |
1 ms |
340 KB |
Output is correct |
6 |
Correct |
0 ms |
340 KB |
Output is correct |
7 |
Correct |
1 ms |
340 KB |
Output is correct |
8 |
Correct |
0 ms |
340 KB |
Output is correct |
9 |
Correct |
1 ms |
340 KB |
Output is correct |
10 |
Correct |
0 ms |
336 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
340 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
3 |
Correct |
2 ms |
448 KB |
Output is correct |
4 |
Correct |
8 ms |
1620 KB |
Output is correct |
5 |
Correct |
10 ms |
3060 KB |
Output is correct |
6 |
Correct |
15 ms |
4456 KB |
Output is correct |
7 |
Correct |
16 ms |
4412 KB |
Output is correct |
8 |
Correct |
15 ms |
4412 KB |
Output is correct |
9 |
Correct |
18 ms |
4412 KB |
Output is correct |
10 |
Correct |
15 ms |
4436 KB |
Output is correct |
11 |
Correct |
17 ms |
4428 KB |
Output is correct |
12 |
Correct |
16 ms |
4492 KB |
Output is correct |
13 |
Correct |
23 ms |
4428 KB |
Output is correct |
14 |
Correct |
15 ms |
4436 KB |
Output is correct |
15 |
Correct |
15 ms |
4448 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
340 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
3 |
Correct |
2 ms |
448 KB |
Output is correct |
4 |
Correct |
8 ms |
1620 KB |
Output is correct |
5 |
Correct |
10 ms |
3060 KB |
Output is correct |
6 |
Correct |
15 ms |
4456 KB |
Output is correct |
7 |
Correct |
16 ms |
4412 KB |
Output is correct |
8 |
Correct |
15 ms |
4412 KB |
Output is correct |
9 |
Correct |
18 ms |
4412 KB |
Output is correct |
10 |
Correct |
15 ms |
4436 KB |
Output is correct |
11 |
Correct |
17 ms |
4428 KB |
Output is correct |
12 |
Correct |
16 ms |
4492 KB |
Output is correct |
13 |
Correct |
23 ms |
4428 KB |
Output is correct |
14 |
Correct |
15 ms |
4436 KB |
Output is correct |
15 |
Correct |
15 ms |
4448 KB |
Output is correct |
16 |
Correct |
1 ms |
340 KB |
Output is correct |
17 |
Correct |
1 ms |
340 KB |
Output is correct |
18 |
Correct |
1 ms |
468 KB |
Output is correct |
19 |
Correct |
6 ms |
1748 KB |
Output is correct |
20 |
Correct |
11 ms |
3132 KB |
Output is correct |
21 |
Correct |
17 ms |
4568 KB |
Output is correct |
22 |
Correct |
17 ms |
4564 KB |
Output is correct |
23 |
Correct |
16 ms |
4572 KB |
Output is correct |
24 |
Correct |
24 ms |
4512 KB |
Output is correct |
25 |
Correct |
16 ms |
4564 KB |
Output is correct |
26 |
Correct |
18 ms |
4568 KB |
Output is correct |
27 |
Correct |
16 ms |
4564 KB |
Output is correct |
28 |
Correct |
24 ms |
4564 KB |
Output is correct |
29 |
Correct |
17 ms |
4528 KB |
Output is correct |
30 |
Correct |
16 ms |
4580 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
340 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
3 |
Correct |
2 ms |
448 KB |
Output is correct |
4 |
Correct |
8 ms |
1620 KB |
Output is correct |
5 |
Correct |
10 ms |
3060 KB |
Output is correct |
6 |
Correct |
15 ms |
4456 KB |
Output is correct |
7 |
Correct |
16 ms |
4412 KB |
Output is correct |
8 |
Correct |
15 ms |
4412 KB |
Output is correct |
9 |
Correct |
18 ms |
4412 KB |
Output is correct |
10 |
Correct |
15 ms |
4436 KB |
Output is correct |
11 |
Correct |
17 ms |
4428 KB |
Output is correct |
12 |
Correct |
16 ms |
4492 KB |
Output is correct |
13 |
Correct |
23 ms |
4428 KB |
Output is correct |
14 |
Correct |
15 ms |
4436 KB |
Output is correct |
15 |
Correct |
15 ms |
4448 KB |
Output is correct |
16 |
Correct |
1 ms |
340 KB |
Output is correct |
17 |
Correct |
1 ms |
340 KB |
Output is correct |
18 |
Correct |
1 ms |
468 KB |
Output is correct |
19 |
Correct |
6 ms |
1748 KB |
Output is correct |
20 |
Correct |
11 ms |
3132 KB |
Output is correct |
21 |
Correct |
17 ms |
4568 KB |
Output is correct |
22 |
Correct |
17 ms |
4564 KB |
Output is correct |
23 |
Correct |
16 ms |
4572 KB |
Output is correct |
24 |
Correct |
24 ms |
4512 KB |
Output is correct |
25 |
Correct |
16 ms |
4564 KB |
Output is correct |
26 |
Correct |
18 ms |
4568 KB |
Output is correct |
27 |
Correct |
16 ms |
4564 KB |
Output is correct |
28 |
Correct |
24 ms |
4564 KB |
Output is correct |
29 |
Correct |
17 ms |
4528 KB |
Output is correct |
30 |
Correct |
16 ms |
4580 KB |
Output is correct |
31 |
Correct |
1 ms |
340 KB |
Output is correct |
32 |
Correct |
1 ms |
340 KB |
Output is correct |
33 |
Correct |
1 ms |
336 KB |
Output is correct |
34 |
Correct |
1 ms |
468 KB |
Output is correct |
35 |
Correct |
1 ms |
468 KB |
Output is correct |
36 |
Correct |
1 ms |
468 KB |
Output is correct |
37 |
Correct |
4 ms |
980 KB |
Output is correct |
38 |
Correct |
5 ms |
864 KB |
Output is correct |
39 |
Correct |
7 ms |
1492 KB |
Output is correct |
40 |
Correct |
12 ms |
2820 KB |
Output is correct |
41 |
Correct |
17 ms |
4172 KB |
Output is correct |
42 |
Correct |
20 ms |
4172 KB |
Output is correct |
43 |
Correct |
18 ms |
4188 KB |
Output is correct |
44 |
Correct |
17 ms |
4232 KB |
Output is correct |
45 |
Correct |
17 ms |
4196 KB |
Output is correct |
46 |
Correct |
22 ms |
4192 KB |
Output is correct |
47 |
Correct |
18 ms |
4232 KB |
Output is correct |
48 |
Correct |
18 ms |
4132 KB |
Output is correct |
49 |
Correct |
18 ms |
4180 KB |
Output is correct |
50 |
Correct |
19 ms |
4224 KB |
Output is correct |
51 |
Correct |
20 ms |
4144 KB |
Output is correct |
52 |
Correct |
18 ms |
4192 KB |
Output is correct |
53 |
Correct |
18 ms |
4184 KB |
Output is correct |
54 |
Correct |
18 ms |
4184 KB |
Output is correct |
55 |
Correct |
18 ms |
4188 KB |
Output is correct |
56 |
Correct |
18 ms |
4172 KB |
Output is correct |
57 |
Correct |
17 ms |
4172 KB |
Output is correct |
58 |
Correct |
22 ms |
4180 KB |
Output is correct |
59 |
Correct |
24 ms |
4168 KB |
Output is correct |
60 |
Correct |
27 ms |
4180 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
428 KB |
Output is correct |
2 |
Correct |
0 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
1 ms |
336 KB |
Output is correct |
5 |
Correct |
1 ms |
340 KB |
Output is correct |
6 |
Correct |
0 ms |
340 KB |
Output is correct |
7 |
Correct |
1 ms |
340 KB |
Output is correct |
8 |
Correct |
0 ms |
340 KB |
Output is correct |
9 |
Correct |
1 ms |
340 KB |
Output is correct |
10 |
Correct |
0 ms |
336 KB |
Output is correct |
11 |
Correct |
0 ms |
340 KB |
Output is correct |
12 |
Correct |
1 ms |
340 KB |
Output is correct |
13 |
Correct |
2 ms |
448 KB |
Output is correct |
14 |
Correct |
8 ms |
1620 KB |
Output is correct |
15 |
Correct |
10 ms |
3060 KB |
Output is correct |
16 |
Correct |
15 ms |
4456 KB |
Output is correct |
17 |
Correct |
16 ms |
4412 KB |
Output is correct |
18 |
Correct |
15 ms |
4412 KB |
Output is correct |
19 |
Correct |
18 ms |
4412 KB |
Output is correct |
20 |
Correct |
15 ms |
4436 KB |
Output is correct |
21 |
Correct |
17 ms |
4428 KB |
Output is correct |
22 |
Correct |
16 ms |
4492 KB |
Output is correct |
23 |
Correct |
23 ms |
4428 KB |
Output is correct |
24 |
Correct |
15 ms |
4436 KB |
Output is correct |
25 |
Correct |
15 ms |
4448 KB |
Output is correct |
26 |
Correct |
1 ms |
340 KB |
Output is correct |
27 |
Correct |
1 ms |
340 KB |
Output is correct |
28 |
Correct |
1 ms |
468 KB |
Output is correct |
29 |
Correct |
6 ms |
1748 KB |
Output is correct |
30 |
Correct |
11 ms |
3132 KB |
Output is correct |
31 |
Correct |
17 ms |
4568 KB |
Output is correct |
32 |
Correct |
17 ms |
4564 KB |
Output is correct |
33 |
Correct |
16 ms |
4572 KB |
Output is correct |
34 |
Correct |
24 ms |
4512 KB |
Output is correct |
35 |
Correct |
16 ms |
4564 KB |
Output is correct |
36 |
Correct |
18 ms |
4568 KB |
Output is correct |
37 |
Correct |
16 ms |
4564 KB |
Output is correct |
38 |
Correct |
24 ms |
4564 KB |
Output is correct |
39 |
Correct |
17 ms |
4528 KB |
Output is correct |
40 |
Correct |
16 ms |
4580 KB |
Output is correct |
41 |
Correct |
1 ms |
340 KB |
Output is correct |
42 |
Correct |
1 ms |
340 KB |
Output is correct |
43 |
Correct |
1 ms |
336 KB |
Output is correct |
44 |
Correct |
1 ms |
468 KB |
Output is correct |
45 |
Correct |
1 ms |
468 KB |
Output is correct |
46 |
Correct |
1 ms |
468 KB |
Output is correct |
47 |
Correct |
4 ms |
980 KB |
Output is correct |
48 |
Correct |
5 ms |
864 KB |
Output is correct |
49 |
Correct |
7 ms |
1492 KB |
Output is correct |
50 |
Correct |
12 ms |
2820 KB |
Output is correct |
51 |
Correct |
17 ms |
4172 KB |
Output is correct |
52 |
Correct |
20 ms |
4172 KB |
Output is correct |
53 |
Correct |
18 ms |
4188 KB |
Output is correct |
54 |
Correct |
17 ms |
4232 KB |
Output is correct |
55 |
Correct |
17 ms |
4196 KB |
Output is correct |
56 |
Correct |
22 ms |
4192 KB |
Output is correct |
57 |
Correct |
18 ms |
4232 KB |
Output is correct |
58 |
Correct |
18 ms |
4132 KB |
Output is correct |
59 |
Correct |
18 ms |
4180 KB |
Output is correct |
60 |
Correct |
19 ms |
4224 KB |
Output is correct |
61 |
Correct |
20 ms |
4144 KB |
Output is correct |
62 |
Correct |
18 ms |
4192 KB |
Output is correct |
63 |
Correct |
18 ms |
4184 KB |
Output is correct |
64 |
Correct |
18 ms |
4184 KB |
Output is correct |
65 |
Correct |
18 ms |
4188 KB |
Output is correct |
66 |
Correct |
18 ms |
4172 KB |
Output is correct |
67 |
Correct |
17 ms |
4172 KB |
Output is correct |
68 |
Correct |
22 ms |
4180 KB |
Output is correct |
69 |
Correct |
24 ms |
4168 KB |
Output is correct |
70 |
Correct |
27 ms |
4180 KB |
Output is correct |
71 |
Correct |
6 ms |
980 KB |
Output is correct |
72 |
Correct |
3 ms |
980 KB |
Output is correct |
73 |
Correct |
4 ms |
980 KB |
Output is correct |
74 |
Correct |
4 ms |
868 KB |
Output is correct |
75 |
Correct |
3 ms |
980 KB |
Output is correct |
76 |
Correct |
7 ms |
1624 KB |
Output is correct |
77 |
Correct |
7 ms |
1576 KB |
Output is correct |
78 |
Correct |
6 ms |
1620 KB |
Output is correct |
79 |
Correct |
10 ms |
1568 KB |
Output is correct |
80 |
Correct |
6 ms |
1620 KB |
Output is correct |
81 |
Correct |
12 ms |
2900 KB |
Output is correct |
82 |
Correct |
16 ms |
2896 KB |
Output is correct |
83 |
Correct |
12 ms |
2912 KB |
Output is correct |
84 |
Correct |
12 ms |
2892 KB |
Output is correct |
85 |
Correct |
12 ms |
2812 KB |
Output is correct |
86 |
Correct |
14 ms |
3028 KB |
Output is correct |
87 |
Correct |
16 ms |
3036 KB |
Output is correct |
88 |
Correct |
18 ms |
3028 KB |
Output is correct |
89 |
Correct |
14 ms |
3036 KB |
Output is correct |
90 |
Correct |
13 ms |
3028 KB |
Output is correct |
91 |
Correct |
20 ms |
4768 KB |
Output is correct |
92 |
Correct |
20 ms |
4708 KB |
Output is correct |
93 |
Correct |
20 ms |
4704 KB |
Output is correct |
94 |
Correct |
21 ms |
4744 KB |
Output is correct |
95 |
Correct |
20 ms |
4768 KB |
Output is correct |
96 |
Correct |
24 ms |
5232 KB |
Output is correct |
97 |
Correct |
24 ms |
5244 KB |
Output is correct |
98 |
Correct |
24 ms |
5312 KB |
Output is correct |
99 |
Correct |
24 ms |
5252 KB |
Output is correct |
100 |
Correct |
23 ms |
5344 KB |
Output is correct |
101 |
Correct |
23 ms |
5248 KB |
Output is correct |
102 |
Correct |
23 ms |
5264 KB |
Output is correct |
103 |
Correct |
28 ms |
5328 KB |
Output is correct |
104 |
Correct |
23 ms |
5332 KB |
Output is correct |
105 |
Correct |
25 ms |
5360 KB |
Output is correct |
106 |
Correct |
23 ms |
5472 KB |
Output is correct |
107 |
Correct |
23 ms |
5472 KB |
Output is correct |
108 |
Correct |
22 ms |
5492 KB |
Output is correct |
109 |
Correct |
22 ms |
5456 KB |
Output is correct |
110 |
Correct |
23 ms |
5500 KB |
Output is correct |
111 |
Correct |
23 ms |
5584 KB |
Output is correct |
112 |
Correct |
23 ms |
5572 KB |
Output is correct |
113 |
Correct |
23 ms |
5544 KB |
Output is correct |
114 |
Correct |
23 ms |
5552 KB |
Output is correct |
115 |
Correct |
22 ms |
5516 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
428 KB |
Output is correct |
2 |
Correct |
0 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
1 ms |
336 KB |
Output is correct |
5 |
Correct |
1 ms |
340 KB |
Output is correct |
6 |
Correct |
0 ms |
340 KB |
Output is correct |
7 |
Correct |
1 ms |
340 KB |
Output is correct |
8 |
Correct |
0 ms |
340 KB |
Output is correct |
9 |
Correct |
1 ms |
340 KB |
Output is correct |
10 |
Correct |
0 ms |
336 KB |
Output is correct |
11 |
Correct |
0 ms |
340 KB |
Output is correct |
12 |
Correct |
1 ms |
340 KB |
Output is correct |
13 |
Correct |
2 ms |
448 KB |
Output is correct |
14 |
Correct |
8 ms |
1620 KB |
Output is correct |
15 |
Correct |
10 ms |
3060 KB |
Output is correct |
16 |
Correct |
15 ms |
4456 KB |
Output is correct |
17 |
Correct |
16 ms |
4412 KB |
Output is correct |
18 |
Correct |
15 ms |
4412 KB |
Output is correct |
19 |
Correct |
18 ms |
4412 KB |
Output is correct |
20 |
Correct |
15 ms |
4436 KB |
Output is correct |
21 |
Correct |
17 ms |
4428 KB |
Output is correct |
22 |
Correct |
16 ms |
4492 KB |
Output is correct |
23 |
Correct |
23 ms |
4428 KB |
Output is correct |
24 |
Correct |
15 ms |
4436 KB |
Output is correct |
25 |
Correct |
15 ms |
4448 KB |
Output is correct |
26 |
Correct |
1 ms |
340 KB |
Output is correct |
27 |
Correct |
1 ms |
340 KB |
Output is correct |
28 |
Correct |
1 ms |
468 KB |
Output is correct |
29 |
Correct |
6 ms |
1748 KB |
Output is correct |
30 |
Correct |
11 ms |
3132 KB |
Output is correct |
31 |
Correct |
17 ms |
4568 KB |
Output is correct |
32 |
Correct |
17 ms |
4564 KB |
Output is correct |
33 |
Correct |
16 ms |
4572 KB |
Output is correct |
34 |
Correct |
24 ms |
4512 KB |
Output is correct |
35 |
Correct |
16 ms |
4564 KB |
Output is correct |
36 |
Correct |
18 ms |
4568 KB |
Output is correct |
37 |
Correct |
16 ms |
4564 KB |
Output is correct |
38 |
Correct |
24 ms |
4564 KB |
Output is correct |
39 |
Correct |
17 ms |
4528 KB |
Output is correct |
40 |
Correct |
16 ms |
4580 KB |
Output is correct |
41 |
Correct |
1 ms |
340 KB |
Output is correct |
42 |
Correct |
1 ms |
340 KB |
Output is correct |
43 |
Correct |
1 ms |
336 KB |
Output is correct |
44 |
Correct |
1 ms |
468 KB |
Output is correct |
45 |
Correct |
1 ms |
468 KB |
Output is correct |
46 |
Correct |
1 ms |
468 KB |
Output is correct |
47 |
Correct |
4 ms |
980 KB |
Output is correct |
48 |
Correct |
5 ms |
864 KB |
Output is correct |
49 |
Correct |
7 ms |
1492 KB |
Output is correct |
50 |
Correct |
12 ms |
2820 KB |
Output is correct |
51 |
Correct |
17 ms |
4172 KB |
Output is correct |
52 |
Correct |
20 ms |
4172 KB |
Output is correct |
53 |
Correct |
18 ms |
4188 KB |
Output is correct |
54 |
Correct |
17 ms |
4232 KB |
Output is correct |
55 |
Correct |
17 ms |
4196 KB |
Output is correct |
56 |
Correct |
22 ms |
4192 KB |
Output is correct |
57 |
Correct |
18 ms |
4232 KB |
Output is correct |
58 |
Correct |
18 ms |
4132 KB |
Output is correct |
59 |
Correct |
18 ms |
4180 KB |
Output is correct |
60 |
Correct |
19 ms |
4224 KB |
Output is correct |
61 |
Correct |
20 ms |
4144 KB |
Output is correct |
62 |
Correct |
18 ms |
4192 KB |
Output is correct |
63 |
Correct |
18 ms |
4184 KB |
Output is correct |
64 |
Correct |
18 ms |
4184 KB |
Output is correct |
65 |
Correct |
18 ms |
4188 KB |
Output is correct |
66 |
Correct |
18 ms |
4172 KB |
Output is correct |
67 |
Correct |
17 ms |
4172 KB |
Output is correct |
68 |
Correct |
22 ms |
4180 KB |
Output is correct |
69 |
Correct |
24 ms |
4168 KB |
Output is correct |
70 |
Correct |
27 ms |
4180 KB |
Output is correct |
71 |
Correct |
6 ms |
980 KB |
Output is correct |
72 |
Correct |
3 ms |
980 KB |
Output is correct |
73 |
Correct |
4 ms |
980 KB |
Output is correct |
74 |
Correct |
4 ms |
868 KB |
Output is correct |
75 |
Correct |
3 ms |
980 KB |
Output is correct |
76 |
Correct |
7 ms |
1624 KB |
Output is correct |
77 |
Correct |
7 ms |
1576 KB |
Output is correct |
78 |
Correct |
6 ms |
1620 KB |
Output is correct |
79 |
Correct |
10 ms |
1568 KB |
Output is correct |
80 |
Correct |
6 ms |
1620 KB |
Output is correct |
81 |
Correct |
12 ms |
2900 KB |
Output is correct |
82 |
Correct |
16 ms |
2896 KB |
Output is correct |
83 |
Correct |
12 ms |
2912 KB |
Output is correct |
84 |
Correct |
12 ms |
2892 KB |
Output is correct |
85 |
Correct |
12 ms |
2812 KB |
Output is correct |
86 |
Correct |
14 ms |
3028 KB |
Output is correct |
87 |
Correct |
16 ms |
3036 KB |
Output is correct |
88 |
Correct |
18 ms |
3028 KB |
Output is correct |
89 |
Correct |
14 ms |
3036 KB |
Output is correct |
90 |
Correct |
13 ms |
3028 KB |
Output is correct |
91 |
Correct |
20 ms |
4768 KB |
Output is correct |
92 |
Correct |
20 ms |
4708 KB |
Output is correct |
93 |
Correct |
20 ms |
4704 KB |
Output is correct |
94 |
Correct |
21 ms |
4744 KB |
Output is correct |
95 |
Correct |
20 ms |
4768 KB |
Output is correct |
96 |
Correct |
24 ms |
5232 KB |
Output is correct |
97 |
Correct |
24 ms |
5244 KB |
Output is correct |
98 |
Correct |
24 ms |
5312 KB |
Output is correct |
99 |
Correct |
24 ms |
5252 KB |
Output is correct |
100 |
Correct |
23 ms |
5344 KB |
Output is correct |
101 |
Correct |
23 ms |
5248 KB |
Output is correct |
102 |
Correct |
23 ms |
5264 KB |
Output is correct |
103 |
Correct |
28 ms |
5328 KB |
Output is correct |
104 |
Correct |
23 ms |
5332 KB |
Output is correct |
105 |
Correct |
25 ms |
5360 KB |
Output is correct |
106 |
Correct |
23 ms |
5472 KB |
Output is correct |
107 |
Correct |
23 ms |
5472 KB |
Output is correct |
108 |
Correct |
22 ms |
5492 KB |
Output is correct |
109 |
Correct |
22 ms |
5456 KB |
Output is correct |
110 |
Correct |
23 ms |
5500 KB |
Output is correct |
111 |
Correct |
23 ms |
5584 KB |
Output is correct |
112 |
Correct |
23 ms |
5572 KB |
Output is correct |
113 |
Correct |
23 ms |
5544 KB |
Output is correct |
114 |
Correct |
23 ms |
5552 KB |
Output is correct |
115 |
Correct |
22 ms |
5516 KB |
Output is correct |
116 |
Correct |
93 ms |
2324 KB |
Output is correct |
117 |
Correct |
116 ms |
2312 KB |
Output is correct |
118 |
Correct |
239 ms |
3092 KB |
Output is correct |
119 |
Correct |
242 ms |
3024 KB |
Output is correct |
120 |
Correct |
162 ms |
3044 KB |
Output is correct |
121 |
Correct |
359 ms |
3648 KB |
Output is correct |
122 |
Correct |
264 ms |
3752 KB |
Output is correct |
123 |
Correct |
845 ms |
5136 KB |
Output is correct |
124 |
Correct |
416 ms |
5128 KB |
Output is correct |
125 |
Correct |
386 ms |
5160 KB |
Output is correct |
126 |
Correct |
1493 ms |
6820 KB |
Output is correct |
127 |
Correct |
1475 ms |
6820 KB |
Output is correct |
128 |
Correct |
1505 ms |
6812 KB |
Output is correct |
129 |
Correct |
1493 ms |
6816 KB |
Output is correct |
130 |
Correct |
1518 ms |
6804 KB |
Output is correct |
131 |
Correct |
1708 ms |
6688 KB |
Output is correct |
132 |
Correct |
1754 ms |
6776 KB |
Output is correct |
133 |
Correct |
1696 ms |
6824 KB |
Output is correct |
134 |
Correct |
1711 ms |
6872 KB |
Output is correct |
135 |
Correct |
1705 ms |
6916 KB |
Output is correct |
136 |
Correct |
1730 ms |
6752 KB |
Output is correct |
137 |
Correct |
1729 ms |
6824 KB |
Output is correct |
138 |
Correct |
1756 ms |
6756 KB |
Output is correct |
139 |
Correct |
1702 ms |
6788 KB |
Output is correct |
140 |
Correct |
1736 ms |
6776 KB |
Output is correct |
141 |
Correct |
1421 ms |
6472 KB |
Output is correct |
142 |
Correct |
1487 ms |
6492 KB |
Output is correct |
143 |
Correct |
1479 ms |
6484 KB |
Output is correct |
144 |
Correct |
1471 ms |
6496 KB |
Output is correct |
145 |
Correct |
1441 ms |
6480 KB |
Output is correct |
146 |
Correct |
674 ms |
6400 KB |
Output is correct |
147 |
Correct |
669 ms |
6348 KB |
Output is correct |
148 |
Correct |
683 ms |
6420 KB |
Output is correct |
149 |
Correct |
652 ms |
6412 KB |
Output is correct |
150 |
Correct |
664 ms |
6400 KB |
Output is correct |
151 |
Correct |
637 ms |
6432 KB |
Output is correct |
152 |
Correct |
620 ms |
6428 KB |
Output is correct |
153 |
Correct |
641 ms |
6424 KB |
Output is correct |
154 |
Correct |
622 ms |
6424 KB |
Output is correct |
155 |
Correct |
602 ms |
6416 KB |
Output is correct |
156 |
Correct |
1706 ms |
7788 KB |
Output is correct |
157 |
Correct |
1663 ms |
7788 KB |
Output is correct |
158 |
Correct |
1686 ms |
7784 KB |
Output is correct |
159 |
Correct |
1660 ms |
7780 KB |
Output is correct |
160 |
Correct |
1683 ms |
7788 KB |
Output is correct |
161 |
Correct |
1543 ms |
7928 KB |
Output is correct |
162 |
Correct |
1578 ms |
7928 KB |
Output is correct |
163 |
Correct |
1568 ms |
7928 KB |
Output is correct |
164 |
Correct |
1537 ms |
7924 KB |
Output is correct |
165 |
Correct |
1521 ms |
7932 KB |
Output is correct |
166 |
Correct |
1740 ms |
7808 KB |
Output is correct |
167 |
Correct |
1759 ms |
7816 KB |
Output is correct |
168 |
Correct |
1756 ms |
7796 KB |
Output is correct |
169 |
Correct |
1752 ms |
7820 KB |
Output is correct |
170 |
Correct |
1743 ms |
7816 KB |
Output is correct |
171 |
Correct |
1459 ms |
7872 KB |
Output is correct |
172 |
Correct |
1482 ms |
7872 KB |
Output is correct |
173 |
Correct |
1501 ms |
7880 KB |
Output is correct |
174 |
Correct |
1463 ms |
7868 KB |
Output is correct |
175 |
Correct |
1484 ms |
7880 KB |
Output is correct |