#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define pb push_back
#define ff first
#define ss second
#define ins insert
#define arr3 array<int, 3>
const int A = 3e5;
struct FT{
ll bit[A + 1], a[A + 1], s;
int n;
FT(int ns){
n = ns;
for (int i = 1; i <= n; i++){
bit[i] = a[i] = 0;
}
s = 0;
}
void upd(int v, ll x){
s += x; a[v] += x;
while (v <= n){
bit[v] += x;
v |= (v + 1);
}
}
ll get(int v){
ll out = 0;
while (v > 0){
out += bit[v];
v = (v & (v + 1)) - 1;
}
return out;
}
ll get(int l, int r){
if (l > r) return 0;
return get(r) - get(l - 1);
}
};
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n, q; cin>>n>>q;
vector<int> a(n + 1);
for (int i = 1; i <= n; i++){
cin>>a[i];
}
vector<arr3> qs;
for (int i = 1; i <= q; i++){
int l, r; cin>>l>>r;
qs.pb({l, r, i});
}
const int S = sqrt(n);
auto cmp = [&](arr3 x, arr3 y){
int x1 = x[0] / S, y1 = y[0] / S;
if (x1 != y1){
return x[0] < y[0];
}
return (x1 & 1) ? (x[1] < y[1]) : (x[1] > y[1]);
};
sort(qs.begin(), qs.end(), cmp);
vector<int> p(n + 1);
for (int i = 1; i <= n; i++){
if (i % 2){
p[i] = (i + 1) / 2;
}
else {
p[i] = n - i / 2 + 1;
}
}
ll sum = 0, s1, s2;
vector<int> f(n + 1), cnt(A + 1);
pii rr[n + 1]; rr[0] = {1, n};
for (int i = 1; i <= n; i++) rr[i] = {0, 0};
FT T1(n), T2(n);
auto add = [&](int x){
x = a[x];
int k = cnt[x], j1 = rr[k].ss, j = p[j1];
sum += (f[j1] + 1);
s1 = T1.get(1, j - 1); s2 = T2.get(1, j - 1);
sum += (1LL * j * s1);
sum -= (s2 - s1);
sum += (T2.s - s2 - T2.a[j]);
sum -= 1LL * (j - 1) * (T1.s - s1 - T1.a[j]);
if (rr[k].ff == rr[k].ss) rr[k] = {0, 0};
else rr[k].ss--;
cnt[x]++; f[j1]++; k++;
T1.upd(j, 1);
T2.upd(j, j);
if (!rr[k].ff) rr[k] = {j1, j1};
else rr[k].ff--;
};
auto rem = [&](int x){
x = a[x];
int k = cnt[x], j1 = rr[k].ff, j = p[j1];
sum -= f[j1];
s1 = T1.get(1, j - 1); s2 = T2.get(1, j - 1);
sum -= (1LL * j * s1);
sum += (s2 - s1);
sum -= (T2.s - s2 - T2.a[j]);
sum += 1LL * (j - 1) * (T1.s - s1 - T1.a[j]);
if (rr[k].ff == rr[k].ss) rr[k] = {0, 0};
else rr[k].ff++;
cnt[x]--; f[j1]--; k--;
T1.upd(j, -1);
T2.upd(j, -j);
if (!rr[k].ff) rr[k] = {j1, j1};
else rr[k].ss++;
};
vector<ll> out(q + 1);
int lc = 1, rc = 0;
for (auto [l, r, ii]: qs){
while (lc > l) add(--lc);
while (rc < r) add(++rc);
while (lc < l) rem(lc++);
while (rc > r) rem(rc--);
out[ii] = sum;
}
for (int i = 1; i <= q; i++){
cout<<out[i]<<"\n";
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
10844 KB |
Output is correct |
2 |
Correct |
5 ms |
10860 KB |
Output is correct |
3 |
Correct |
5 ms |
10844 KB |
Output is correct |
4 |
Correct |
6 ms |
10844 KB |
Output is correct |
5 |
Correct |
5 ms |
10940 KB |
Output is correct |
6 |
Correct |
5 ms |
10956 KB |
Output is correct |
7 |
Correct |
5 ms |
10844 KB |
Output is correct |
8 |
Correct |
5 ms |
10844 KB |
Output is correct |
9 |
Correct |
5 ms |
10844 KB |
Output is correct |
10 |
Correct |
5 ms |
10820 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
10844 KB |
Output is correct |
2 |
Correct |
9 ms |
11096 KB |
Output is correct |
3 |
Correct |
6 ms |
11100 KB |
Output is correct |
4 |
Correct |
14 ms |
12892 KB |
Output is correct |
5 |
Correct |
24 ms |
14940 KB |
Output is correct |
6 |
Correct |
44 ms |
16728 KB |
Output is correct |
7 |
Correct |
37 ms |
16732 KB |
Output is correct |
8 |
Correct |
42 ms |
16732 KB |
Output is correct |
9 |
Correct |
39 ms |
16728 KB |
Output is correct |
10 |
Correct |
37 ms |
16780 KB |
Output is correct |
11 |
Correct |
39 ms |
16724 KB |
Output is correct |
12 |
Correct |
58 ms |
16824 KB |
Output is correct |
13 |
Correct |
38 ms |
16876 KB |
Output is correct |
14 |
Correct |
37 ms |
16884 KB |
Output is correct |
15 |
Correct |
38 ms |
16728 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
10844 KB |
Output is correct |
2 |
Correct |
9 ms |
11096 KB |
Output is correct |
3 |
Correct |
6 ms |
11100 KB |
Output is correct |
4 |
Correct |
14 ms |
12892 KB |
Output is correct |
5 |
Correct |
24 ms |
14940 KB |
Output is correct |
6 |
Correct |
44 ms |
16728 KB |
Output is correct |
7 |
Correct |
37 ms |
16732 KB |
Output is correct |
8 |
Correct |
42 ms |
16732 KB |
Output is correct |
9 |
Correct |
39 ms |
16728 KB |
Output is correct |
10 |
Correct |
37 ms |
16780 KB |
Output is correct |
11 |
Correct |
39 ms |
16724 KB |
Output is correct |
12 |
Correct |
58 ms |
16824 KB |
Output is correct |
13 |
Correct |
38 ms |
16876 KB |
Output is correct |
14 |
Correct |
37 ms |
16884 KB |
Output is correct |
15 |
Correct |
38 ms |
16728 KB |
Output is correct |
16 |
Correct |
6 ms |
10844 KB |
Output is correct |
17 |
Correct |
5 ms |
10840 KB |
Output is correct |
18 |
Correct |
6 ms |
11100 KB |
Output is correct |
19 |
Correct |
15 ms |
12812 KB |
Output is correct |
20 |
Correct |
28 ms |
14936 KB |
Output is correct |
21 |
Correct |
44 ms |
16672 KB |
Output is correct |
22 |
Correct |
41 ms |
16732 KB |
Output is correct |
23 |
Correct |
39 ms |
16624 KB |
Output is correct |
24 |
Correct |
44 ms |
16732 KB |
Output is correct |
25 |
Correct |
41 ms |
16884 KB |
Output is correct |
26 |
Correct |
42 ms |
16660 KB |
Output is correct |
27 |
Correct |
40 ms |
16652 KB |
Output is correct |
28 |
Correct |
43 ms |
16664 KB |
Output is correct |
29 |
Correct |
39 ms |
16728 KB |
Output is correct |
30 |
Correct |
48 ms |
16876 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
10844 KB |
Output is correct |
2 |
Correct |
9 ms |
11096 KB |
Output is correct |
3 |
Correct |
6 ms |
11100 KB |
Output is correct |
4 |
Correct |
14 ms |
12892 KB |
Output is correct |
5 |
Correct |
24 ms |
14940 KB |
Output is correct |
6 |
Correct |
44 ms |
16728 KB |
Output is correct |
7 |
Correct |
37 ms |
16732 KB |
Output is correct |
8 |
Correct |
42 ms |
16732 KB |
Output is correct |
9 |
Correct |
39 ms |
16728 KB |
Output is correct |
10 |
Correct |
37 ms |
16780 KB |
Output is correct |
11 |
Correct |
39 ms |
16724 KB |
Output is correct |
12 |
Correct |
58 ms |
16824 KB |
Output is correct |
13 |
Correct |
38 ms |
16876 KB |
Output is correct |
14 |
Correct |
37 ms |
16884 KB |
Output is correct |
15 |
Correct |
38 ms |
16728 KB |
Output is correct |
16 |
Correct |
6 ms |
10844 KB |
Output is correct |
17 |
Correct |
5 ms |
10840 KB |
Output is correct |
18 |
Correct |
6 ms |
11100 KB |
Output is correct |
19 |
Correct |
15 ms |
12812 KB |
Output is correct |
20 |
Correct |
28 ms |
14936 KB |
Output is correct |
21 |
Correct |
44 ms |
16672 KB |
Output is correct |
22 |
Correct |
41 ms |
16732 KB |
Output is correct |
23 |
Correct |
39 ms |
16624 KB |
Output is correct |
24 |
Correct |
44 ms |
16732 KB |
Output is correct |
25 |
Correct |
41 ms |
16884 KB |
Output is correct |
26 |
Correct |
42 ms |
16660 KB |
Output is correct |
27 |
Correct |
40 ms |
16652 KB |
Output is correct |
28 |
Correct |
43 ms |
16664 KB |
Output is correct |
29 |
Correct |
39 ms |
16728 KB |
Output is correct |
30 |
Correct |
48 ms |
16876 KB |
Output is correct |
31 |
Correct |
5 ms |
10844 KB |
Output is correct |
32 |
Correct |
5 ms |
10844 KB |
Output is correct |
33 |
Correct |
5 ms |
10876 KB |
Output is correct |
34 |
Correct |
6 ms |
11100 KB |
Output is correct |
35 |
Correct |
8 ms |
11100 KB |
Output is correct |
36 |
Correct |
6 ms |
11100 KB |
Output is correct |
37 |
Correct |
13 ms |
11868 KB |
Output is correct |
38 |
Correct |
17 ms |
11868 KB |
Output is correct |
39 |
Correct |
26 ms |
12888 KB |
Output is correct |
40 |
Correct |
34 ms |
14740 KB |
Output is correct |
41 |
Correct |
40 ms |
16668 KB |
Output is correct |
42 |
Correct |
40 ms |
16732 KB |
Output is correct |
43 |
Correct |
39 ms |
16728 KB |
Output is correct |
44 |
Correct |
44 ms |
16668 KB |
Output is correct |
45 |
Correct |
38 ms |
16732 KB |
Output is correct |
46 |
Correct |
39 ms |
16732 KB |
Output is correct |
47 |
Correct |
50 ms |
16724 KB |
Output is correct |
48 |
Correct |
41 ms |
16724 KB |
Output is correct |
49 |
Correct |
40 ms |
16732 KB |
Output is correct |
50 |
Correct |
41 ms |
16732 KB |
Output is correct |
51 |
Correct |
41 ms |
16728 KB |
Output is correct |
52 |
Correct |
41 ms |
16728 KB |
Output is correct |
53 |
Correct |
39 ms |
16724 KB |
Output is correct |
54 |
Correct |
45 ms |
16660 KB |
Output is correct |
55 |
Correct |
40 ms |
16728 KB |
Output is correct |
56 |
Correct |
38 ms |
16732 KB |
Output is correct |
57 |
Correct |
38 ms |
16664 KB |
Output is correct |
58 |
Correct |
39 ms |
16728 KB |
Output is correct |
59 |
Correct |
41 ms |
16724 KB |
Output is correct |
60 |
Correct |
39 ms |
16660 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
10844 KB |
Output is correct |
2 |
Correct |
5 ms |
10860 KB |
Output is correct |
3 |
Correct |
5 ms |
10844 KB |
Output is correct |
4 |
Correct |
6 ms |
10844 KB |
Output is correct |
5 |
Correct |
5 ms |
10940 KB |
Output is correct |
6 |
Correct |
5 ms |
10956 KB |
Output is correct |
7 |
Correct |
5 ms |
10844 KB |
Output is correct |
8 |
Correct |
5 ms |
10844 KB |
Output is correct |
9 |
Correct |
5 ms |
10844 KB |
Output is correct |
10 |
Correct |
5 ms |
10820 KB |
Output is correct |
11 |
Correct |
5 ms |
10844 KB |
Output is correct |
12 |
Correct |
9 ms |
11096 KB |
Output is correct |
13 |
Correct |
6 ms |
11100 KB |
Output is correct |
14 |
Correct |
14 ms |
12892 KB |
Output is correct |
15 |
Correct |
24 ms |
14940 KB |
Output is correct |
16 |
Correct |
44 ms |
16728 KB |
Output is correct |
17 |
Correct |
37 ms |
16732 KB |
Output is correct |
18 |
Correct |
42 ms |
16732 KB |
Output is correct |
19 |
Correct |
39 ms |
16728 KB |
Output is correct |
20 |
Correct |
37 ms |
16780 KB |
Output is correct |
21 |
Correct |
39 ms |
16724 KB |
Output is correct |
22 |
Correct |
58 ms |
16824 KB |
Output is correct |
23 |
Correct |
38 ms |
16876 KB |
Output is correct |
24 |
Correct |
37 ms |
16884 KB |
Output is correct |
25 |
Correct |
38 ms |
16728 KB |
Output is correct |
26 |
Correct |
6 ms |
10844 KB |
Output is correct |
27 |
Correct |
5 ms |
10840 KB |
Output is correct |
28 |
Correct |
6 ms |
11100 KB |
Output is correct |
29 |
Correct |
15 ms |
12812 KB |
Output is correct |
30 |
Correct |
28 ms |
14936 KB |
Output is correct |
31 |
Correct |
44 ms |
16672 KB |
Output is correct |
32 |
Correct |
41 ms |
16732 KB |
Output is correct |
33 |
Correct |
39 ms |
16624 KB |
Output is correct |
34 |
Correct |
44 ms |
16732 KB |
Output is correct |
35 |
Correct |
41 ms |
16884 KB |
Output is correct |
36 |
Correct |
42 ms |
16660 KB |
Output is correct |
37 |
Correct |
40 ms |
16652 KB |
Output is correct |
38 |
Correct |
43 ms |
16664 KB |
Output is correct |
39 |
Correct |
39 ms |
16728 KB |
Output is correct |
40 |
Correct |
48 ms |
16876 KB |
Output is correct |
41 |
Correct |
5 ms |
10844 KB |
Output is correct |
42 |
Correct |
5 ms |
10844 KB |
Output is correct |
43 |
Correct |
5 ms |
10876 KB |
Output is correct |
44 |
Correct |
6 ms |
11100 KB |
Output is correct |
45 |
Correct |
8 ms |
11100 KB |
Output is correct |
46 |
Correct |
6 ms |
11100 KB |
Output is correct |
47 |
Correct |
13 ms |
11868 KB |
Output is correct |
48 |
Correct |
17 ms |
11868 KB |
Output is correct |
49 |
Correct |
26 ms |
12888 KB |
Output is correct |
50 |
Correct |
34 ms |
14740 KB |
Output is correct |
51 |
Correct |
40 ms |
16668 KB |
Output is correct |
52 |
Correct |
40 ms |
16732 KB |
Output is correct |
53 |
Correct |
39 ms |
16728 KB |
Output is correct |
54 |
Correct |
44 ms |
16668 KB |
Output is correct |
55 |
Correct |
38 ms |
16732 KB |
Output is correct |
56 |
Correct |
39 ms |
16732 KB |
Output is correct |
57 |
Correct |
50 ms |
16724 KB |
Output is correct |
58 |
Correct |
41 ms |
16724 KB |
Output is correct |
59 |
Correct |
40 ms |
16732 KB |
Output is correct |
60 |
Correct |
41 ms |
16732 KB |
Output is correct |
61 |
Correct |
41 ms |
16728 KB |
Output is correct |
62 |
Correct |
41 ms |
16728 KB |
Output is correct |
63 |
Correct |
39 ms |
16724 KB |
Output is correct |
64 |
Correct |
45 ms |
16660 KB |
Output is correct |
65 |
Correct |
40 ms |
16728 KB |
Output is correct |
66 |
Correct |
38 ms |
16732 KB |
Output is correct |
67 |
Correct |
38 ms |
16664 KB |
Output is correct |
68 |
Correct |
39 ms |
16728 KB |
Output is correct |
69 |
Correct |
41 ms |
16724 KB |
Output is correct |
70 |
Correct |
39 ms |
16660 KB |
Output is correct |
71 |
Correct |
10 ms |
11868 KB |
Output is correct |
72 |
Correct |
10 ms |
11864 KB |
Output is correct |
73 |
Correct |
10 ms |
11864 KB |
Output is correct |
74 |
Correct |
10 ms |
11868 KB |
Output is correct |
75 |
Correct |
10 ms |
11868 KB |
Output is correct |
76 |
Correct |
15 ms |
12816 KB |
Output is correct |
77 |
Correct |
17 ms |
12892 KB |
Output is correct |
78 |
Correct |
16 ms |
12888 KB |
Output is correct |
79 |
Correct |
16 ms |
12992 KB |
Output is correct |
80 |
Correct |
15 ms |
12892 KB |
Output is correct |
81 |
Correct |
28 ms |
15192 KB |
Output is correct |
82 |
Correct |
31 ms |
14940 KB |
Output is correct |
83 |
Correct |
28 ms |
14780 KB |
Output is correct |
84 |
Correct |
29 ms |
14936 KB |
Output is correct |
85 |
Correct |
32 ms |
14940 KB |
Output is correct |
86 |
Correct |
29 ms |
15192 KB |
Output is correct |
87 |
Correct |
31 ms |
14748 KB |
Output is correct |
88 |
Correct |
37 ms |
14936 KB |
Output is correct |
89 |
Correct |
29 ms |
14940 KB |
Output is correct |
90 |
Correct |
30 ms |
14940 KB |
Output is correct |
91 |
Correct |
42 ms |
16660 KB |
Output is correct |
92 |
Correct |
46 ms |
16724 KB |
Output is correct |
93 |
Correct |
45 ms |
16728 KB |
Output is correct |
94 |
Correct |
43 ms |
16724 KB |
Output is correct |
95 |
Correct |
42 ms |
16884 KB |
Output is correct |
96 |
Correct |
48 ms |
16720 KB |
Output is correct |
97 |
Correct |
49 ms |
16732 KB |
Output is correct |
98 |
Correct |
50 ms |
16732 KB |
Output is correct |
99 |
Correct |
46 ms |
16732 KB |
Output is correct |
100 |
Correct |
45 ms |
16720 KB |
Output is correct |
101 |
Correct |
46 ms |
16720 KB |
Output is correct |
102 |
Correct |
46 ms |
16876 KB |
Output is correct |
103 |
Correct |
48 ms |
16732 KB |
Output is correct |
104 |
Correct |
55 ms |
16720 KB |
Output is correct |
105 |
Correct |
46 ms |
16732 KB |
Output is correct |
106 |
Correct |
44 ms |
16728 KB |
Output is correct |
107 |
Correct |
46 ms |
16648 KB |
Output is correct |
108 |
Correct |
44 ms |
16724 KB |
Output is correct |
109 |
Correct |
50 ms |
16904 KB |
Output is correct |
110 |
Correct |
50 ms |
16720 KB |
Output is correct |
111 |
Correct |
47 ms |
16656 KB |
Output is correct |
112 |
Correct |
47 ms |
16732 KB |
Output is correct |
113 |
Correct |
43 ms |
16900 KB |
Output is correct |
114 |
Correct |
45 ms |
16648 KB |
Output is correct |
115 |
Correct |
45 ms |
16672 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
10844 KB |
Output is correct |
2 |
Correct |
5 ms |
10860 KB |
Output is correct |
3 |
Correct |
5 ms |
10844 KB |
Output is correct |
4 |
Correct |
6 ms |
10844 KB |
Output is correct |
5 |
Correct |
5 ms |
10940 KB |
Output is correct |
6 |
Correct |
5 ms |
10956 KB |
Output is correct |
7 |
Correct |
5 ms |
10844 KB |
Output is correct |
8 |
Correct |
5 ms |
10844 KB |
Output is correct |
9 |
Correct |
5 ms |
10844 KB |
Output is correct |
10 |
Correct |
5 ms |
10820 KB |
Output is correct |
11 |
Correct |
5 ms |
10844 KB |
Output is correct |
12 |
Correct |
9 ms |
11096 KB |
Output is correct |
13 |
Correct |
6 ms |
11100 KB |
Output is correct |
14 |
Correct |
14 ms |
12892 KB |
Output is correct |
15 |
Correct |
24 ms |
14940 KB |
Output is correct |
16 |
Correct |
44 ms |
16728 KB |
Output is correct |
17 |
Correct |
37 ms |
16732 KB |
Output is correct |
18 |
Correct |
42 ms |
16732 KB |
Output is correct |
19 |
Correct |
39 ms |
16728 KB |
Output is correct |
20 |
Correct |
37 ms |
16780 KB |
Output is correct |
21 |
Correct |
39 ms |
16724 KB |
Output is correct |
22 |
Correct |
58 ms |
16824 KB |
Output is correct |
23 |
Correct |
38 ms |
16876 KB |
Output is correct |
24 |
Correct |
37 ms |
16884 KB |
Output is correct |
25 |
Correct |
38 ms |
16728 KB |
Output is correct |
26 |
Correct |
6 ms |
10844 KB |
Output is correct |
27 |
Correct |
5 ms |
10840 KB |
Output is correct |
28 |
Correct |
6 ms |
11100 KB |
Output is correct |
29 |
Correct |
15 ms |
12812 KB |
Output is correct |
30 |
Correct |
28 ms |
14936 KB |
Output is correct |
31 |
Correct |
44 ms |
16672 KB |
Output is correct |
32 |
Correct |
41 ms |
16732 KB |
Output is correct |
33 |
Correct |
39 ms |
16624 KB |
Output is correct |
34 |
Correct |
44 ms |
16732 KB |
Output is correct |
35 |
Correct |
41 ms |
16884 KB |
Output is correct |
36 |
Correct |
42 ms |
16660 KB |
Output is correct |
37 |
Correct |
40 ms |
16652 KB |
Output is correct |
38 |
Correct |
43 ms |
16664 KB |
Output is correct |
39 |
Correct |
39 ms |
16728 KB |
Output is correct |
40 |
Correct |
48 ms |
16876 KB |
Output is correct |
41 |
Correct |
5 ms |
10844 KB |
Output is correct |
42 |
Correct |
5 ms |
10844 KB |
Output is correct |
43 |
Correct |
5 ms |
10876 KB |
Output is correct |
44 |
Correct |
6 ms |
11100 KB |
Output is correct |
45 |
Correct |
8 ms |
11100 KB |
Output is correct |
46 |
Correct |
6 ms |
11100 KB |
Output is correct |
47 |
Correct |
13 ms |
11868 KB |
Output is correct |
48 |
Correct |
17 ms |
11868 KB |
Output is correct |
49 |
Correct |
26 ms |
12888 KB |
Output is correct |
50 |
Correct |
34 ms |
14740 KB |
Output is correct |
51 |
Correct |
40 ms |
16668 KB |
Output is correct |
52 |
Correct |
40 ms |
16732 KB |
Output is correct |
53 |
Correct |
39 ms |
16728 KB |
Output is correct |
54 |
Correct |
44 ms |
16668 KB |
Output is correct |
55 |
Correct |
38 ms |
16732 KB |
Output is correct |
56 |
Correct |
39 ms |
16732 KB |
Output is correct |
57 |
Correct |
50 ms |
16724 KB |
Output is correct |
58 |
Correct |
41 ms |
16724 KB |
Output is correct |
59 |
Correct |
40 ms |
16732 KB |
Output is correct |
60 |
Correct |
41 ms |
16732 KB |
Output is correct |
61 |
Correct |
41 ms |
16728 KB |
Output is correct |
62 |
Correct |
41 ms |
16728 KB |
Output is correct |
63 |
Correct |
39 ms |
16724 KB |
Output is correct |
64 |
Correct |
45 ms |
16660 KB |
Output is correct |
65 |
Correct |
40 ms |
16728 KB |
Output is correct |
66 |
Correct |
38 ms |
16732 KB |
Output is correct |
67 |
Correct |
38 ms |
16664 KB |
Output is correct |
68 |
Correct |
39 ms |
16728 KB |
Output is correct |
69 |
Correct |
41 ms |
16724 KB |
Output is correct |
70 |
Correct |
39 ms |
16660 KB |
Output is correct |
71 |
Correct |
10 ms |
11868 KB |
Output is correct |
72 |
Correct |
10 ms |
11864 KB |
Output is correct |
73 |
Correct |
10 ms |
11864 KB |
Output is correct |
74 |
Correct |
10 ms |
11868 KB |
Output is correct |
75 |
Correct |
10 ms |
11868 KB |
Output is correct |
76 |
Correct |
15 ms |
12816 KB |
Output is correct |
77 |
Correct |
17 ms |
12892 KB |
Output is correct |
78 |
Correct |
16 ms |
12888 KB |
Output is correct |
79 |
Correct |
16 ms |
12992 KB |
Output is correct |
80 |
Correct |
15 ms |
12892 KB |
Output is correct |
81 |
Correct |
28 ms |
15192 KB |
Output is correct |
82 |
Correct |
31 ms |
14940 KB |
Output is correct |
83 |
Correct |
28 ms |
14780 KB |
Output is correct |
84 |
Correct |
29 ms |
14936 KB |
Output is correct |
85 |
Correct |
32 ms |
14940 KB |
Output is correct |
86 |
Correct |
29 ms |
15192 KB |
Output is correct |
87 |
Correct |
31 ms |
14748 KB |
Output is correct |
88 |
Correct |
37 ms |
14936 KB |
Output is correct |
89 |
Correct |
29 ms |
14940 KB |
Output is correct |
90 |
Correct |
30 ms |
14940 KB |
Output is correct |
91 |
Correct |
42 ms |
16660 KB |
Output is correct |
92 |
Correct |
46 ms |
16724 KB |
Output is correct |
93 |
Correct |
45 ms |
16728 KB |
Output is correct |
94 |
Correct |
43 ms |
16724 KB |
Output is correct |
95 |
Correct |
42 ms |
16884 KB |
Output is correct |
96 |
Correct |
48 ms |
16720 KB |
Output is correct |
97 |
Correct |
49 ms |
16732 KB |
Output is correct |
98 |
Correct |
50 ms |
16732 KB |
Output is correct |
99 |
Correct |
46 ms |
16732 KB |
Output is correct |
100 |
Correct |
45 ms |
16720 KB |
Output is correct |
101 |
Correct |
46 ms |
16720 KB |
Output is correct |
102 |
Correct |
46 ms |
16876 KB |
Output is correct |
103 |
Correct |
48 ms |
16732 KB |
Output is correct |
104 |
Correct |
55 ms |
16720 KB |
Output is correct |
105 |
Correct |
46 ms |
16732 KB |
Output is correct |
106 |
Correct |
44 ms |
16728 KB |
Output is correct |
107 |
Correct |
46 ms |
16648 KB |
Output is correct |
108 |
Correct |
44 ms |
16724 KB |
Output is correct |
109 |
Correct |
50 ms |
16904 KB |
Output is correct |
110 |
Correct |
50 ms |
16720 KB |
Output is correct |
111 |
Correct |
47 ms |
16656 KB |
Output is correct |
112 |
Correct |
47 ms |
16732 KB |
Output is correct |
113 |
Correct |
43 ms |
16900 KB |
Output is correct |
114 |
Correct |
45 ms |
16648 KB |
Output is correct |
115 |
Correct |
45 ms |
16672 KB |
Output is correct |
116 |
Correct |
109 ms |
12740 KB |
Output is correct |
117 |
Correct |
118 ms |
13168 KB |
Output is correct |
118 |
Correct |
422 ms |
14044 KB |
Output is correct |
119 |
Correct |
432 ms |
14284 KB |
Output is correct |
120 |
Correct |
434 ms |
14280 KB |
Output is correct |
121 |
Correct |
999 ms |
15632 KB |
Output is correct |
122 |
Correct |
1033 ms |
15620 KB |
Output is correct |
123 |
Correct |
2632 ms |
17952 KB |
Output is correct |
124 |
Correct |
2823 ms |
18116 KB |
Output is correct |
125 |
Correct |
2912 ms |
18120 KB |
Output is correct |
126 |
Correct |
5623 ms |
20120 KB |
Output is correct |
127 |
Correct |
5458 ms |
20232 KB |
Output is correct |
128 |
Correct |
5620 ms |
20224 KB |
Output is correct |
129 |
Correct |
5216 ms |
20232 KB |
Output is correct |
130 |
Correct |
4917 ms |
20172 KB |
Output is correct |
131 |
Correct |
5092 ms |
20276 KB |
Output is correct |
132 |
Correct |
5272 ms |
20340 KB |
Output is correct |
133 |
Correct |
5082 ms |
20168 KB |
Output is correct |
134 |
Correct |
5492 ms |
20260 KB |
Output is correct |
135 |
Correct |
5328 ms |
20168 KB |
Output is correct |
136 |
Correct |
5073 ms |
20260 KB |
Output is correct |
137 |
Correct |
5550 ms |
20288 KB |
Output is correct |
138 |
Correct |
5065 ms |
20168 KB |
Output is correct |
139 |
Correct |
5532 ms |
20256 KB |
Output is correct |
140 |
Correct |
5091 ms |
20172 KB |
Output is correct |
141 |
Correct |
5251 ms |
20360 KB |
Output is correct |
142 |
Correct |
5270 ms |
20292 KB |
Output is correct |
143 |
Correct |
5194 ms |
20424 KB |
Output is correct |
144 |
Correct |
5660 ms |
20300 KB |
Output is correct |
145 |
Correct |
5099 ms |
20436 KB |
Output is correct |
146 |
Correct |
5365 ms |
20684 KB |
Output is correct |
147 |
Correct |
5269 ms |
20684 KB |
Output is correct |
148 |
Correct |
5273 ms |
20600 KB |
Output is correct |
149 |
Correct |
5349 ms |
20680 KB |
Output is correct |
150 |
Correct |
5444 ms |
20732 KB |
Output is correct |
151 |
Correct |
5367 ms |
20596 KB |
Output is correct |
152 |
Correct |
5568 ms |
20592 KB |
Output is correct |
153 |
Correct |
5491 ms |
20592 KB |
Output is correct |
154 |
Correct |
5460 ms |
20592 KB |
Output is correct |
155 |
Correct |
5510 ms |
20688 KB |
Output is correct |
156 |
Correct |
5825 ms |
20872 KB |
Output is correct |
157 |
Correct |
5808 ms |
20876 KB |
Output is correct |
158 |
Correct |
5611 ms |
20876 KB |
Output is correct |
159 |
Correct |
5715 ms |
20860 KB |
Output is correct |
160 |
Correct |
5748 ms |
20872 KB |
Output is correct |
161 |
Correct |
5934 ms |
20968 KB |
Output is correct |
162 |
Correct |
5427 ms |
20972 KB |
Output is correct |
163 |
Correct |
5585 ms |
21108 KB |
Output is correct |
164 |
Correct |
5698 ms |
20972 KB |
Output is correct |
165 |
Correct |
5594 ms |
20964 KB |
Output is correct |
166 |
Correct |
5480 ms |
20684 KB |
Output is correct |
167 |
Correct |
5751 ms |
20768 KB |
Output is correct |
168 |
Correct |
5498 ms |
20680 KB |
Output is correct |
169 |
Correct |
6048 ms |
20680 KB |
Output is correct |
170 |
Correct |
5580 ms |
20752 KB |
Output is correct |
171 |
Correct |
5663 ms |
20904 KB |
Output is correct |
172 |
Correct |
5407 ms |
20728 KB |
Output is correct |
173 |
Correct |
5438 ms |
20940 KB |
Output is correct |
174 |
Correct |
5257 ms |
20824 KB |
Output is correct |
175 |
Correct |
5382 ms |
20836 KB |
Output is correct |