#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 numberOfSubsequences(ll x)
{
return x * (x + 1) / 2;
}
ll totalLengthOfSubsequences(ll x)
{
return x * (x + 1) * (x + 2) / 6;
// return x * (x + 1) * (x + 1) / 2 - (2 * x + 1) * (x + 1) * x / 6;
}
void doStuff(ll x, ll y)
{
ll len = x * y;
// if both are in set
// tmp += x * x * (totalLengthOfSubsequences(y) - y) + y * numberOfSubsequences(x);
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);
}
struct segtree
{
int arr[1 << 20];
int size;
void init(int _size)
{
size = 1;
while (size < _size)
size *= 2;
fill(arr, arr + 2 * size, 0);
}
void add(int i, int v)
{
i += size;
while (i > 0)
{
arr[i] += v;
i /= 2;
}
}
void dfs(int x)
{
if (arr[x] == 0)
return;
if (x < size)
{
dfs(2 * x);
dfs(2 * x + 1);
}
else
{
// arr[x] := how often
doStuff(x - size, (arr[x] + 1) / 2);
if (arr[x] > 1)
{
doStuff(x - size, arr[x] / 2);
if (arr[x] & 1)
swap(pref, suff);
}
}
}
};
segtree seg;
void add(int x)
{
if (freq[x] > 0)
{
// seg.add(freq[x], -1);
--cnt[freq[x]];
// if (cnt[freq[x]] == 0)
// S.erase(freq[x]);
}
++freq[x];
// seg.add(freq[x], 1);
++cnt[freq[x]];
if (cnt[freq[x]] == 1)
stuff[idx++] = freq[x];
}
void sub(int x)
{
// seg.add(freq[x], -1);
--cnt[freq[x]];
// if (cnt[freq[x]] == 0)
// S.erase(freq[x]);
--freq[x];
if (freq[x])
{
// seg.add(freq[x], 1);
++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);
seg.init(N + 1);
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;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
3 |
Correct |
0 ms |
340 KB |
Output is correct |
4 |
Correct |
1 ms |
344 KB |
Output is correct |
5 |
Correct |
1 ms |
340 KB |
Output is correct |
6 |
Correct |
0 ms |
336 KB |
Output is correct |
7 |
Correct |
1 ms |
340 KB |
Output is correct |
8 |
Correct |
0 ms |
340 KB |
Output is correct |
9 |
Correct |
0 ms |
340 KB |
Output is correct |
10 |
Correct |
0 ms |
340 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
340 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
608 KB |
Output is correct |
4 |
Correct |
5 ms |
2656 KB |
Output is correct |
5 |
Correct |
10 ms |
5076 KB |
Output is correct |
6 |
Correct |
18 ms |
8548 KB |
Output is correct |
7 |
Correct |
24 ms |
8524 KB |
Output is correct |
8 |
Correct |
16 ms |
8544 KB |
Output is correct |
9 |
Correct |
24 ms |
8544 KB |
Output is correct |
10 |
Correct |
16 ms |
8540 KB |
Output is correct |
11 |
Correct |
16 ms |
8544 KB |
Output is correct |
12 |
Correct |
21 ms |
8604 KB |
Output is correct |
13 |
Correct |
24 ms |
8552 KB |
Output is correct |
14 |
Correct |
17 ms |
8568 KB |
Output is correct |
15 |
Correct |
16 ms |
8572 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
340 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
608 KB |
Output is correct |
4 |
Correct |
5 ms |
2656 KB |
Output is correct |
5 |
Correct |
10 ms |
5076 KB |
Output is correct |
6 |
Correct |
18 ms |
8548 KB |
Output is correct |
7 |
Correct |
24 ms |
8524 KB |
Output is correct |
8 |
Correct |
16 ms |
8544 KB |
Output is correct |
9 |
Correct |
24 ms |
8544 KB |
Output is correct |
10 |
Correct |
16 ms |
8540 KB |
Output is correct |
11 |
Correct |
16 ms |
8544 KB |
Output is correct |
12 |
Correct |
21 ms |
8604 KB |
Output is correct |
13 |
Correct |
24 ms |
8552 KB |
Output is correct |
14 |
Correct |
17 ms |
8568 KB |
Output is correct |
15 |
Correct |
16 ms |
8572 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 |
596 KB |
Output is correct |
19 |
Correct |
6 ms |
2736 KB |
Output is correct |
20 |
Correct |
12 ms |
5252 KB |
Output is correct |
21 |
Correct |
17 ms |
8752 KB |
Output is correct |
22 |
Correct |
17 ms |
8628 KB |
Output is correct |
23 |
Correct |
20 ms |
8672 KB |
Output is correct |
24 |
Correct |
18 ms |
8656 KB |
Output is correct |
25 |
Correct |
18 ms |
8612 KB |
Output is correct |
26 |
Correct |
23 ms |
8664 KB |
Output is correct |
27 |
Correct |
17 ms |
8712 KB |
Output is correct |
28 |
Correct |
18 ms |
8636 KB |
Output is correct |
29 |
Correct |
18 ms |
8624 KB |
Output is correct |
30 |
Correct |
17 ms |
8684 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
340 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
608 KB |
Output is correct |
4 |
Correct |
5 ms |
2656 KB |
Output is correct |
5 |
Correct |
10 ms |
5076 KB |
Output is correct |
6 |
Correct |
18 ms |
8548 KB |
Output is correct |
7 |
Correct |
24 ms |
8524 KB |
Output is correct |
8 |
Correct |
16 ms |
8544 KB |
Output is correct |
9 |
Correct |
24 ms |
8544 KB |
Output is correct |
10 |
Correct |
16 ms |
8540 KB |
Output is correct |
11 |
Correct |
16 ms |
8544 KB |
Output is correct |
12 |
Correct |
21 ms |
8604 KB |
Output is correct |
13 |
Correct |
24 ms |
8552 KB |
Output is correct |
14 |
Correct |
17 ms |
8568 KB |
Output is correct |
15 |
Correct |
16 ms |
8572 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 |
596 KB |
Output is correct |
19 |
Correct |
6 ms |
2736 KB |
Output is correct |
20 |
Correct |
12 ms |
5252 KB |
Output is correct |
21 |
Correct |
17 ms |
8752 KB |
Output is correct |
22 |
Correct |
17 ms |
8628 KB |
Output is correct |
23 |
Correct |
20 ms |
8672 KB |
Output is correct |
24 |
Correct |
18 ms |
8656 KB |
Output is correct |
25 |
Correct |
18 ms |
8612 KB |
Output is correct |
26 |
Correct |
23 ms |
8664 KB |
Output is correct |
27 |
Correct |
17 ms |
8712 KB |
Output is correct |
28 |
Correct |
18 ms |
8636 KB |
Output is correct |
29 |
Correct |
18 ms |
8624 KB |
Output is correct |
30 |
Correct |
17 ms |
8684 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 |
340 KB |
Output is correct |
34 |
Correct |
2 ms |
604 KB |
Output is correct |
35 |
Correct |
1 ms |
608 KB |
Output is correct |
36 |
Correct |
2 ms |
596 KB |
Output is correct |
37 |
Correct |
4 ms |
1492 KB |
Output is correct |
38 |
Correct |
3 ms |
1368 KB |
Output is correct |
39 |
Correct |
9 ms |
2520 KB |
Output is correct |
40 |
Correct |
13 ms |
4952 KB |
Output is correct |
41 |
Correct |
19 ms |
8320 KB |
Output is correct |
42 |
Correct |
26 ms |
8284 KB |
Output is correct |
43 |
Correct |
19 ms |
8248 KB |
Output is correct |
44 |
Correct |
30 ms |
8276 KB |
Output is correct |
45 |
Correct |
19 ms |
8272 KB |
Output is correct |
46 |
Correct |
19 ms |
8248 KB |
Output is correct |
47 |
Correct |
19 ms |
8264 KB |
Output is correct |
48 |
Correct |
19 ms |
8248 KB |
Output is correct |
49 |
Correct |
18 ms |
8296 KB |
Output is correct |
50 |
Correct |
19 ms |
8260 KB |
Output is correct |
51 |
Correct |
19 ms |
8280 KB |
Output is correct |
52 |
Correct |
21 ms |
8248 KB |
Output is correct |
53 |
Correct |
20 ms |
8252 KB |
Output is correct |
54 |
Correct |
19 ms |
8252 KB |
Output is correct |
55 |
Correct |
19 ms |
8284 KB |
Output is correct |
56 |
Correct |
20 ms |
8288 KB |
Output is correct |
57 |
Correct |
25 ms |
8276 KB |
Output is correct |
58 |
Correct |
19 ms |
8248 KB |
Output is correct |
59 |
Correct |
20 ms |
8264 KB |
Output is correct |
60 |
Correct |
19 ms |
8196 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
3 |
Correct |
0 ms |
340 KB |
Output is correct |
4 |
Correct |
1 ms |
344 KB |
Output is correct |
5 |
Correct |
1 ms |
340 KB |
Output is correct |
6 |
Correct |
0 ms |
336 KB |
Output is correct |
7 |
Correct |
1 ms |
340 KB |
Output is correct |
8 |
Correct |
0 ms |
340 KB |
Output is correct |
9 |
Correct |
0 ms |
340 KB |
Output is correct |
10 |
Correct |
0 ms |
340 KB |
Output is correct |
11 |
Correct |
0 ms |
340 KB |
Output is correct |
12 |
Correct |
1 ms |
340 KB |
Output is correct |
13 |
Correct |
1 ms |
608 KB |
Output is correct |
14 |
Correct |
5 ms |
2656 KB |
Output is correct |
15 |
Correct |
10 ms |
5076 KB |
Output is correct |
16 |
Correct |
18 ms |
8548 KB |
Output is correct |
17 |
Correct |
24 ms |
8524 KB |
Output is correct |
18 |
Correct |
16 ms |
8544 KB |
Output is correct |
19 |
Correct |
24 ms |
8544 KB |
Output is correct |
20 |
Correct |
16 ms |
8540 KB |
Output is correct |
21 |
Correct |
16 ms |
8544 KB |
Output is correct |
22 |
Correct |
21 ms |
8604 KB |
Output is correct |
23 |
Correct |
24 ms |
8552 KB |
Output is correct |
24 |
Correct |
17 ms |
8568 KB |
Output is correct |
25 |
Correct |
16 ms |
8572 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 |
596 KB |
Output is correct |
29 |
Correct |
6 ms |
2736 KB |
Output is correct |
30 |
Correct |
12 ms |
5252 KB |
Output is correct |
31 |
Correct |
17 ms |
8752 KB |
Output is correct |
32 |
Correct |
17 ms |
8628 KB |
Output is correct |
33 |
Correct |
20 ms |
8672 KB |
Output is correct |
34 |
Correct |
18 ms |
8656 KB |
Output is correct |
35 |
Correct |
18 ms |
8612 KB |
Output is correct |
36 |
Correct |
23 ms |
8664 KB |
Output is correct |
37 |
Correct |
17 ms |
8712 KB |
Output is correct |
38 |
Correct |
18 ms |
8636 KB |
Output is correct |
39 |
Correct |
18 ms |
8624 KB |
Output is correct |
40 |
Correct |
17 ms |
8684 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 |
340 KB |
Output is correct |
44 |
Correct |
2 ms |
604 KB |
Output is correct |
45 |
Correct |
1 ms |
608 KB |
Output is correct |
46 |
Correct |
2 ms |
596 KB |
Output is correct |
47 |
Correct |
4 ms |
1492 KB |
Output is correct |
48 |
Correct |
3 ms |
1368 KB |
Output is correct |
49 |
Correct |
9 ms |
2520 KB |
Output is correct |
50 |
Correct |
13 ms |
4952 KB |
Output is correct |
51 |
Correct |
19 ms |
8320 KB |
Output is correct |
52 |
Correct |
26 ms |
8284 KB |
Output is correct |
53 |
Correct |
19 ms |
8248 KB |
Output is correct |
54 |
Correct |
30 ms |
8276 KB |
Output is correct |
55 |
Correct |
19 ms |
8272 KB |
Output is correct |
56 |
Correct |
19 ms |
8248 KB |
Output is correct |
57 |
Correct |
19 ms |
8264 KB |
Output is correct |
58 |
Correct |
19 ms |
8248 KB |
Output is correct |
59 |
Correct |
18 ms |
8296 KB |
Output is correct |
60 |
Correct |
19 ms |
8260 KB |
Output is correct |
61 |
Correct |
19 ms |
8280 KB |
Output is correct |
62 |
Correct |
21 ms |
8248 KB |
Output is correct |
63 |
Correct |
20 ms |
8252 KB |
Output is correct |
64 |
Correct |
19 ms |
8252 KB |
Output is correct |
65 |
Correct |
19 ms |
8284 KB |
Output is correct |
66 |
Correct |
20 ms |
8288 KB |
Output is correct |
67 |
Correct |
25 ms |
8276 KB |
Output is correct |
68 |
Correct |
19 ms |
8248 KB |
Output is correct |
69 |
Correct |
20 ms |
8264 KB |
Output is correct |
70 |
Correct |
19 ms |
8196 KB |
Output is correct |
71 |
Correct |
4 ms |
1492 KB |
Output is correct |
72 |
Correct |
4 ms |
1428 KB |
Output is correct |
73 |
Correct |
4 ms |
1492 KB |
Output is correct |
74 |
Correct |
4 ms |
1500 KB |
Output is correct |
75 |
Correct |
4 ms |
1492 KB |
Output is correct |
76 |
Correct |
7 ms |
2544 KB |
Output is correct |
77 |
Correct |
7 ms |
2604 KB |
Output is correct |
78 |
Correct |
7 ms |
2644 KB |
Output is correct |
79 |
Correct |
7 ms |
2604 KB |
Output is correct |
80 |
Correct |
7 ms |
2592 KB |
Output is correct |
81 |
Correct |
13 ms |
4960 KB |
Output is correct |
82 |
Correct |
13 ms |
4944 KB |
Output is correct |
83 |
Correct |
13 ms |
4980 KB |
Output is correct |
84 |
Correct |
14 ms |
4880 KB |
Output is correct |
85 |
Correct |
13 ms |
4948 KB |
Output is correct |
86 |
Correct |
14 ms |
5024 KB |
Output is correct |
87 |
Correct |
14 ms |
5076 KB |
Output is correct |
88 |
Correct |
14 ms |
5076 KB |
Output is correct |
89 |
Correct |
17 ms |
5040 KB |
Output is correct |
90 |
Correct |
19 ms |
5108 KB |
Output is correct |
91 |
Correct |
24 ms |
8824 KB |
Output is correct |
92 |
Correct |
21 ms |
8852 KB |
Output is correct |
93 |
Correct |
21 ms |
8788 KB |
Output is correct |
94 |
Correct |
22 ms |
8772 KB |
Output is correct |
95 |
Correct |
21 ms |
8852 KB |
Output is correct |
96 |
Correct |
25 ms |
9408 KB |
Output is correct |
97 |
Correct |
25 ms |
9428 KB |
Output is correct |
98 |
Correct |
24 ms |
9396 KB |
Output is correct |
99 |
Correct |
24 ms |
9332 KB |
Output is correct |
100 |
Correct |
24 ms |
9432 KB |
Output is correct |
101 |
Correct |
25 ms |
9332 KB |
Output is correct |
102 |
Correct |
24 ms |
9356 KB |
Output is correct |
103 |
Correct |
24 ms |
9440 KB |
Output is correct |
104 |
Correct |
24 ms |
9428 KB |
Output is correct |
105 |
Correct |
24 ms |
9408 KB |
Output is correct |
106 |
Correct |
24 ms |
9696 KB |
Output is correct |
107 |
Correct |
25 ms |
9556 KB |
Output is correct |
108 |
Correct |
26 ms |
9588 KB |
Output is correct |
109 |
Correct |
24 ms |
9576 KB |
Output is correct |
110 |
Correct |
24 ms |
9664 KB |
Output is correct |
111 |
Correct |
24 ms |
9608 KB |
Output is correct |
112 |
Correct |
24 ms |
9564 KB |
Output is correct |
113 |
Correct |
24 ms |
9548 KB |
Output is correct |
114 |
Correct |
24 ms |
9556 KB |
Output is correct |
115 |
Correct |
24 ms |
9632 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
3 |
Correct |
0 ms |
340 KB |
Output is correct |
4 |
Correct |
1 ms |
344 KB |
Output is correct |
5 |
Correct |
1 ms |
340 KB |
Output is correct |
6 |
Correct |
0 ms |
336 KB |
Output is correct |
7 |
Correct |
1 ms |
340 KB |
Output is correct |
8 |
Correct |
0 ms |
340 KB |
Output is correct |
9 |
Correct |
0 ms |
340 KB |
Output is correct |
10 |
Correct |
0 ms |
340 KB |
Output is correct |
11 |
Correct |
0 ms |
340 KB |
Output is correct |
12 |
Correct |
1 ms |
340 KB |
Output is correct |
13 |
Correct |
1 ms |
608 KB |
Output is correct |
14 |
Correct |
5 ms |
2656 KB |
Output is correct |
15 |
Correct |
10 ms |
5076 KB |
Output is correct |
16 |
Correct |
18 ms |
8548 KB |
Output is correct |
17 |
Correct |
24 ms |
8524 KB |
Output is correct |
18 |
Correct |
16 ms |
8544 KB |
Output is correct |
19 |
Correct |
24 ms |
8544 KB |
Output is correct |
20 |
Correct |
16 ms |
8540 KB |
Output is correct |
21 |
Correct |
16 ms |
8544 KB |
Output is correct |
22 |
Correct |
21 ms |
8604 KB |
Output is correct |
23 |
Correct |
24 ms |
8552 KB |
Output is correct |
24 |
Correct |
17 ms |
8568 KB |
Output is correct |
25 |
Correct |
16 ms |
8572 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 |
596 KB |
Output is correct |
29 |
Correct |
6 ms |
2736 KB |
Output is correct |
30 |
Correct |
12 ms |
5252 KB |
Output is correct |
31 |
Correct |
17 ms |
8752 KB |
Output is correct |
32 |
Correct |
17 ms |
8628 KB |
Output is correct |
33 |
Correct |
20 ms |
8672 KB |
Output is correct |
34 |
Correct |
18 ms |
8656 KB |
Output is correct |
35 |
Correct |
18 ms |
8612 KB |
Output is correct |
36 |
Correct |
23 ms |
8664 KB |
Output is correct |
37 |
Correct |
17 ms |
8712 KB |
Output is correct |
38 |
Correct |
18 ms |
8636 KB |
Output is correct |
39 |
Correct |
18 ms |
8624 KB |
Output is correct |
40 |
Correct |
17 ms |
8684 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 |
340 KB |
Output is correct |
44 |
Correct |
2 ms |
604 KB |
Output is correct |
45 |
Correct |
1 ms |
608 KB |
Output is correct |
46 |
Correct |
2 ms |
596 KB |
Output is correct |
47 |
Correct |
4 ms |
1492 KB |
Output is correct |
48 |
Correct |
3 ms |
1368 KB |
Output is correct |
49 |
Correct |
9 ms |
2520 KB |
Output is correct |
50 |
Correct |
13 ms |
4952 KB |
Output is correct |
51 |
Correct |
19 ms |
8320 KB |
Output is correct |
52 |
Correct |
26 ms |
8284 KB |
Output is correct |
53 |
Correct |
19 ms |
8248 KB |
Output is correct |
54 |
Correct |
30 ms |
8276 KB |
Output is correct |
55 |
Correct |
19 ms |
8272 KB |
Output is correct |
56 |
Correct |
19 ms |
8248 KB |
Output is correct |
57 |
Correct |
19 ms |
8264 KB |
Output is correct |
58 |
Correct |
19 ms |
8248 KB |
Output is correct |
59 |
Correct |
18 ms |
8296 KB |
Output is correct |
60 |
Correct |
19 ms |
8260 KB |
Output is correct |
61 |
Correct |
19 ms |
8280 KB |
Output is correct |
62 |
Correct |
21 ms |
8248 KB |
Output is correct |
63 |
Correct |
20 ms |
8252 KB |
Output is correct |
64 |
Correct |
19 ms |
8252 KB |
Output is correct |
65 |
Correct |
19 ms |
8284 KB |
Output is correct |
66 |
Correct |
20 ms |
8288 KB |
Output is correct |
67 |
Correct |
25 ms |
8276 KB |
Output is correct |
68 |
Correct |
19 ms |
8248 KB |
Output is correct |
69 |
Correct |
20 ms |
8264 KB |
Output is correct |
70 |
Correct |
19 ms |
8196 KB |
Output is correct |
71 |
Correct |
4 ms |
1492 KB |
Output is correct |
72 |
Correct |
4 ms |
1428 KB |
Output is correct |
73 |
Correct |
4 ms |
1492 KB |
Output is correct |
74 |
Correct |
4 ms |
1500 KB |
Output is correct |
75 |
Correct |
4 ms |
1492 KB |
Output is correct |
76 |
Correct |
7 ms |
2544 KB |
Output is correct |
77 |
Correct |
7 ms |
2604 KB |
Output is correct |
78 |
Correct |
7 ms |
2644 KB |
Output is correct |
79 |
Correct |
7 ms |
2604 KB |
Output is correct |
80 |
Correct |
7 ms |
2592 KB |
Output is correct |
81 |
Correct |
13 ms |
4960 KB |
Output is correct |
82 |
Correct |
13 ms |
4944 KB |
Output is correct |
83 |
Correct |
13 ms |
4980 KB |
Output is correct |
84 |
Correct |
14 ms |
4880 KB |
Output is correct |
85 |
Correct |
13 ms |
4948 KB |
Output is correct |
86 |
Correct |
14 ms |
5024 KB |
Output is correct |
87 |
Correct |
14 ms |
5076 KB |
Output is correct |
88 |
Correct |
14 ms |
5076 KB |
Output is correct |
89 |
Correct |
17 ms |
5040 KB |
Output is correct |
90 |
Correct |
19 ms |
5108 KB |
Output is correct |
91 |
Correct |
24 ms |
8824 KB |
Output is correct |
92 |
Correct |
21 ms |
8852 KB |
Output is correct |
93 |
Correct |
21 ms |
8788 KB |
Output is correct |
94 |
Correct |
22 ms |
8772 KB |
Output is correct |
95 |
Correct |
21 ms |
8852 KB |
Output is correct |
96 |
Correct |
25 ms |
9408 KB |
Output is correct |
97 |
Correct |
25 ms |
9428 KB |
Output is correct |
98 |
Correct |
24 ms |
9396 KB |
Output is correct |
99 |
Correct |
24 ms |
9332 KB |
Output is correct |
100 |
Correct |
24 ms |
9432 KB |
Output is correct |
101 |
Correct |
25 ms |
9332 KB |
Output is correct |
102 |
Correct |
24 ms |
9356 KB |
Output is correct |
103 |
Correct |
24 ms |
9440 KB |
Output is correct |
104 |
Correct |
24 ms |
9428 KB |
Output is correct |
105 |
Correct |
24 ms |
9408 KB |
Output is correct |
106 |
Correct |
24 ms |
9696 KB |
Output is correct |
107 |
Correct |
25 ms |
9556 KB |
Output is correct |
108 |
Correct |
26 ms |
9588 KB |
Output is correct |
109 |
Correct |
24 ms |
9576 KB |
Output is correct |
110 |
Correct |
24 ms |
9664 KB |
Output is correct |
111 |
Correct |
24 ms |
9608 KB |
Output is correct |
112 |
Correct |
24 ms |
9564 KB |
Output is correct |
113 |
Correct |
24 ms |
9548 KB |
Output is correct |
114 |
Correct |
24 ms |
9556 KB |
Output is correct |
115 |
Correct |
24 ms |
9632 KB |
Output is correct |
116 |
Correct |
93 ms |
2512 KB |
Output is correct |
117 |
Correct |
108 ms |
2452 KB |
Output is correct |
118 |
Correct |
249 ms |
3616 KB |
Output is correct |
119 |
Correct |
241 ms |
3556 KB |
Output is correct |
120 |
Correct |
168 ms |
3528 KB |
Output is correct |
121 |
Correct |
361 ms |
4680 KB |
Output is correct |
122 |
Correct |
279 ms |
4784 KB |
Output is correct |
123 |
Correct |
859 ms |
7184 KB |
Output is correct |
124 |
Correct |
433 ms |
7116 KB |
Output is correct |
125 |
Correct |
402 ms |
7228 KB |
Output is correct |
126 |
Correct |
1525 ms |
10932 KB |
Output is correct |
127 |
Correct |
1527 ms |
10924 KB |
Output is correct |
128 |
Correct |
1528 ms |
10912 KB |
Output is correct |
129 |
Correct |
1544 ms |
10920 KB |
Output is correct |
130 |
Correct |
1600 ms |
10908 KB |
Output is correct |
131 |
Correct |
1748 ms |
10892 KB |
Output is correct |
132 |
Correct |
1814 ms |
10888 KB |
Output is correct |
133 |
Correct |
1833 ms |
10928 KB |
Output is correct |
134 |
Correct |
1785 ms |
10892 KB |
Output is correct |
135 |
Correct |
1784 ms |
10904 KB |
Output is correct |
136 |
Correct |
1869 ms |
10856 KB |
Output is correct |
137 |
Correct |
1806 ms |
10920 KB |
Output is correct |
138 |
Correct |
1817 ms |
10864 KB |
Output is correct |
139 |
Correct |
1802 ms |
10888 KB |
Output is correct |
140 |
Correct |
1876 ms |
10888 KB |
Output is correct |
141 |
Correct |
1524 ms |
10576 KB |
Output is correct |
142 |
Correct |
1565 ms |
10600 KB |
Output is correct |
143 |
Correct |
1572 ms |
10588 KB |
Output is correct |
144 |
Correct |
1565 ms |
10608 KB |
Output is correct |
145 |
Correct |
1584 ms |
10592 KB |
Output is correct |
146 |
Correct |
746 ms |
10504 KB |
Output is correct |
147 |
Correct |
753 ms |
10512 KB |
Output is correct |
148 |
Correct |
791 ms |
10516 KB |
Output is correct |
149 |
Correct |
708 ms |
10512 KB |
Output is correct |
150 |
Correct |
738 ms |
10520 KB |
Output is correct |
151 |
Correct |
676 ms |
10536 KB |
Output is correct |
152 |
Correct |
726 ms |
10532 KB |
Output is correct |
153 |
Correct |
738 ms |
10532 KB |
Output is correct |
154 |
Correct |
690 ms |
10588 KB |
Output is correct |
155 |
Correct |
706 ms |
10524 KB |
Output is correct |
156 |
Correct |
1796 ms |
11924 KB |
Output is correct |
157 |
Correct |
1792 ms |
11884 KB |
Output is correct |
158 |
Correct |
1738 ms |
11888 KB |
Output is correct |
159 |
Correct |
1734 ms |
11884 KB |
Output is correct |
160 |
Correct |
1750 ms |
11892 KB |
Output is correct |
161 |
Correct |
1662 ms |
12028 KB |
Output is correct |
162 |
Correct |
1654 ms |
12032 KB |
Output is correct |
163 |
Correct |
1636 ms |
12036 KB |
Output is correct |
164 |
Correct |
1583 ms |
12028 KB |
Output is correct |
165 |
Correct |
1589 ms |
12152 KB |
Output is correct |
166 |
Correct |
1797 ms |
11916 KB |
Output is correct |
167 |
Correct |
1809 ms |
11916 KB |
Output is correct |
168 |
Correct |
1831 ms |
11980 KB |
Output is correct |
169 |
Correct |
1803 ms |
11936 KB |
Output is correct |
170 |
Correct |
1785 ms |
11920 KB |
Output is correct |
171 |
Correct |
1516 ms |
11984 KB |
Output is correct |
172 |
Correct |
1520 ms |
11972 KB |
Output is correct |
173 |
Correct |
1537 ms |
11984 KB |
Output is correct |
174 |
Correct |
1511 ms |
11976 KB |
Output is correct |
175 |
Correct |
1519 ms |
11988 KB |
Output is correct |