# 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;
inline void push(int ind) {
int now=arr[ind];
int p=sum(cnt[now])-1;
p=pos[p];
upd(cnt[now],-1);
upd(cnt[now]+1,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));
}
inline void out(int ind) {
int now=arr[ind];
int p=sum(cnt[now]-1);
p=pos[p];
upd(cnt[now],-1);
upd(cnt[now]-1,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;
}
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:143:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
143 | for(int i=0;i<v.size();i+=2) {
| ~^~~~~~~~~
diversity.cpp:147:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
147 | for(int i=1;i<v.size();i+=2) {
| ~^~~~~~~~~
diversity.cpp:133:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
133 | scanf("%d %d",&n,&q);
| ~~~~~^~~~~~~~~~~~~~~
diversity.cpp:135:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
135 | 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);
| ~~~~~^~~~~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
10 ms |
6864 KB |
Output is correct |
2 |
Correct |
10 ms |
6868 KB |
Output is correct |
3 |
Correct |
10 ms |
6904 KB |
Output is correct |
4 |
Correct |
11 ms |
6896 KB |
Output is correct |
5 |
Correct |
10 ms |
6868 KB |
Output is correct |
6 |
Correct |
10 ms |
7116 KB |
Output is correct |
7 |
Correct |
10 ms |
6868 KB |
Output is correct |
8 |
Correct |
10 ms |
7056 KB |
Output is correct |
9 |
Correct |
11 ms |
6864 KB |
Output is correct |
10 |
Correct |
10 ms |
6868 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
10 ms |
6868 KB |
Output is correct |
2 |
Correct |
11 ms |
6868 KB |
Output is correct |
3 |
Correct |
11 ms |
7124 KB |
Output is correct |
4 |
Correct |
23 ms |
7636 KB |
Output is correct |
5 |
Correct |
33 ms |
8136 KB |
Output is correct |
6 |
Correct |
45 ms |
8572 KB |
Output is correct |
7 |
Correct |
45 ms |
8732 KB |
Output is correct |
8 |
Correct |
49 ms |
8652 KB |
Output is correct |
9 |
Correct |
45 ms |
8652 KB |
Output is correct |
10 |
Correct |
46 ms |
8648 KB |
Output is correct |
11 |
Correct |
45 ms |
8652 KB |
Output is correct |
12 |
Correct |
48 ms |
8652 KB |
Output is correct |
13 |
Correct |
45 ms |
8652 KB |
Output is correct |
14 |
Correct |
46 ms |
8660 KB |
Output is correct |
15 |
Correct |
45 ms |
8660 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
10 ms |
6868 KB |
Output is correct |
2 |
Correct |
11 ms |
6868 KB |
Output is correct |
3 |
Correct |
11 ms |
7124 KB |
Output is correct |
4 |
Correct |
23 ms |
7636 KB |
Output is correct |
5 |
Correct |
33 ms |
8136 KB |
Output is correct |
6 |
Correct |
45 ms |
8572 KB |
Output is correct |
7 |
Correct |
45 ms |
8732 KB |
Output is correct |
8 |
Correct |
49 ms |
8652 KB |
Output is correct |
9 |
Correct |
45 ms |
8652 KB |
Output is correct |
10 |
Correct |
46 ms |
8648 KB |
Output is correct |
11 |
Correct |
45 ms |
8652 KB |
Output is correct |
12 |
Correct |
48 ms |
8652 KB |
Output is correct |
13 |
Correct |
45 ms |
8652 KB |
Output is correct |
14 |
Correct |
46 ms |
8660 KB |
Output is correct |
15 |
Correct |
45 ms |
8660 KB |
Output is correct |
16 |
Correct |
10 ms |
6944 KB |
Output is correct |
17 |
Correct |
14 ms |
7052 KB |
Output is correct |
18 |
Correct |
11 ms |
7028 KB |
Output is correct |
19 |
Correct |
24 ms |
7632 KB |
Output is correct |
20 |
Correct |
38 ms |
8188 KB |
Output is correct |
21 |
Correct |
48 ms |
8916 KB |
Output is correct |
22 |
Correct |
48 ms |
8892 KB |
Output is correct |
23 |
Correct |
47 ms |
8904 KB |
Output is correct |
24 |
Correct |
47 ms |
8908 KB |
Output is correct |
25 |
Correct |
47 ms |
8976 KB |
Output is correct |
26 |
Correct |
48 ms |
8652 KB |
Output is correct |
27 |
Correct |
47 ms |
8908 KB |
Output is correct |
28 |
Correct |
47 ms |
8656 KB |
Output is correct |
29 |
Correct |
49 ms |
8652 KB |
Output is correct |
30 |
Correct |
46 ms |
8812 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
10 ms |
6868 KB |
Output is correct |
2 |
Correct |
11 ms |
6868 KB |
Output is correct |
3 |
Correct |
11 ms |
7124 KB |
Output is correct |
4 |
Correct |
23 ms |
7636 KB |
Output is correct |
5 |
Correct |
33 ms |
8136 KB |
Output is correct |
6 |
Correct |
45 ms |
8572 KB |
Output is correct |
7 |
Correct |
45 ms |
8732 KB |
Output is correct |
8 |
Correct |
49 ms |
8652 KB |
Output is correct |
9 |
Correct |
45 ms |
8652 KB |
Output is correct |
10 |
Correct |
46 ms |
8648 KB |
Output is correct |
11 |
Correct |
45 ms |
8652 KB |
Output is correct |
12 |
Correct |
48 ms |
8652 KB |
Output is correct |
13 |
Correct |
45 ms |
8652 KB |
Output is correct |
14 |
Correct |
46 ms |
8660 KB |
Output is correct |
15 |
Correct |
45 ms |
8660 KB |
Output is correct |
16 |
Correct |
10 ms |
6944 KB |
Output is correct |
17 |
Correct |
14 ms |
7052 KB |
Output is correct |
18 |
Correct |
11 ms |
7028 KB |
Output is correct |
19 |
Correct |
24 ms |
7632 KB |
Output is correct |
20 |
Correct |
38 ms |
8188 KB |
Output is correct |
21 |
Correct |
48 ms |
8916 KB |
Output is correct |
22 |
Correct |
48 ms |
8892 KB |
Output is correct |
23 |
Correct |
47 ms |
8904 KB |
Output is correct |
24 |
Correct |
47 ms |
8908 KB |
Output is correct |
25 |
Correct |
47 ms |
8976 KB |
Output is correct |
26 |
Correct |
48 ms |
8652 KB |
Output is correct |
27 |
Correct |
47 ms |
8908 KB |
Output is correct |
28 |
Correct |
47 ms |
8656 KB |
Output is correct |
29 |
Correct |
49 ms |
8652 KB |
Output is correct |
30 |
Correct |
46 ms |
8812 KB |
Output is correct |
31 |
Correct |
10 ms |
6864 KB |
Output is correct |
32 |
Correct |
10 ms |
6868 KB |
Output is correct |
33 |
Correct |
10 ms |
6864 KB |
Output is correct |
34 |
Correct |
11 ms |
7124 KB |
Output is correct |
35 |
Correct |
14 ms |
7044 KB |
Output is correct |
36 |
Correct |
12 ms |
6976 KB |
Output is correct |
37 |
Correct |
23 ms |
7380 KB |
Output is correct |
38 |
Correct |
17 ms |
7380 KB |
Output is correct |
39 |
Correct |
23 ms |
7636 KB |
Output is correct |
40 |
Correct |
37 ms |
8148 KB |
Output is correct |
41 |
Correct |
51 ms |
8916 KB |
Output is correct |
42 |
Correct |
49 ms |
8912 KB |
Output is correct |
43 |
Correct |
49 ms |
8752 KB |
Output is correct |
44 |
Correct |
51 ms |
8904 KB |
Output is correct |
45 |
Correct |
55 ms |
8820 KB |
Output is correct |
46 |
Correct |
50 ms |
8904 KB |
Output is correct |
47 |
Correct |
51 ms |
8904 KB |
Output is correct |
48 |
Correct |
50 ms |
8908 KB |
Output is correct |
49 |
Correct |
50 ms |
8908 KB |
Output is correct |
50 |
Correct |
49 ms |
8908 KB |
Output is correct |
51 |
Correct |
49 ms |
8916 KB |
Output is correct |
52 |
Correct |
50 ms |
8772 KB |
Output is correct |
53 |
Correct |
51 ms |
8768 KB |
Output is correct |
54 |
Correct |
51 ms |
8900 KB |
Output is correct |
55 |
Correct |
48 ms |
8916 KB |
Output is correct |
56 |
Correct |
50 ms |
8904 KB |
Output is correct |
57 |
Correct |
48 ms |
9248 KB |
Output is correct |
58 |
Correct |
50 ms |
9160 KB |
Output is correct |
59 |
Correct |
48 ms |
9160 KB |
Output is correct |
60 |
Correct |
49 ms |
9184 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
10 ms |
6864 KB |
Output is correct |
2 |
Correct |
10 ms |
6868 KB |
Output is correct |
3 |
Correct |
10 ms |
6904 KB |
Output is correct |
4 |
Correct |
11 ms |
6896 KB |
Output is correct |
5 |
Correct |
10 ms |
6868 KB |
Output is correct |
6 |
Correct |
10 ms |
7116 KB |
Output is correct |
7 |
Correct |
10 ms |
6868 KB |
Output is correct |
8 |
Correct |
10 ms |
7056 KB |
Output is correct |
9 |
Correct |
11 ms |
6864 KB |
Output is correct |
10 |
Correct |
10 ms |
6868 KB |
Output is correct |
11 |
Correct |
10 ms |
6868 KB |
Output is correct |
12 |
Correct |
11 ms |
6868 KB |
Output is correct |
13 |
Correct |
11 ms |
7124 KB |
Output is correct |
14 |
Correct |
23 ms |
7636 KB |
Output is correct |
15 |
Correct |
33 ms |
8136 KB |
Output is correct |
16 |
Correct |
45 ms |
8572 KB |
Output is correct |
17 |
Correct |
45 ms |
8732 KB |
Output is correct |
18 |
Correct |
49 ms |
8652 KB |
Output is correct |
19 |
Correct |
45 ms |
8652 KB |
Output is correct |
20 |
Correct |
46 ms |
8648 KB |
Output is correct |
21 |
Correct |
45 ms |
8652 KB |
Output is correct |
22 |
Correct |
48 ms |
8652 KB |
Output is correct |
23 |
Correct |
45 ms |
8652 KB |
Output is correct |
24 |
Correct |
46 ms |
8660 KB |
Output is correct |
25 |
Correct |
45 ms |
8660 KB |
Output is correct |
26 |
Correct |
10 ms |
6944 KB |
Output is correct |
27 |
Correct |
14 ms |
7052 KB |
Output is correct |
28 |
Correct |
11 ms |
7028 KB |
Output is correct |
29 |
Correct |
24 ms |
7632 KB |
Output is correct |
30 |
Correct |
38 ms |
8188 KB |
Output is correct |
31 |
Correct |
48 ms |
8916 KB |
Output is correct |
32 |
Correct |
48 ms |
8892 KB |
Output is correct |
33 |
Correct |
47 ms |
8904 KB |
Output is correct |
34 |
Correct |
47 ms |
8908 KB |
Output is correct |
35 |
Correct |
47 ms |
8976 KB |
Output is correct |
36 |
Correct |
48 ms |
8652 KB |
Output is correct |
37 |
Correct |
47 ms |
8908 KB |
Output is correct |
38 |
Correct |
47 ms |
8656 KB |
Output is correct |
39 |
Correct |
49 ms |
8652 KB |
Output is correct |
40 |
Correct |
46 ms |
8812 KB |
Output is correct |
41 |
Correct |
10 ms |
6864 KB |
Output is correct |
42 |
Correct |
10 ms |
6868 KB |
Output is correct |
43 |
Correct |
10 ms |
6864 KB |
Output is correct |
44 |
Correct |
11 ms |
7124 KB |
Output is correct |
45 |
Correct |
14 ms |
7044 KB |
Output is correct |
46 |
Correct |
12 ms |
6976 KB |
Output is correct |
47 |
Correct |
23 ms |
7380 KB |
Output is correct |
48 |
Correct |
17 ms |
7380 KB |
Output is correct |
49 |
Correct |
23 ms |
7636 KB |
Output is correct |
50 |
Correct |
37 ms |
8148 KB |
Output is correct |
51 |
Correct |
51 ms |
8916 KB |
Output is correct |
52 |
Correct |
49 ms |
8912 KB |
Output is correct |
53 |
Correct |
49 ms |
8752 KB |
Output is correct |
54 |
Correct |
51 ms |
8904 KB |
Output is correct |
55 |
Correct |
55 ms |
8820 KB |
Output is correct |
56 |
Correct |
50 ms |
8904 KB |
Output is correct |
57 |
Correct |
51 ms |
8904 KB |
Output is correct |
58 |
Correct |
50 ms |
8908 KB |
Output is correct |
59 |
Correct |
50 ms |
8908 KB |
Output is correct |
60 |
Correct |
49 ms |
8908 KB |
Output is correct |
61 |
Correct |
49 ms |
8916 KB |
Output is correct |
62 |
Correct |
50 ms |
8772 KB |
Output is correct |
63 |
Correct |
51 ms |
8768 KB |
Output is correct |
64 |
Correct |
51 ms |
8900 KB |
Output is correct |
65 |
Correct |
48 ms |
8916 KB |
Output is correct |
66 |
Correct |
50 ms |
8904 KB |
Output is correct |
67 |
Correct |
48 ms |
9248 KB |
Output is correct |
68 |
Correct |
50 ms |
9160 KB |
Output is correct |
69 |
Correct |
48 ms |
9160 KB |
Output is correct |
70 |
Correct |
49 ms |
9184 KB |
Output is correct |
71 |
Correct |
17 ms |
7380 KB |
Output is correct |
72 |
Correct |
18 ms |
7376 KB |
Output is correct |
73 |
Correct |
18 ms |
7380 KB |
Output is correct |
74 |
Correct |
17 ms |
7376 KB |
Output is correct |
75 |
Correct |
17 ms |
7380 KB |
Output is correct |
76 |
Correct |
26 ms |
7772 KB |
Output is correct |
77 |
Correct |
24 ms |
7788 KB |
Output is correct |
78 |
Correct |
24 ms |
7888 KB |
Output is correct |
79 |
Correct |
24 ms |
7688 KB |
Output is correct |
80 |
Correct |
24 ms |
7804 KB |
Output is correct |
81 |
Correct |
38 ms |
8660 KB |
Output is correct |
82 |
Correct |
42 ms |
8648 KB |
Output is correct |
83 |
Correct |
38 ms |
8648 KB |
Output is correct |
84 |
Correct |
39 ms |
8652 KB |
Output is correct |
85 |
Correct |
38 ms |
8652 KB |
Output is correct |
86 |
Correct |
66 ms |
8884 KB |
Output is correct |
87 |
Correct |
46 ms |
8808 KB |
Output is correct |
88 |
Correct |
41 ms |
8652 KB |
Output is correct |
89 |
Correct |
41 ms |
8652 KB |
Output is correct |
90 |
Correct |
43 ms |
8652 KB |
Output is correct |
91 |
Correct |
59 ms |
11208 KB |
Output is correct |
92 |
Correct |
64 ms |
10976 KB |
Output is correct |
93 |
Correct |
61 ms |
10980 KB |
Output is correct |
94 |
Correct |
66 ms |
11200 KB |
Output is correct |
95 |
Correct |
63 ms |
11132 KB |
Output is correct |
96 |
Correct |
86 ms |
13332 KB |
Output is correct |
97 |
Correct |
74 ms |
13200 KB |
Output is correct |
98 |
Correct |
64 ms |
13204 KB |
Output is correct |
99 |
Correct |
63 ms |
13408 KB |
Output is correct |
100 |
Correct |
70 ms |
13272 KB |
Output is correct |
101 |
Correct |
72 ms |
13416 KB |
Output is correct |
102 |
Correct |
69 ms |
13244 KB |
Output is correct |
103 |
Correct |
68 ms |
13296 KB |
Output is correct |
104 |
Correct |
69 ms |
13392 KB |
Output is correct |
105 |
Correct |
64 ms |
13244 KB |
Output is correct |
106 |
Correct |
79 ms |
14348 KB |
Output is correct |
107 |
Correct |
70 ms |
14252 KB |
Output is correct |
108 |
Correct |
63 ms |
14268 KB |
Output is correct |
109 |
Correct |
62 ms |
14268 KB |
Output is correct |
110 |
Correct |
63 ms |
14268 KB |
Output is correct |
111 |
Correct |
62 ms |
14236 KB |
Output is correct |
112 |
Correct |
65 ms |
14156 KB |
Output is correct |
113 |
Correct |
67 ms |
14368 KB |
Output is correct |
114 |
Correct |
63 ms |
14188 KB |
Output is correct |
115 |
Correct |
64 ms |
14208 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
10 ms |
6864 KB |
Output is correct |
2 |
Correct |
10 ms |
6868 KB |
Output is correct |
3 |
Correct |
10 ms |
6904 KB |
Output is correct |
4 |
Correct |
11 ms |
6896 KB |
Output is correct |
5 |
Correct |
10 ms |
6868 KB |
Output is correct |
6 |
Correct |
10 ms |
7116 KB |
Output is correct |
7 |
Correct |
10 ms |
6868 KB |
Output is correct |
8 |
Correct |
10 ms |
7056 KB |
Output is correct |
9 |
Correct |
11 ms |
6864 KB |
Output is correct |
10 |
Correct |
10 ms |
6868 KB |
Output is correct |
11 |
Correct |
10 ms |
6868 KB |
Output is correct |
12 |
Correct |
11 ms |
6868 KB |
Output is correct |
13 |
Correct |
11 ms |
7124 KB |
Output is correct |
14 |
Correct |
23 ms |
7636 KB |
Output is correct |
15 |
Correct |
33 ms |
8136 KB |
Output is correct |
16 |
Correct |
45 ms |
8572 KB |
Output is correct |
17 |
Correct |
45 ms |
8732 KB |
Output is correct |
18 |
Correct |
49 ms |
8652 KB |
Output is correct |
19 |
Correct |
45 ms |
8652 KB |
Output is correct |
20 |
Correct |
46 ms |
8648 KB |
Output is correct |
21 |
Correct |
45 ms |
8652 KB |
Output is correct |
22 |
Correct |
48 ms |
8652 KB |
Output is correct |
23 |
Correct |
45 ms |
8652 KB |
Output is correct |
24 |
Correct |
46 ms |
8660 KB |
Output is correct |
25 |
Correct |
45 ms |
8660 KB |
Output is correct |
26 |
Correct |
10 ms |
6944 KB |
Output is correct |
27 |
Correct |
14 ms |
7052 KB |
Output is correct |
28 |
Correct |
11 ms |
7028 KB |
Output is correct |
29 |
Correct |
24 ms |
7632 KB |
Output is correct |
30 |
Correct |
38 ms |
8188 KB |
Output is correct |
31 |
Correct |
48 ms |
8916 KB |
Output is correct |
32 |
Correct |
48 ms |
8892 KB |
Output is correct |
33 |
Correct |
47 ms |
8904 KB |
Output is correct |
34 |
Correct |
47 ms |
8908 KB |
Output is correct |
35 |
Correct |
47 ms |
8976 KB |
Output is correct |
36 |
Correct |
48 ms |
8652 KB |
Output is correct |
37 |
Correct |
47 ms |
8908 KB |
Output is correct |
38 |
Correct |
47 ms |
8656 KB |
Output is correct |
39 |
Correct |
49 ms |
8652 KB |
Output is correct |
40 |
Correct |
46 ms |
8812 KB |
Output is correct |
41 |
Correct |
10 ms |
6864 KB |
Output is correct |
42 |
Correct |
10 ms |
6868 KB |
Output is correct |
43 |
Correct |
10 ms |
6864 KB |
Output is correct |
44 |
Correct |
11 ms |
7124 KB |
Output is correct |
45 |
Correct |
14 ms |
7044 KB |
Output is correct |
46 |
Correct |
12 ms |
6976 KB |
Output is correct |
47 |
Correct |
23 ms |
7380 KB |
Output is correct |
48 |
Correct |
17 ms |
7380 KB |
Output is correct |
49 |
Correct |
23 ms |
7636 KB |
Output is correct |
50 |
Correct |
37 ms |
8148 KB |
Output is correct |
51 |
Correct |
51 ms |
8916 KB |
Output is correct |
52 |
Correct |
49 ms |
8912 KB |
Output is correct |
53 |
Correct |
49 ms |
8752 KB |
Output is correct |
54 |
Correct |
51 ms |
8904 KB |
Output is correct |
55 |
Correct |
55 ms |
8820 KB |
Output is correct |
56 |
Correct |
50 ms |
8904 KB |
Output is correct |
57 |
Correct |
51 ms |
8904 KB |
Output is correct |
58 |
Correct |
50 ms |
8908 KB |
Output is correct |
59 |
Correct |
50 ms |
8908 KB |
Output is correct |
60 |
Correct |
49 ms |
8908 KB |
Output is correct |
61 |
Correct |
49 ms |
8916 KB |
Output is correct |
62 |
Correct |
50 ms |
8772 KB |
Output is correct |
63 |
Correct |
51 ms |
8768 KB |
Output is correct |
64 |
Correct |
51 ms |
8900 KB |
Output is correct |
65 |
Correct |
48 ms |
8916 KB |
Output is correct |
66 |
Correct |
50 ms |
8904 KB |
Output is correct |
67 |
Correct |
48 ms |
9248 KB |
Output is correct |
68 |
Correct |
50 ms |
9160 KB |
Output is correct |
69 |
Correct |
48 ms |
9160 KB |
Output is correct |
70 |
Correct |
49 ms |
9184 KB |
Output is correct |
71 |
Correct |
17 ms |
7380 KB |
Output is correct |
72 |
Correct |
18 ms |
7376 KB |
Output is correct |
73 |
Correct |
18 ms |
7380 KB |
Output is correct |
74 |
Correct |
17 ms |
7376 KB |
Output is correct |
75 |
Correct |
17 ms |
7380 KB |
Output is correct |
76 |
Correct |
26 ms |
7772 KB |
Output is correct |
77 |
Correct |
24 ms |
7788 KB |
Output is correct |
78 |
Correct |
24 ms |
7888 KB |
Output is correct |
79 |
Correct |
24 ms |
7688 KB |
Output is correct |
80 |
Correct |
24 ms |
7804 KB |
Output is correct |
81 |
Correct |
38 ms |
8660 KB |
Output is correct |
82 |
Correct |
42 ms |
8648 KB |
Output is correct |
83 |
Correct |
38 ms |
8648 KB |
Output is correct |
84 |
Correct |
39 ms |
8652 KB |
Output is correct |
85 |
Correct |
38 ms |
8652 KB |
Output is correct |
86 |
Correct |
66 ms |
8884 KB |
Output is correct |
87 |
Correct |
46 ms |
8808 KB |
Output is correct |
88 |
Correct |
41 ms |
8652 KB |
Output is correct |
89 |
Correct |
41 ms |
8652 KB |
Output is correct |
90 |
Correct |
43 ms |
8652 KB |
Output is correct |
91 |
Correct |
59 ms |
11208 KB |
Output is correct |
92 |
Correct |
64 ms |
10976 KB |
Output is correct |
93 |
Correct |
61 ms |
10980 KB |
Output is correct |
94 |
Correct |
66 ms |
11200 KB |
Output is correct |
95 |
Correct |
63 ms |
11132 KB |
Output is correct |
96 |
Correct |
86 ms |
13332 KB |
Output is correct |
97 |
Correct |
74 ms |
13200 KB |
Output is correct |
98 |
Correct |
64 ms |
13204 KB |
Output is correct |
99 |
Correct |
63 ms |
13408 KB |
Output is correct |
100 |
Correct |
70 ms |
13272 KB |
Output is correct |
101 |
Correct |
72 ms |
13416 KB |
Output is correct |
102 |
Correct |
69 ms |
13244 KB |
Output is correct |
103 |
Correct |
68 ms |
13296 KB |
Output is correct |
104 |
Correct |
69 ms |
13392 KB |
Output is correct |
105 |
Correct |
64 ms |
13244 KB |
Output is correct |
106 |
Correct |
79 ms |
14348 KB |
Output is correct |
107 |
Correct |
70 ms |
14252 KB |
Output is correct |
108 |
Correct |
63 ms |
14268 KB |
Output is correct |
109 |
Correct |
62 ms |
14268 KB |
Output is correct |
110 |
Correct |
63 ms |
14268 KB |
Output is correct |
111 |
Correct |
62 ms |
14236 KB |
Output is correct |
112 |
Correct |
65 ms |
14156 KB |
Output is correct |
113 |
Correct |
67 ms |
14368 KB |
Output is correct |
114 |
Correct |
63 ms |
14188 KB |
Output is correct |
115 |
Correct |
64 ms |
14208 KB |
Output is correct |
116 |
Correct |
1284 ms |
10348 KB |
Output is correct |
117 |
Correct |
1327 ms |
10352 KB |
Output is correct |
118 |
Correct |
1612 ms |
10956 KB |
Output is correct |
119 |
Correct |
1650 ms |
11016 KB |
Output is correct |
120 |
Correct |
1654 ms |
11012 KB |
Output is correct |
121 |
Correct |
2147 ms |
11412 KB |
Output is correct |
122 |
Correct |
2254 ms |
11488 KB |
Output is correct |
123 |
Correct |
4627 ms |
12244 KB |
Output is correct |
124 |
Correct |
4816 ms |
12436 KB |
Output is correct |
125 |
Correct |
4918 ms |
12600 KB |
Output is correct |
126 |
Execution timed out |
7068 ms |
12448 KB |
Time limit exceeded |
127 |
Halted |
0 ms |
0 KB |
- |