#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define sz(a) (int)(a.size())
#define all(a) a.begin(),a.end()
#define lb lower_bound
#define ub upper_bound
#define owo ios_base::sync_with_stdio(0);cin.tie(0);
#define debug(...) fprintf(stderr, __VA_ARGS__),fflush(stderr)
#define time__(d) for(long blockTime = 0; (blockTime == 0 ? (blockTime=clock()) != 0 : false);\
debug("%s time : %.4fs\n", d, (double)(clock() - blockTime) / CLOCKS_PER_SEC))
//typedef long long int ll;
typedef long double ld;
typedef long long int ll;
typedef pair<int,int> pii;
typedef vector<vector<int>> vii;
const int MAXN = 3e5+5,blk = 547;
int a[MAXN],cnt[MAXN],freq[MAXN],smol[MAXN];
vector<int>large;
struct que{
int l,r,id;
que(){}
que(int _l,int _r,int _id):l(_l),r(_r),id(_id){}
bool operator<(const que &q){
if((l+blk-1)/blk &1)return make_pair((l+blk-1)/blk,r) < make_pair((q.l+blk-1)/blk,q.r);
return make_pair((l+blk-1)/blk,-r) < make_pair((q.l+blk-1)/blk,-q.r);
}
};
void add(int x,int c){
if(smol[x])freq[cnt[x]]--;
cnt[x]+=c;
if(smol[x])freq[cnt[x]]++;
}
vector<ll> get(){
vector<ll>v,u;
for(int x:large){
if(!cnt[x])continue;
freq[cnt[x]]++;
if(cnt[x]>blk)u.pb(cnt[x]);
}
for(int i=1;i<=blk;i++){
if(freq[i])v.pb(i);
}
sort(all(u));
for(int i=0;i<sz(u);i++){
int j = i;
while(j+1<sz(u) && u[j] == u[j+1])j++;
i = j;
v.pb(u[i]);
}
return v;
}
ll cal(ll n){
vector<ll>v = get();
int t = sz(v);
ll T = 0;
for(auto x:v)T+=freq[x];
vector<int>in(t,0);
//ans = 1/2(T*n*n + n - sum of squares)
//for(int x:v)cout<<x<<" ";cout<<'\n';
//for(int x:v)cout<<freq[x]<<" ";cout<<'\n';
ll res = 0,cur = 0;
for(int i=1;i<t;i++){
in[i] = in[i-1]+(freq[v[i]]&1);
in[i]%=2;
}
//S = (cur+v)^2 + (cur+2v)^2 + ... + (cur+xv)^2
// = x*cur*cur - 2cur*v(1+2+...+x) + v^2(1^2+2^2+3^2...x2);
//(n-cur-v)^2 + (n-cur-2v)^2 + ... + (n-cur-xv)^2;
//= x*n*n - 2*n( x*cur + v+2v+3v..+xv) + S
vector<ll>tmp;
for(int i=0;i<t;i++){
ll x = (freq[v[i]]+in[i])/2;
ll y = x*(x+1)/2;
ll z = (x*(x+1)*(2*x+1))/6;
ll S = 0;
S+=x*cur*cur;
S+=2*cur*v[i]*y;
S+=v[i]*v[i]*z;
res-=x*n*n;
res+=2*n*( x*cur + y*v[i]);
res-=2*S;
cur+=x*v[i];
for(int j=0;j<x;j++)tmp.pb(v[i]);
}
for(int i=t-1;i>=0;i--){
ll x = (freq[v[i]]+in[i])/2;
x = freq[v[i]]-x;
ll y = x*(x+1)/2;
ll z = (x*(x+1)*(2*x+1))/6;
ll S = 0;
S+=x*cur*cur;
S+=2*cur*v[i]*y;
S+=v[i]*v[i]*z;
assert(S>=0);
res-=x*n*n;
res+=2*n*( x*cur + y*v[i]);
res-=2*S;
cur+=x*v[i];
}
res+=T*n*n+n;
res+=n*n;
for(int x:large){
if(cnt[x])freq[cnt[x]]--;
}
return res/2;
}
int main()
{
owo
int n,q;
cin>>n>>q;
for(int i=1;i<=n;i++){
cin>>a[i];
cnt[a[i]]++;
}
for(int i=1;i<=n;i++){
if(!cnt[i])continue;
if(cnt[i]<=blk)smol[i] = 1;
else large.pb(i);
cnt[i] = 0;
}
vector<que>qq(q);
for(int i=0;i<q;i++){
int l,r;
cin>>l>>r;
qq[i] = que(l,r,i);
}
sort(all(qq));
vector<ll>ans(q);
int L = 1,R = 0;
for(int i=0;i<q;i++){
int l = qq[i].l;
int r = qq[i].r;
while(L>l){
L--;
add(a[L],1);
}
while(R<r){
R++;
add(a[R],1);
}
while(L<l){
add(a[L],-1);
L++;
}
while(R>r){
add(a[R],-1);
R--;
}
ans[qq[i].id] = cal(r-l+1);
}
for(int i=0;i<q;i++)cout<<ans[i]<<'\n';
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Correct |
0 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
0 ms |
340 KB |
Output is correct |
5 |
Correct |
0 ms |
340 KB |
Output is correct |
6 |
Correct |
0 ms |
340 KB |
Output is correct |
7 |
Correct |
0 ms |
340 KB |
Output is correct |
8 |
Correct |
1 ms |
340 KB |
Output is correct |
9 |
Correct |
0 ms |
340 KB |
Output is correct |
10 |
Correct |
0 ms |
340 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Correct |
0 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
5 ms |
752 KB |
Output is correct |
5 |
Correct |
9 ms |
1108 KB |
Output is correct |
6 |
Correct |
14 ms |
1488 KB |
Output is correct |
7 |
Correct |
13 ms |
1468 KB |
Output is correct |
8 |
Correct |
13 ms |
1492 KB |
Output is correct |
9 |
Correct |
13 ms |
1488 KB |
Output is correct |
10 |
Correct |
14 ms |
1508 KB |
Output is correct |
11 |
Correct |
13 ms |
1532 KB |
Output is correct |
12 |
Correct |
14 ms |
1492 KB |
Output is correct |
13 |
Correct |
14 ms |
1492 KB |
Output is correct |
14 |
Correct |
13 ms |
1432 KB |
Output is correct |
15 |
Correct |
13 ms |
1492 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Correct |
0 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
5 ms |
752 KB |
Output is correct |
5 |
Correct |
9 ms |
1108 KB |
Output is correct |
6 |
Correct |
14 ms |
1488 KB |
Output is correct |
7 |
Correct |
13 ms |
1468 KB |
Output is correct |
8 |
Correct |
13 ms |
1492 KB |
Output is correct |
9 |
Correct |
13 ms |
1488 KB |
Output is correct |
10 |
Correct |
14 ms |
1508 KB |
Output is correct |
11 |
Correct |
13 ms |
1532 KB |
Output is correct |
12 |
Correct |
14 ms |
1492 KB |
Output is correct |
13 |
Correct |
14 ms |
1492 KB |
Output is correct |
14 |
Correct |
13 ms |
1432 KB |
Output is correct |
15 |
Correct |
13 ms |
1492 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 |
340 KB |
Output is correct |
19 |
Correct |
5 ms |
724 KB |
Output is correct |
20 |
Correct |
10 ms |
1084 KB |
Output is correct |
21 |
Correct |
15 ms |
1492 KB |
Output is correct |
22 |
Correct |
15 ms |
1492 KB |
Output is correct |
23 |
Correct |
18 ms |
1560 KB |
Output is correct |
24 |
Correct |
19 ms |
1532 KB |
Output is correct |
25 |
Correct |
15 ms |
1488 KB |
Output is correct |
26 |
Correct |
15 ms |
1492 KB |
Output is correct |
27 |
Correct |
15 ms |
1552 KB |
Output is correct |
28 |
Correct |
14 ms |
1552 KB |
Output is correct |
29 |
Correct |
14 ms |
1528 KB |
Output is correct |
30 |
Correct |
14 ms |
1520 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Correct |
0 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
5 ms |
752 KB |
Output is correct |
5 |
Correct |
9 ms |
1108 KB |
Output is correct |
6 |
Correct |
14 ms |
1488 KB |
Output is correct |
7 |
Correct |
13 ms |
1468 KB |
Output is correct |
8 |
Correct |
13 ms |
1492 KB |
Output is correct |
9 |
Correct |
13 ms |
1488 KB |
Output is correct |
10 |
Correct |
14 ms |
1508 KB |
Output is correct |
11 |
Correct |
13 ms |
1532 KB |
Output is correct |
12 |
Correct |
14 ms |
1492 KB |
Output is correct |
13 |
Correct |
14 ms |
1492 KB |
Output is correct |
14 |
Correct |
13 ms |
1432 KB |
Output is correct |
15 |
Correct |
13 ms |
1492 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 |
340 KB |
Output is correct |
19 |
Correct |
5 ms |
724 KB |
Output is correct |
20 |
Correct |
10 ms |
1084 KB |
Output is correct |
21 |
Correct |
15 ms |
1492 KB |
Output is correct |
22 |
Correct |
15 ms |
1492 KB |
Output is correct |
23 |
Correct |
18 ms |
1560 KB |
Output is correct |
24 |
Correct |
19 ms |
1532 KB |
Output is correct |
25 |
Correct |
15 ms |
1488 KB |
Output is correct |
26 |
Correct |
15 ms |
1492 KB |
Output is correct |
27 |
Correct |
15 ms |
1552 KB |
Output is correct |
28 |
Correct |
14 ms |
1552 KB |
Output is correct |
29 |
Correct |
14 ms |
1528 KB |
Output is correct |
30 |
Correct |
14 ms |
1520 KB |
Output is correct |
31 |
Correct |
0 ms |
340 KB |
Output is correct |
32 |
Correct |
0 ms |
340 KB |
Output is correct |
33 |
Correct |
0 ms |
340 KB |
Output is correct |
34 |
Correct |
1 ms |
340 KB |
Output is correct |
35 |
Correct |
1 ms |
340 KB |
Output is correct |
36 |
Correct |
1 ms |
340 KB |
Output is correct |
37 |
Correct |
3 ms |
468 KB |
Output is correct |
38 |
Correct |
3 ms |
468 KB |
Output is correct |
39 |
Correct |
6 ms |
724 KB |
Output is correct |
40 |
Correct |
11 ms |
1088 KB |
Output is correct |
41 |
Correct |
17 ms |
1528 KB |
Output is correct |
42 |
Correct |
17 ms |
1492 KB |
Output is correct |
43 |
Correct |
17 ms |
1472 KB |
Output is correct |
44 |
Correct |
17 ms |
1492 KB |
Output is correct |
45 |
Correct |
17 ms |
1496 KB |
Output is correct |
46 |
Correct |
17 ms |
1432 KB |
Output is correct |
47 |
Correct |
17 ms |
1492 KB |
Output is correct |
48 |
Correct |
17 ms |
1480 KB |
Output is correct |
49 |
Correct |
18 ms |
1484 KB |
Output is correct |
50 |
Correct |
17 ms |
1532 KB |
Output is correct |
51 |
Correct |
17 ms |
1432 KB |
Output is correct |
52 |
Correct |
17 ms |
1492 KB |
Output is correct |
53 |
Correct |
17 ms |
1492 KB |
Output is correct |
54 |
Correct |
17 ms |
1496 KB |
Output is correct |
55 |
Correct |
18 ms |
1496 KB |
Output is correct |
56 |
Correct |
17 ms |
1508 KB |
Output is correct |
57 |
Correct |
17 ms |
1492 KB |
Output is correct |
58 |
Correct |
17 ms |
1492 KB |
Output is correct |
59 |
Correct |
17 ms |
1556 KB |
Output is correct |
60 |
Correct |
19 ms |
1492 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Correct |
0 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
0 ms |
340 KB |
Output is correct |
5 |
Correct |
0 ms |
340 KB |
Output is correct |
6 |
Correct |
0 ms |
340 KB |
Output is correct |
7 |
Correct |
0 ms |
340 KB |
Output is correct |
8 |
Correct |
1 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 |
1 ms |
340 KB |
Output is correct |
12 |
Correct |
0 ms |
340 KB |
Output is correct |
13 |
Correct |
1 ms |
340 KB |
Output is correct |
14 |
Correct |
5 ms |
752 KB |
Output is correct |
15 |
Correct |
9 ms |
1108 KB |
Output is correct |
16 |
Correct |
14 ms |
1488 KB |
Output is correct |
17 |
Correct |
13 ms |
1468 KB |
Output is correct |
18 |
Correct |
13 ms |
1492 KB |
Output is correct |
19 |
Correct |
13 ms |
1488 KB |
Output is correct |
20 |
Correct |
14 ms |
1508 KB |
Output is correct |
21 |
Correct |
13 ms |
1532 KB |
Output is correct |
22 |
Correct |
14 ms |
1492 KB |
Output is correct |
23 |
Correct |
14 ms |
1492 KB |
Output is correct |
24 |
Correct |
13 ms |
1432 KB |
Output is correct |
25 |
Correct |
13 ms |
1492 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 |
340 KB |
Output is correct |
29 |
Correct |
5 ms |
724 KB |
Output is correct |
30 |
Correct |
10 ms |
1084 KB |
Output is correct |
31 |
Correct |
15 ms |
1492 KB |
Output is correct |
32 |
Correct |
15 ms |
1492 KB |
Output is correct |
33 |
Correct |
18 ms |
1560 KB |
Output is correct |
34 |
Correct |
19 ms |
1532 KB |
Output is correct |
35 |
Correct |
15 ms |
1488 KB |
Output is correct |
36 |
Correct |
15 ms |
1492 KB |
Output is correct |
37 |
Correct |
15 ms |
1552 KB |
Output is correct |
38 |
Correct |
14 ms |
1552 KB |
Output is correct |
39 |
Correct |
14 ms |
1528 KB |
Output is correct |
40 |
Correct |
14 ms |
1520 KB |
Output is correct |
41 |
Correct |
0 ms |
340 KB |
Output is correct |
42 |
Correct |
0 ms |
340 KB |
Output is correct |
43 |
Correct |
0 ms |
340 KB |
Output is correct |
44 |
Correct |
1 ms |
340 KB |
Output is correct |
45 |
Correct |
1 ms |
340 KB |
Output is correct |
46 |
Correct |
1 ms |
340 KB |
Output is correct |
47 |
Correct |
3 ms |
468 KB |
Output is correct |
48 |
Correct |
3 ms |
468 KB |
Output is correct |
49 |
Correct |
6 ms |
724 KB |
Output is correct |
50 |
Correct |
11 ms |
1088 KB |
Output is correct |
51 |
Correct |
17 ms |
1528 KB |
Output is correct |
52 |
Correct |
17 ms |
1492 KB |
Output is correct |
53 |
Correct |
17 ms |
1472 KB |
Output is correct |
54 |
Correct |
17 ms |
1492 KB |
Output is correct |
55 |
Correct |
17 ms |
1496 KB |
Output is correct |
56 |
Correct |
17 ms |
1432 KB |
Output is correct |
57 |
Correct |
17 ms |
1492 KB |
Output is correct |
58 |
Correct |
17 ms |
1480 KB |
Output is correct |
59 |
Correct |
18 ms |
1484 KB |
Output is correct |
60 |
Correct |
17 ms |
1532 KB |
Output is correct |
61 |
Correct |
17 ms |
1432 KB |
Output is correct |
62 |
Correct |
17 ms |
1492 KB |
Output is correct |
63 |
Correct |
17 ms |
1492 KB |
Output is correct |
64 |
Correct |
17 ms |
1496 KB |
Output is correct |
65 |
Correct |
18 ms |
1496 KB |
Output is correct |
66 |
Correct |
17 ms |
1508 KB |
Output is correct |
67 |
Correct |
17 ms |
1492 KB |
Output is correct |
68 |
Correct |
17 ms |
1492 KB |
Output is correct |
69 |
Correct |
17 ms |
1556 KB |
Output is correct |
70 |
Correct |
19 ms |
1492 KB |
Output is correct |
71 |
Correct |
3 ms |
468 KB |
Output is correct |
72 |
Correct |
3 ms |
468 KB |
Output is correct |
73 |
Correct |
3 ms |
468 KB |
Output is correct |
74 |
Correct |
4 ms |
468 KB |
Output is correct |
75 |
Correct |
3 ms |
468 KB |
Output is correct |
76 |
Correct |
6 ms |
724 KB |
Output is correct |
77 |
Correct |
6 ms |
724 KB |
Output is correct |
78 |
Correct |
6 ms |
712 KB |
Output is correct |
79 |
Correct |
7 ms |
724 KB |
Output is correct |
80 |
Correct |
6 ms |
724 KB |
Output is correct |
81 |
Correct |
15 ms |
1236 KB |
Output is correct |
82 |
Correct |
11 ms |
1236 KB |
Output is correct |
83 |
Correct |
12 ms |
1440 KB |
Output is correct |
84 |
Correct |
16 ms |
1240 KB |
Output is correct |
85 |
Correct |
13 ms |
1236 KB |
Output is correct |
86 |
Correct |
13 ms |
1412 KB |
Output is correct |
87 |
Correct |
13 ms |
1432 KB |
Output is correct |
88 |
Correct |
13 ms |
1412 KB |
Output is correct |
89 |
Correct |
13 ms |
1404 KB |
Output is correct |
90 |
Correct |
13 ms |
1468 KB |
Output is correct |
91 |
Correct |
20 ms |
2904 KB |
Output is correct |
92 |
Correct |
20 ms |
2860 KB |
Output is correct |
93 |
Correct |
19 ms |
2924 KB |
Output is correct |
94 |
Correct |
19 ms |
2936 KB |
Output is correct |
95 |
Correct |
25 ms |
2944 KB |
Output is correct |
96 |
Correct |
25 ms |
4200 KB |
Output is correct |
97 |
Correct |
23 ms |
4236 KB |
Output is correct |
98 |
Correct |
24 ms |
4180 KB |
Output is correct |
99 |
Correct |
24 ms |
4180 KB |
Output is correct |
100 |
Correct |
24 ms |
4164 KB |
Output is correct |
101 |
Correct |
28 ms |
4156 KB |
Output is correct |
102 |
Correct |
23 ms |
4228 KB |
Output is correct |
103 |
Correct |
23 ms |
4124 KB |
Output is correct |
104 |
Correct |
23 ms |
4172 KB |
Output is correct |
105 |
Correct |
27 ms |
4220 KB |
Output is correct |
106 |
Correct |
24 ms |
4556 KB |
Output is correct |
107 |
Correct |
23 ms |
4628 KB |
Output is correct |
108 |
Correct |
24 ms |
4628 KB |
Output is correct |
109 |
Correct |
24 ms |
4564 KB |
Output is correct |
110 |
Correct |
24 ms |
4564 KB |
Output is correct |
111 |
Correct |
24 ms |
4544 KB |
Output is correct |
112 |
Correct |
23 ms |
4692 KB |
Output is correct |
113 |
Correct |
25 ms |
4500 KB |
Output is correct |
114 |
Correct |
23 ms |
4608 KB |
Output is correct |
115 |
Correct |
23 ms |
4640 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Correct |
0 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
0 ms |
340 KB |
Output is correct |
5 |
Correct |
0 ms |
340 KB |
Output is correct |
6 |
Correct |
0 ms |
340 KB |
Output is correct |
7 |
Correct |
0 ms |
340 KB |
Output is correct |
8 |
Correct |
1 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 |
1 ms |
340 KB |
Output is correct |
12 |
Correct |
0 ms |
340 KB |
Output is correct |
13 |
Correct |
1 ms |
340 KB |
Output is correct |
14 |
Correct |
5 ms |
752 KB |
Output is correct |
15 |
Correct |
9 ms |
1108 KB |
Output is correct |
16 |
Correct |
14 ms |
1488 KB |
Output is correct |
17 |
Correct |
13 ms |
1468 KB |
Output is correct |
18 |
Correct |
13 ms |
1492 KB |
Output is correct |
19 |
Correct |
13 ms |
1488 KB |
Output is correct |
20 |
Correct |
14 ms |
1508 KB |
Output is correct |
21 |
Correct |
13 ms |
1532 KB |
Output is correct |
22 |
Correct |
14 ms |
1492 KB |
Output is correct |
23 |
Correct |
14 ms |
1492 KB |
Output is correct |
24 |
Correct |
13 ms |
1432 KB |
Output is correct |
25 |
Correct |
13 ms |
1492 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 |
340 KB |
Output is correct |
29 |
Correct |
5 ms |
724 KB |
Output is correct |
30 |
Correct |
10 ms |
1084 KB |
Output is correct |
31 |
Correct |
15 ms |
1492 KB |
Output is correct |
32 |
Correct |
15 ms |
1492 KB |
Output is correct |
33 |
Correct |
18 ms |
1560 KB |
Output is correct |
34 |
Correct |
19 ms |
1532 KB |
Output is correct |
35 |
Correct |
15 ms |
1488 KB |
Output is correct |
36 |
Correct |
15 ms |
1492 KB |
Output is correct |
37 |
Correct |
15 ms |
1552 KB |
Output is correct |
38 |
Correct |
14 ms |
1552 KB |
Output is correct |
39 |
Correct |
14 ms |
1528 KB |
Output is correct |
40 |
Correct |
14 ms |
1520 KB |
Output is correct |
41 |
Correct |
0 ms |
340 KB |
Output is correct |
42 |
Correct |
0 ms |
340 KB |
Output is correct |
43 |
Correct |
0 ms |
340 KB |
Output is correct |
44 |
Correct |
1 ms |
340 KB |
Output is correct |
45 |
Correct |
1 ms |
340 KB |
Output is correct |
46 |
Correct |
1 ms |
340 KB |
Output is correct |
47 |
Correct |
3 ms |
468 KB |
Output is correct |
48 |
Correct |
3 ms |
468 KB |
Output is correct |
49 |
Correct |
6 ms |
724 KB |
Output is correct |
50 |
Correct |
11 ms |
1088 KB |
Output is correct |
51 |
Correct |
17 ms |
1528 KB |
Output is correct |
52 |
Correct |
17 ms |
1492 KB |
Output is correct |
53 |
Correct |
17 ms |
1472 KB |
Output is correct |
54 |
Correct |
17 ms |
1492 KB |
Output is correct |
55 |
Correct |
17 ms |
1496 KB |
Output is correct |
56 |
Correct |
17 ms |
1432 KB |
Output is correct |
57 |
Correct |
17 ms |
1492 KB |
Output is correct |
58 |
Correct |
17 ms |
1480 KB |
Output is correct |
59 |
Correct |
18 ms |
1484 KB |
Output is correct |
60 |
Correct |
17 ms |
1532 KB |
Output is correct |
61 |
Correct |
17 ms |
1432 KB |
Output is correct |
62 |
Correct |
17 ms |
1492 KB |
Output is correct |
63 |
Correct |
17 ms |
1492 KB |
Output is correct |
64 |
Correct |
17 ms |
1496 KB |
Output is correct |
65 |
Correct |
18 ms |
1496 KB |
Output is correct |
66 |
Correct |
17 ms |
1508 KB |
Output is correct |
67 |
Correct |
17 ms |
1492 KB |
Output is correct |
68 |
Correct |
17 ms |
1492 KB |
Output is correct |
69 |
Correct |
17 ms |
1556 KB |
Output is correct |
70 |
Correct |
19 ms |
1492 KB |
Output is correct |
71 |
Correct |
3 ms |
468 KB |
Output is correct |
72 |
Correct |
3 ms |
468 KB |
Output is correct |
73 |
Correct |
3 ms |
468 KB |
Output is correct |
74 |
Correct |
4 ms |
468 KB |
Output is correct |
75 |
Correct |
3 ms |
468 KB |
Output is correct |
76 |
Correct |
6 ms |
724 KB |
Output is correct |
77 |
Correct |
6 ms |
724 KB |
Output is correct |
78 |
Correct |
6 ms |
712 KB |
Output is correct |
79 |
Correct |
7 ms |
724 KB |
Output is correct |
80 |
Correct |
6 ms |
724 KB |
Output is correct |
81 |
Correct |
15 ms |
1236 KB |
Output is correct |
82 |
Correct |
11 ms |
1236 KB |
Output is correct |
83 |
Correct |
12 ms |
1440 KB |
Output is correct |
84 |
Correct |
16 ms |
1240 KB |
Output is correct |
85 |
Correct |
13 ms |
1236 KB |
Output is correct |
86 |
Correct |
13 ms |
1412 KB |
Output is correct |
87 |
Correct |
13 ms |
1432 KB |
Output is correct |
88 |
Correct |
13 ms |
1412 KB |
Output is correct |
89 |
Correct |
13 ms |
1404 KB |
Output is correct |
90 |
Correct |
13 ms |
1468 KB |
Output is correct |
91 |
Correct |
20 ms |
2904 KB |
Output is correct |
92 |
Correct |
20 ms |
2860 KB |
Output is correct |
93 |
Correct |
19 ms |
2924 KB |
Output is correct |
94 |
Correct |
19 ms |
2936 KB |
Output is correct |
95 |
Correct |
25 ms |
2944 KB |
Output is correct |
96 |
Correct |
25 ms |
4200 KB |
Output is correct |
97 |
Correct |
23 ms |
4236 KB |
Output is correct |
98 |
Correct |
24 ms |
4180 KB |
Output is correct |
99 |
Correct |
24 ms |
4180 KB |
Output is correct |
100 |
Correct |
24 ms |
4164 KB |
Output is correct |
101 |
Correct |
28 ms |
4156 KB |
Output is correct |
102 |
Correct |
23 ms |
4228 KB |
Output is correct |
103 |
Correct |
23 ms |
4124 KB |
Output is correct |
104 |
Correct |
23 ms |
4172 KB |
Output is correct |
105 |
Correct |
27 ms |
4220 KB |
Output is correct |
106 |
Correct |
24 ms |
4556 KB |
Output is correct |
107 |
Correct |
23 ms |
4628 KB |
Output is correct |
108 |
Correct |
24 ms |
4628 KB |
Output is correct |
109 |
Correct |
24 ms |
4564 KB |
Output is correct |
110 |
Correct |
24 ms |
4564 KB |
Output is correct |
111 |
Correct |
24 ms |
4544 KB |
Output is correct |
112 |
Correct |
23 ms |
4692 KB |
Output is correct |
113 |
Correct |
25 ms |
4500 KB |
Output is correct |
114 |
Correct |
23 ms |
4608 KB |
Output is correct |
115 |
Correct |
23 ms |
4640 KB |
Output is correct |
116 |
Correct |
132 ms |
1748 KB |
Output is correct |
117 |
Correct |
128 ms |
1764 KB |
Output is correct |
118 |
Correct |
190 ms |
2052 KB |
Output is correct |
119 |
Correct |
217 ms |
2192 KB |
Output is correct |
120 |
Correct |
194 ms |
2060 KB |
Output is correct |
121 |
Correct |
282 ms |
2284 KB |
Output is correct |
122 |
Correct |
304 ms |
2280 KB |
Output is correct |
123 |
Correct |
536 ms |
2800 KB |
Output is correct |
124 |
Correct |
530 ms |
2872 KB |
Output is correct |
125 |
Correct |
699 ms |
2948 KB |
Output is correct |
126 |
Correct |
696 ms |
3100 KB |
Output is correct |
127 |
Correct |
702 ms |
4800 KB |
Output is correct |
128 |
Correct |
714 ms |
4788 KB |
Output is correct |
129 |
Correct |
710 ms |
4828 KB |
Output is correct |
130 |
Correct |
717 ms |
4792 KB |
Output is correct |
131 |
Correct |
867 ms |
4964 KB |
Output is correct |
132 |
Correct |
871 ms |
4960 KB |
Output is correct |
133 |
Correct |
899 ms |
4932 KB |
Output is correct |
134 |
Correct |
857 ms |
5016 KB |
Output is correct |
135 |
Correct |
867 ms |
4940 KB |
Output is correct |
136 |
Correct |
882 ms |
4944 KB |
Output is correct |
137 |
Correct |
864 ms |
4968 KB |
Output is correct |
138 |
Correct |
878 ms |
4948 KB |
Output is correct |
139 |
Correct |
870 ms |
4940 KB |
Output is correct |
140 |
Correct |
878 ms |
4948 KB |
Output is correct |
141 |
Correct |
973 ms |
4996 KB |
Output is correct |
142 |
Correct |
1008 ms |
4984 KB |
Output is correct |
143 |
Correct |
1000 ms |
4992 KB |
Output is correct |
144 |
Correct |
1031 ms |
4988 KB |
Output is correct |
145 |
Correct |
1004 ms |
4992 KB |
Output is correct |
146 |
Correct |
681 ms |
5260 KB |
Output is correct |
147 |
Correct |
653 ms |
5328 KB |
Output is correct |
148 |
Correct |
657 ms |
5320 KB |
Output is correct |
149 |
Correct |
657 ms |
5268 KB |
Output is correct |
150 |
Correct |
657 ms |
5320 KB |
Output is correct |
151 |
Correct |
890 ms |
5512 KB |
Output is correct |
152 |
Correct |
889 ms |
5440 KB |
Output is correct |
153 |
Correct |
891 ms |
5444 KB |
Output is correct |
154 |
Correct |
891 ms |
5432 KB |
Output is correct |
155 |
Correct |
882 ms |
5436 KB |
Output is correct |
156 |
Correct |
3624 ms |
6340 KB |
Output is correct |
157 |
Correct |
3666 ms |
6340 KB |
Output is correct |
158 |
Correct |
3643 ms |
6296 KB |
Output is correct |
159 |
Correct |
3606 ms |
6248 KB |
Output is correct |
160 |
Correct |
3684 ms |
6288 KB |
Output is correct |
161 |
Correct |
2658 ms |
6276 KB |
Output is correct |
162 |
Correct |
2469 ms |
6132 KB |
Output is correct |
163 |
Correct |
2416 ms |
6140 KB |
Output is correct |
164 |
Correct |
2462 ms |
6192 KB |
Output is correct |
165 |
Correct |
2595 ms |
6096 KB |
Output is correct |
166 |
Correct |
920 ms |
5412 KB |
Output is correct |
167 |
Correct |
941 ms |
5484 KB |
Output is correct |
168 |
Correct |
928 ms |
5584 KB |
Output is correct |
169 |
Correct |
928 ms |
5520 KB |
Output is correct |
170 |
Correct |
921 ms |
5500 KB |
Output is correct |
171 |
Correct |
738 ms |
5540 KB |
Output is correct |
172 |
Correct |
733 ms |
5424 KB |
Output is correct |
173 |
Correct |
723 ms |
5424 KB |
Output is correct |
174 |
Correct |
726 ms |
5448 KB |
Output is correct |
175 |
Correct |
737 ms |
5456 KB |
Output is correct |