# pragma GCC optimize ("O3")
# pragma GCC optimize ("Ofast")
# pragma GCC optimize ("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
int n,q;
int arr[300005];
int cnt[300005];
const int sq=1000;
typedef pair<long long,long long> P;
long long tree1[300005];
long long tree2[300005];
typedef pair<P,int> Pi;
const int MAX=300000;
long long h1,h2;
P pl(P a,P b) {
return P(a.first+b.first,a.second+b.second);
}
P mi(P a,P b) {
return P(a.first-b.first,a.second-b.second);
}
inline long long sum1(int i) {
long long ret=0;
i++;
while (i>0) {
ret+=tree1[i];
i-=(i&-i);
}
return ret;
}
inline long long sum2(int i) {
long long ret=0;
i++;
while (i>0) {
ret+=tree2[i];
i-=(i&-i);
}
return ret;
}
inline P sum3(int i) {
i++;
P ret=P(0,0);
while (i>0) {
ret.first+=tree1[i];
ret.second+=tree2[i];
i-=(i&-i);
}
return ret;
}
inline void update(int i,P val) {
i++;
h1+=val.first;
h2+=val.second;
while (i<=300004) {
tree1[i]+=val.first;
tree2[i]+=val.second;
i+=(i&-i);
}
}
int pos[300005];
int tree[300005];
inline int sum(int i) {
i++;
int ret=0;
while (i>0) {
ret+=tree[i];
i-=(i&-i);
}
return ret;
}
inline void upd(int i,int val) {
i++;
while (i<=300004) {
tree[i]+=val;
i+=(i&-i);
}
}
bool comp(Pi a,Pi b) {
if (a.first.first/sq==b.first.first/sq) {
return a.first.second<b.first.second;
}
return a.first.first/sq<b.first.first/sq;
}
long long value=0;
int chk[300005];
inline void push(int ind) {
int now=arr[ind];
int p=chk[cnt[now]]-1;
p=pos[p];
chk[cnt[now]]--;
cnt[now]++;
P got=sum3(p);
long long one=got.first;
long long two=got.second;
value+=p*got.second-got.first;
got=P(h1-one,h2-two);
value+=got.first-p*got.second;
update(p,P(p,1));
}
inline void out(int ind) {
int now=arr[ind];
int p=chk[cnt[now]-1];
p=pos[p];
chk[cnt[now]-1]++;
cnt[now]--;
P got=sum3(p);
long long one=got.first;
long long two=got.second;
value-=p*got.second-got.first;
got=P(h1-one,h2-two);
value-=got.first-p*got.second;
update(p,P(-p,-1));
}
long long ret[50005];
int main(void) {
scanf("%d %d",&n,&q);
for(int i=0;i<n;i++) {
scanf("%d",&arr[i]);
}
vector<int> v;
for(int i=1;i<=300000;i++) {
v.push_back(i-1);
}
sort(v.begin(),v.end());
vector<long long> v1;
for(int i=0;i<v.size();i+=2) {
v1.push_back(v[i]);
}
vector<long long> v2;
for(int i=1;i<v.size();i+=2) {
v2.push_back(v[i]);
}
reverse(v2.begin(),v2.end());
for(auto x:v2) {
v1.push_back(x);
}
for(int i=0;i<300000;i++) {
pos[v1[i]]=i;
chk[i]=300000;
}
upd(0,300000);
vector<Pi> query;
for(int i=0;i<q;i++) {
int l,r;
scanf("%d %d",&l,&r);
l--;
r--;
ret[i]=1LL*(r-l+1)*(r-l+2)/2;
query.push_back(Pi(P(l,r),i));
}
sort(query.begin(),query.end(),comp);
int l=query[0].first.first;
int r=query[0].first.first-1;
for(int i=0;i<q;i++) {
int nl=query[i].first.first;
int nr=query[i].first.second;
while (l>nl) {
l--;
push(l);
}
while (r<nr) {
r++;
push(r);
}
while (l<nl) {
out(l);
l++;
}
while (r>nr) {
out(r);
r--;
}
ret[query[i].second]+=value;
}
for(int i=0;i<q;i++) {
printf("%lld\n",ret[i]);
}
}
Compilation message
diversity.cpp: In function 'int main()':
diversity.cpp:142:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
142 | for(int i=0;i<v.size();i+=2) {
| ~^~~~~~~~~
diversity.cpp:146:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
146 | for(int i=1;i<v.size();i+=2) {
| ~^~~~~~~~~
diversity.cpp:132:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
132 | scanf("%d %d",&n,&q);
| ~~~~~^~~~~~~~~~~~~~~
diversity.cpp:134:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
134 | scanf("%d",&arr[i]);
| ~~~~~^~~~~~~~~~~~~~
diversity.cpp:161:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
161 | scanf("%d %d",&l,&r);
| ~~~~~^~~~~~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
13 ms |
7628 KB |
Output is correct |
2 |
Correct |
10 ms |
7632 KB |
Output is correct |
3 |
Correct |
10 ms |
7632 KB |
Output is correct |
4 |
Correct |
12 ms |
7632 KB |
Output is correct |
5 |
Correct |
11 ms |
7668 KB |
Output is correct |
6 |
Correct |
12 ms |
7628 KB |
Output is correct |
7 |
Correct |
11 ms |
7632 KB |
Output is correct |
8 |
Correct |
10 ms |
7632 KB |
Output is correct |
9 |
Correct |
11 ms |
7632 KB |
Output is correct |
10 |
Correct |
11 ms |
7632 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
10 ms |
7632 KB |
Output is correct |
2 |
Correct |
10 ms |
7632 KB |
Output is correct |
3 |
Correct |
11 ms |
7632 KB |
Output is correct |
4 |
Correct |
19 ms |
8144 KB |
Output is correct |
5 |
Correct |
27 ms |
9420 KB |
Output is correct |
6 |
Correct |
37 ms |
9424 KB |
Output is correct |
7 |
Correct |
36 ms |
9416 KB |
Output is correct |
8 |
Correct |
40 ms |
9428 KB |
Output is correct |
9 |
Correct |
36 ms |
9412 KB |
Output is correct |
10 |
Correct |
35 ms |
9412 KB |
Output is correct |
11 |
Correct |
36 ms |
9496 KB |
Output is correct |
12 |
Correct |
36 ms |
9416 KB |
Output is correct |
13 |
Correct |
39 ms |
9424 KB |
Output is correct |
14 |
Correct |
38 ms |
9464 KB |
Output is correct |
15 |
Correct |
37 ms |
9412 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
10 ms |
7632 KB |
Output is correct |
2 |
Correct |
10 ms |
7632 KB |
Output is correct |
3 |
Correct |
11 ms |
7632 KB |
Output is correct |
4 |
Correct |
19 ms |
8144 KB |
Output is correct |
5 |
Correct |
27 ms |
9420 KB |
Output is correct |
6 |
Correct |
37 ms |
9424 KB |
Output is correct |
7 |
Correct |
36 ms |
9416 KB |
Output is correct |
8 |
Correct |
40 ms |
9428 KB |
Output is correct |
9 |
Correct |
36 ms |
9412 KB |
Output is correct |
10 |
Correct |
35 ms |
9412 KB |
Output is correct |
11 |
Correct |
36 ms |
9496 KB |
Output is correct |
12 |
Correct |
36 ms |
9416 KB |
Output is correct |
13 |
Correct |
39 ms |
9424 KB |
Output is correct |
14 |
Correct |
38 ms |
9464 KB |
Output is correct |
15 |
Correct |
37 ms |
9412 KB |
Output is correct |
16 |
Correct |
12 ms |
7632 KB |
Output is correct |
17 |
Correct |
10 ms |
7632 KB |
Output is correct |
18 |
Correct |
11 ms |
7632 KB |
Output is correct |
19 |
Correct |
19 ms |
8376 KB |
Output is correct |
20 |
Correct |
31 ms |
8868 KB |
Output is correct |
21 |
Correct |
40 ms |
9568 KB |
Output is correct |
22 |
Correct |
38 ms |
9672 KB |
Output is correct |
23 |
Correct |
38 ms |
9672 KB |
Output is correct |
24 |
Correct |
38 ms |
9672 KB |
Output is correct |
25 |
Correct |
39 ms |
9604 KB |
Output is correct |
26 |
Correct |
50 ms |
9680 KB |
Output is correct |
27 |
Correct |
40 ms |
9672 KB |
Output is correct |
28 |
Correct |
37 ms |
9420 KB |
Output is correct |
29 |
Correct |
39 ms |
9680 KB |
Output is correct |
30 |
Correct |
38 ms |
9680 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
10 ms |
7632 KB |
Output is correct |
2 |
Correct |
10 ms |
7632 KB |
Output is correct |
3 |
Correct |
11 ms |
7632 KB |
Output is correct |
4 |
Correct |
19 ms |
8144 KB |
Output is correct |
5 |
Correct |
27 ms |
9420 KB |
Output is correct |
6 |
Correct |
37 ms |
9424 KB |
Output is correct |
7 |
Correct |
36 ms |
9416 KB |
Output is correct |
8 |
Correct |
40 ms |
9428 KB |
Output is correct |
9 |
Correct |
36 ms |
9412 KB |
Output is correct |
10 |
Correct |
35 ms |
9412 KB |
Output is correct |
11 |
Correct |
36 ms |
9496 KB |
Output is correct |
12 |
Correct |
36 ms |
9416 KB |
Output is correct |
13 |
Correct |
39 ms |
9424 KB |
Output is correct |
14 |
Correct |
38 ms |
9464 KB |
Output is correct |
15 |
Correct |
37 ms |
9412 KB |
Output is correct |
16 |
Correct |
12 ms |
7632 KB |
Output is correct |
17 |
Correct |
10 ms |
7632 KB |
Output is correct |
18 |
Correct |
11 ms |
7632 KB |
Output is correct |
19 |
Correct |
19 ms |
8376 KB |
Output is correct |
20 |
Correct |
31 ms |
8868 KB |
Output is correct |
21 |
Correct |
40 ms |
9568 KB |
Output is correct |
22 |
Correct |
38 ms |
9672 KB |
Output is correct |
23 |
Correct |
38 ms |
9672 KB |
Output is correct |
24 |
Correct |
38 ms |
9672 KB |
Output is correct |
25 |
Correct |
39 ms |
9604 KB |
Output is correct |
26 |
Correct |
50 ms |
9680 KB |
Output is correct |
27 |
Correct |
40 ms |
9672 KB |
Output is correct |
28 |
Correct |
37 ms |
9420 KB |
Output is correct |
29 |
Correct |
39 ms |
9680 KB |
Output is correct |
30 |
Correct |
38 ms |
9680 KB |
Output is correct |
31 |
Correct |
11 ms |
7632 KB |
Output is correct |
32 |
Correct |
11 ms |
7680 KB |
Output is correct |
33 |
Correct |
11 ms |
7628 KB |
Output is correct |
34 |
Correct |
12 ms |
7628 KB |
Output is correct |
35 |
Correct |
13 ms |
7740 KB |
Output is correct |
36 |
Correct |
12 ms |
7632 KB |
Output is correct |
37 |
Correct |
15 ms |
8140 KB |
Output is correct |
38 |
Correct |
15 ms |
8176 KB |
Output is correct |
39 |
Correct |
20 ms |
8400 KB |
Output is correct |
40 |
Correct |
31 ms |
9200 KB |
Output is correct |
41 |
Correct |
39 ms |
9880 KB |
Output is correct |
42 |
Correct |
40 ms |
9928 KB |
Output is correct |
43 |
Correct |
39 ms |
9928 KB |
Output is correct |
44 |
Correct |
39 ms |
10028 KB |
Output is correct |
45 |
Correct |
41 ms |
9932 KB |
Output is correct |
46 |
Correct |
42 ms |
9936 KB |
Output is correct |
47 |
Correct |
41 ms |
9936 KB |
Output is correct |
48 |
Correct |
40 ms |
10096 KB |
Output is correct |
49 |
Correct |
39 ms |
10076 KB |
Output is correct |
50 |
Correct |
39 ms |
9936 KB |
Output is correct |
51 |
Correct |
41 ms |
9924 KB |
Output is correct |
52 |
Correct |
43 ms |
9928 KB |
Output is correct |
53 |
Correct |
39 ms |
9932 KB |
Output is correct |
54 |
Correct |
40 ms |
9936 KB |
Output is correct |
55 |
Correct |
45 ms |
9928 KB |
Output is correct |
56 |
Correct |
40 ms |
9928 KB |
Output is correct |
57 |
Correct |
38 ms |
9932 KB |
Output is correct |
58 |
Correct |
39 ms |
9928 KB |
Output is correct |
59 |
Correct |
38 ms |
9936 KB |
Output is correct |
60 |
Correct |
39 ms |
9928 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
13 ms |
7628 KB |
Output is correct |
2 |
Correct |
10 ms |
7632 KB |
Output is correct |
3 |
Correct |
10 ms |
7632 KB |
Output is correct |
4 |
Correct |
12 ms |
7632 KB |
Output is correct |
5 |
Correct |
11 ms |
7668 KB |
Output is correct |
6 |
Correct |
12 ms |
7628 KB |
Output is correct |
7 |
Correct |
11 ms |
7632 KB |
Output is correct |
8 |
Correct |
10 ms |
7632 KB |
Output is correct |
9 |
Correct |
11 ms |
7632 KB |
Output is correct |
10 |
Correct |
11 ms |
7632 KB |
Output is correct |
11 |
Correct |
10 ms |
7632 KB |
Output is correct |
12 |
Correct |
10 ms |
7632 KB |
Output is correct |
13 |
Correct |
11 ms |
7632 KB |
Output is correct |
14 |
Correct |
19 ms |
8144 KB |
Output is correct |
15 |
Correct |
27 ms |
9420 KB |
Output is correct |
16 |
Correct |
37 ms |
9424 KB |
Output is correct |
17 |
Correct |
36 ms |
9416 KB |
Output is correct |
18 |
Correct |
40 ms |
9428 KB |
Output is correct |
19 |
Correct |
36 ms |
9412 KB |
Output is correct |
20 |
Correct |
35 ms |
9412 KB |
Output is correct |
21 |
Correct |
36 ms |
9496 KB |
Output is correct |
22 |
Correct |
36 ms |
9416 KB |
Output is correct |
23 |
Correct |
39 ms |
9424 KB |
Output is correct |
24 |
Correct |
38 ms |
9464 KB |
Output is correct |
25 |
Correct |
37 ms |
9412 KB |
Output is correct |
26 |
Correct |
12 ms |
7632 KB |
Output is correct |
27 |
Correct |
10 ms |
7632 KB |
Output is correct |
28 |
Correct |
11 ms |
7632 KB |
Output is correct |
29 |
Correct |
19 ms |
8376 KB |
Output is correct |
30 |
Correct |
31 ms |
8868 KB |
Output is correct |
31 |
Correct |
40 ms |
9568 KB |
Output is correct |
32 |
Correct |
38 ms |
9672 KB |
Output is correct |
33 |
Correct |
38 ms |
9672 KB |
Output is correct |
34 |
Correct |
38 ms |
9672 KB |
Output is correct |
35 |
Correct |
39 ms |
9604 KB |
Output is correct |
36 |
Correct |
50 ms |
9680 KB |
Output is correct |
37 |
Correct |
40 ms |
9672 KB |
Output is correct |
38 |
Correct |
37 ms |
9420 KB |
Output is correct |
39 |
Correct |
39 ms |
9680 KB |
Output is correct |
40 |
Correct |
38 ms |
9680 KB |
Output is correct |
41 |
Correct |
11 ms |
7632 KB |
Output is correct |
42 |
Correct |
11 ms |
7680 KB |
Output is correct |
43 |
Correct |
11 ms |
7628 KB |
Output is correct |
44 |
Correct |
12 ms |
7628 KB |
Output is correct |
45 |
Correct |
13 ms |
7740 KB |
Output is correct |
46 |
Correct |
12 ms |
7632 KB |
Output is correct |
47 |
Correct |
15 ms |
8140 KB |
Output is correct |
48 |
Correct |
15 ms |
8176 KB |
Output is correct |
49 |
Correct |
20 ms |
8400 KB |
Output is correct |
50 |
Correct |
31 ms |
9200 KB |
Output is correct |
51 |
Correct |
39 ms |
9880 KB |
Output is correct |
52 |
Correct |
40 ms |
9928 KB |
Output is correct |
53 |
Correct |
39 ms |
9928 KB |
Output is correct |
54 |
Correct |
39 ms |
10028 KB |
Output is correct |
55 |
Correct |
41 ms |
9932 KB |
Output is correct |
56 |
Correct |
42 ms |
9936 KB |
Output is correct |
57 |
Correct |
41 ms |
9936 KB |
Output is correct |
58 |
Correct |
40 ms |
10096 KB |
Output is correct |
59 |
Correct |
39 ms |
10076 KB |
Output is correct |
60 |
Correct |
39 ms |
9936 KB |
Output is correct |
61 |
Correct |
41 ms |
9924 KB |
Output is correct |
62 |
Correct |
43 ms |
9928 KB |
Output is correct |
63 |
Correct |
39 ms |
9932 KB |
Output is correct |
64 |
Correct |
40 ms |
9936 KB |
Output is correct |
65 |
Correct |
45 ms |
9928 KB |
Output is correct |
66 |
Correct |
40 ms |
9928 KB |
Output is correct |
67 |
Correct |
38 ms |
9932 KB |
Output is correct |
68 |
Correct |
39 ms |
9928 KB |
Output is correct |
69 |
Correct |
38 ms |
9936 KB |
Output is correct |
70 |
Correct |
39 ms |
9928 KB |
Output is correct |
71 |
Correct |
16 ms |
8124 KB |
Output is correct |
72 |
Correct |
15 ms |
8000 KB |
Output is correct |
73 |
Correct |
15 ms |
8144 KB |
Output is correct |
74 |
Correct |
15 ms |
8012 KB |
Output is correct |
75 |
Correct |
15 ms |
8140 KB |
Output is correct |
76 |
Correct |
21 ms |
8524 KB |
Output is correct |
77 |
Correct |
20 ms |
8720 KB |
Output is correct |
78 |
Correct |
20 ms |
8656 KB |
Output is correct |
79 |
Correct |
21 ms |
8580 KB |
Output is correct |
80 |
Correct |
24 ms |
8656 KB |
Output is correct |
81 |
Correct |
31 ms |
9516 KB |
Output is correct |
82 |
Correct |
32 ms |
9416 KB |
Output is correct |
83 |
Correct |
48 ms |
9644 KB |
Output is correct |
84 |
Correct |
31 ms |
9628 KB |
Output is correct |
85 |
Correct |
31 ms |
9668 KB |
Output is correct |
86 |
Correct |
33 ms |
9784 KB |
Output is correct |
87 |
Correct |
33 ms |
9776 KB |
Output is correct |
88 |
Correct |
33 ms |
9932 KB |
Output is correct |
89 |
Correct |
32 ms |
9792 KB |
Output is correct |
90 |
Correct |
33 ms |
9964 KB |
Output is correct |
91 |
Correct |
44 ms |
12556 KB |
Output is correct |
92 |
Correct |
46 ms |
12536 KB |
Output is correct |
93 |
Correct |
44 ms |
12488 KB |
Output is correct |
94 |
Correct |
47 ms |
12488 KB |
Output is correct |
95 |
Correct |
46 ms |
12540 KB |
Output is correct |
96 |
Correct |
51 ms |
14536 KB |
Output is correct |
97 |
Correct |
49 ms |
14520 KB |
Output is correct |
98 |
Correct |
50 ms |
14672 KB |
Output is correct |
99 |
Correct |
51 ms |
14468 KB |
Output is correct |
100 |
Correct |
50 ms |
14532 KB |
Output is correct |
101 |
Correct |
51 ms |
14536 KB |
Output is correct |
102 |
Correct |
56 ms |
14676 KB |
Output is correct |
103 |
Correct |
49 ms |
14624 KB |
Output is correct |
104 |
Correct |
56 ms |
14580 KB |
Output is correct |
105 |
Correct |
49 ms |
14484 KB |
Output is correct |
106 |
Correct |
51 ms |
15560 KB |
Output is correct |
107 |
Correct |
49 ms |
15560 KB |
Output is correct |
108 |
Correct |
52 ms |
15632 KB |
Output is correct |
109 |
Correct |
51 ms |
15544 KB |
Output is correct |
110 |
Correct |
50 ms |
15556 KB |
Output is correct |
111 |
Correct |
52 ms |
15648 KB |
Output is correct |
112 |
Correct |
52 ms |
15492 KB |
Output is correct |
113 |
Correct |
51 ms |
15460 KB |
Output is correct |
114 |
Correct |
54 ms |
15808 KB |
Output is correct |
115 |
Correct |
53 ms |
15556 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
13 ms |
7628 KB |
Output is correct |
2 |
Correct |
10 ms |
7632 KB |
Output is correct |
3 |
Correct |
10 ms |
7632 KB |
Output is correct |
4 |
Correct |
12 ms |
7632 KB |
Output is correct |
5 |
Correct |
11 ms |
7668 KB |
Output is correct |
6 |
Correct |
12 ms |
7628 KB |
Output is correct |
7 |
Correct |
11 ms |
7632 KB |
Output is correct |
8 |
Correct |
10 ms |
7632 KB |
Output is correct |
9 |
Correct |
11 ms |
7632 KB |
Output is correct |
10 |
Correct |
11 ms |
7632 KB |
Output is correct |
11 |
Correct |
10 ms |
7632 KB |
Output is correct |
12 |
Correct |
10 ms |
7632 KB |
Output is correct |
13 |
Correct |
11 ms |
7632 KB |
Output is correct |
14 |
Correct |
19 ms |
8144 KB |
Output is correct |
15 |
Correct |
27 ms |
9420 KB |
Output is correct |
16 |
Correct |
37 ms |
9424 KB |
Output is correct |
17 |
Correct |
36 ms |
9416 KB |
Output is correct |
18 |
Correct |
40 ms |
9428 KB |
Output is correct |
19 |
Correct |
36 ms |
9412 KB |
Output is correct |
20 |
Correct |
35 ms |
9412 KB |
Output is correct |
21 |
Correct |
36 ms |
9496 KB |
Output is correct |
22 |
Correct |
36 ms |
9416 KB |
Output is correct |
23 |
Correct |
39 ms |
9424 KB |
Output is correct |
24 |
Correct |
38 ms |
9464 KB |
Output is correct |
25 |
Correct |
37 ms |
9412 KB |
Output is correct |
26 |
Correct |
12 ms |
7632 KB |
Output is correct |
27 |
Correct |
10 ms |
7632 KB |
Output is correct |
28 |
Correct |
11 ms |
7632 KB |
Output is correct |
29 |
Correct |
19 ms |
8376 KB |
Output is correct |
30 |
Correct |
31 ms |
8868 KB |
Output is correct |
31 |
Correct |
40 ms |
9568 KB |
Output is correct |
32 |
Correct |
38 ms |
9672 KB |
Output is correct |
33 |
Correct |
38 ms |
9672 KB |
Output is correct |
34 |
Correct |
38 ms |
9672 KB |
Output is correct |
35 |
Correct |
39 ms |
9604 KB |
Output is correct |
36 |
Correct |
50 ms |
9680 KB |
Output is correct |
37 |
Correct |
40 ms |
9672 KB |
Output is correct |
38 |
Correct |
37 ms |
9420 KB |
Output is correct |
39 |
Correct |
39 ms |
9680 KB |
Output is correct |
40 |
Correct |
38 ms |
9680 KB |
Output is correct |
41 |
Correct |
11 ms |
7632 KB |
Output is correct |
42 |
Correct |
11 ms |
7680 KB |
Output is correct |
43 |
Correct |
11 ms |
7628 KB |
Output is correct |
44 |
Correct |
12 ms |
7628 KB |
Output is correct |
45 |
Correct |
13 ms |
7740 KB |
Output is correct |
46 |
Correct |
12 ms |
7632 KB |
Output is correct |
47 |
Correct |
15 ms |
8140 KB |
Output is correct |
48 |
Correct |
15 ms |
8176 KB |
Output is correct |
49 |
Correct |
20 ms |
8400 KB |
Output is correct |
50 |
Correct |
31 ms |
9200 KB |
Output is correct |
51 |
Correct |
39 ms |
9880 KB |
Output is correct |
52 |
Correct |
40 ms |
9928 KB |
Output is correct |
53 |
Correct |
39 ms |
9928 KB |
Output is correct |
54 |
Correct |
39 ms |
10028 KB |
Output is correct |
55 |
Correct |
41 ms |
9932 KB |
Output is correct |
56 |
Correct |
42 ms |
9936 KB |
Output is correct |
57 |
Correct |
41 ms |
9936 KB |
Output is correct |
58 |
Correct |
40 ms |
10096 KB |
Output is correct |
59 |
Correct |
39 ms |
10076 KB |
Output is correct |
60 |
Correct |
39 ms |
9936 KB |
Output is correct |
61 |
Correct |
41 ms |
9924 KB |
Output is correct |
62 |
Correct |
43 ms |
9928 KB |
Output is correct |
63 |
Correct |
39 ms |
9932 KB |
Output is correct |
64 |
Correct |
40 ms |
9936 KB |
Output is correct |
65 |
Correct |
45 ms |
9928 KB |
Output is correct |
66 |
Correct |
40 ms |
9928 KB |
Output is correct |
67 |
Correct |
38 ms |
9932 KB |
Output is correct |
68 |
Correct |
39 ms |
9928 KB |
Output is correct |
69 |
Correct |
38 ms |
9936 KB |
Output is correct |
70 |
Correct |
39 ms |
9928 KB |
Output is correct |
71 |
Correct |
16 ms |
8124 KB |
Output is correct |
72 |
Correct |
15 ms |
8000 KB |
Output is correct |
73 |
Correct |
15 ms |
8144 KB |
Output is correct |
74 |
Correct |
15 ms |
8012 KB |
Output is correct |
75 |
Correct |
15 ms |
8140 KB |
Output is correct |
76 |
Correct |
21 ms |
8524 KB |
Output is correct |
77 |
Correct |
20 ms |
8720 KB |
Output is correct |
78 |
Correct |
20 ms |
8656 KB |
Output is correct |
79 |
Correct |
21 ms |
8580 KB |
Output is correct |
80 |
Correct |
24 ms |
8656 KB |
Output is correct |
81 |
Correct |
31 ms |
9516 KB |
Output is correct |
82 |
Correct |
32 ms |
9416 KB |
Output is correct |
83 |
Correct |
48 ms |
9644 KB |
Output is correct |
84 |
Correct |
31 ms |
9628 KB |
Output is correct |
85 |
Correct |
31 ms |
9668 KB |
Output is correct |
86 |
Correct |
33 ms |
9784 KB |
Output is correct |
87 |
Correct |
33 ms |
9776 KB |
Output is correct |
88 |
Correct |
33 ms |
9932 KB |
Output is correct |
89 |
Correct |
32 ms |
9792 KB |
Output is correct |
90 |
Correct |
33 ms |
9964 KB |
Output is correct |
91 |
Correct |
44 ms |
12556 KB |
Output is correct |
92 |
Correct |
46 ms |
12536 KB |
Output is correct |
93 |
Correct |
44 ms |
12488 KB |
Output is correct |
94 |
Correct |
47 ms |
12488 KB |
Output is correct |
95 |
Correct |
46 ms |
12540 KB |
Output is correct |
96 |
Correct |
51 ms |
14536 KB |
Output is correct |
97 |
Correct |
49 ms |
14520 KB |
Output is correct |
98 |
Correct |
50 ms |
14672 KB |
Output is correct |
99 |
Correct |
51 ms |
14468 KB |
Output is correct |
100 |
Correct |
50 ms |
14532 KB |
Output is correct |
101 |
Correct |
51 ms |
14536 KB |
Output is correct |
102 |
Correct |
56 ms |
14676 KB |
Output is correct |
103 |
Correct |
49 ms |
14624 KB |
Output is correct |
104 |
Correct |
56 ms |
14580 KB |
Output is correct |
105 |
Correct |
49 ms |
14484 KB |
Output is correct |
106 |
Correct |
51 ms |
15560 KB |
Output is correct |
107 |
Correct |
49 ms |
15560 KB |
Output is correct |
108 |
Correct |
52 ms |
15632 KB |
Output is correct |
109 |
Correct |
51 ms |
15544 KB |
Output is correct |
110 |
Correct |
50 ms |
15556 KB |
Output is correct |
111 |
Correct |
52 ms |
15648 KB |
Output is correct |
112 |
Correct |
52 ms |
15492 KB |
Output is correct |
113 |
Correct |
51 ms |
15460 KB |
Output is correct |
114 |
Correct |
54 ms |
15808 KB |
Output is correct |
115 |
Correct |
53 ms |
15556 KB |
Output is correct |
116 |
Correct |
676 ms |
11732 KB |
Output is correct |
117 |
Correct |
685 ms |
11536 KB |
Output is correct |
118 |
Correct |
799 ms |
12136 KB |
Output is correct |
119 |
Correct |
823 ms |
12220 KB |
Output is correct |
120 |
Correct |
780 ms |
12220 KB |
Output is correct |
121 |
Correct |
1099 ms |
12472 KB |
Output is correct |
122 |
Correct |
1168 ms |
12540 KB |
Output is correct |
123 |
Correct |
2284 ms |
13500 KB |
Output is correct |
124 |
Correct |
2506 ms |
13756 KB |
Output is correct |
125 |
Correct |
2510 ms |
13780 KB |
Output is correct |
126 |
Correct |
4448 ms |
14132 KB |
Output is correct |
127 |
Correct |
4518 ms |
14056 KB |
Output is correct |
128 |
Correct |
4451 ms |
14012 KB |
Output is correct |
129 |
Correct |
4510 ms |
14012 KB |
Output is correct |
130 |
Correct |
4450 ms |
14012 KB |
Output is correct |
131 |
Correct |
4488 ms |
14168 KB |
Output is correct |
132 |
Correct |
4412 ms |
14172 KB |
Output is correct |
133 |
Correct |
4498 ms |
14152 KB |
Output is correct |
134 |
Correct |
4508 ms |
14264 KB |
Output is correct |
135 |
Correct |
4575 ms |
14172 KB |
Output is correct |
136 |
Correct |
4489 ms |
14160 KB |
Output is correct |
137 |
Correct |
4618 ms |
14176 KB |
Output is correct |
138 |
Correct |
4440 ms |
14080 KB |
Output is correct |
139 |
Correct |
4503 ms |
14152 KB |
Output is correct |
140 |
Correct |
4482 ms |
14152 KB |
Output is correct |
141 |
Correct |
4474 ms |
14196 KB |
Output is correct |
142 |
Correct |
4342 ms |
14192 KB |
Output is correct |
143 |
Correct |
4311 ms |
14200 KB |
Output is correct |
144 |
Correct |
4308 ms |
14124 KB |
Output is correct |
145 |
Correct |
4343 ms |
14264 KB |
Output is correct |
146 |
Correct |
4745 ms |
14560 KB |
Output is correct |
147 |
Correct |
4735 ms |
14632 KB |
Output is correct |
148 |
Correct |
4632 ms |
14520 KB |
Output is correct |
149 |
Correct |
4708 ms |
14540 KB |
Output is correct |
150 |
Correct |
4660 ms |
14532 KB |
Output is correct |
151 |
Correct |
4681 ms |
14656 KB |
Output is correct |
152 |
Correct |
4806 ms |
14780 KB |
Output is correct |
153 |
Correct |
4744 ms |
14780 KB |
Output is correct |
154 |
Correct |
4952 ms |
14664 KB |
Output is correct |
155 |
Correct |
4871 ms |
14780 KB |
Output is correct |
156 |
Correct |
4813 ms |
15744 KB |
Output is correct |
157 |
Correct |
4796 ms |
15888 KB |
Output is correct |
158 |
Correct |
4723 ms |
15740 KB |
Output is correct |
159 |
Correct |
4804 ms |
15804 KB |
Output is correct |
160 |
Correct |
4685 ms |
15744 KB |
Output is correct |
161 |
Correct |
4598 ms |
15548 KB |
Output is correct |
162 |
Correct |
4749 ms |
15492 KB |
Output is correct |
163 |
Correct |
4789 ms |
15452 KB |
Output is correct |
164 |
Correct |
5089 ms |
15464 KB |
Output is correct |
165 |
Correct |
4645 ms |
15544 KB |
Output is correct |
166 |
Correct |
4295 ms |
14584 KB |
Output is correct |
167 |
Correct |
4380 ms |
14656 KB |
Output is correct |
168 |
Correct |
4594 ms |
14668 KB |
Output is correct |
169 |
Correct |
4385 ms |
14664 KB |
Output is correct |
170 |
Correct |
4367 ms |
14732 KB |
Output is correct |
171 |
Correct |
4434 ms |
14596 KB |
Output is correct |
172 |
Correct |
4409 ms |
14780 KB |
Output is correct |
173 |
Correct |
4365 ms |
14812 KB |
Output is correct |
174 |
Correct |
4385 ms |
14780 KB |
Output is correct |
175 |
Correct |
4321 ms |
14776 KB |
Output is correct |