#include <bits/stdc++.h>
using namespace std;
int L,R;
int a[300010];
long long freq[300010],freq2[300010];
bitset <300010> have;
long long calcans(){
long long ans=0,lps=0,rps=0,s=R-L+1;
for (int i=have._Find_first(); i<300010; i=have._Find_next(i)){
long long cntl,cntr;
int f;
if (lps<=rps){
f=min(freq2[i],(rps-lps)/i+1);
cntl=f+(freq2[i]-f)/2,cntr=(freq2[i]-f+1)/2;
} else {
f=min(freq2[i],(lps-rps)/i+1);
cntl=(freq2[i]-f+1)/2,cntr=f+(freq2[i]-f)/2;
}
ans+=cntl*lps*lps+cntl*(cntl+1)*lps*i+cntl*(cntl+1)/2*(2*cntl+1)/3*i*i;
ans-=s*(lps+i+lps+i*cntl)*cntl/2;
lps+=cntl*i;
long long t=s-rps;
ans+=cntr*t*t-cntr*(cntr-1)*t*i+(cntr)*(cntr-1)/2*(2*cntr-1)/3*i*i;
ans-=s*(t+t-(cntr-1)*i)*cntr/2;
rps+=cntr*i;
}
return s*(s+1)/2-ans;
}
const int BLOCK=800;
bool cmp(pair <pair <int,int>,int> a,pair <pair <int,int>,int> b){
int ax=a.first.first/BLOCK,bx=b.first.first/BLOCK;
if (ax!=bx) return ax<bx;
return a.first.second<b.first.second;
}
int main(){
ios_base::sync_with_stdio(0); cin.tie(0);
int n,q;
cin>>n>>q;
for (int i=1; i<=n; i++) cin>>a[i];
pair <pair <int,int>,int> qu[q+1];
for (int i=1; i<=q; i++){
cin>>qu[i].first.first>>qu[i].first.second;
qu[i].second=i;
}
sort(qu+1,qu+q+1,cmp);
L=1; R=0;
long long op[q+1];
for (int i=1; i<=q; i++){
while (R<qu[i].first.second){
R++;
if (freq[a[R]]){
freq2[freq[a[R]]]--;
if (!freq2[freq[a[R]]]) have[freq[a[R]]]=0;
}
freq[a[R]]++;
if (!freq2[freq[a[R]]]) have[freq[a[R]]]=1;
freq2[freq[a[R]]]++;
}
while (L>qu[i].first.first){
L--;
if (freq[a[L]]){
freq2[freq[a[L]]]--;
if (!freq2[freq[a[L]]]) have[freq[a[L]]]=0;
}
freq[a[L]]++;
if (!freq2[freq[a[L]]]) have[freq[a[L]]]=1;
freq2[freq[a[L]]]++;
}
while (R>qu[i].first.second){
freq2[freq[a[R]]]--;
if (!freq2[freq[a[R]]]) have[freq[a[R]]]=0;
freq[a[R]]--;
if (freq[a[R]]&&!freq2[freq[a[R]]]) have[freq[a[R]]]=1;
freq2[freq[a[R]]]++;
R--;
}
while (L<qu[i].first.first){
freq2[freq[a[L]]]--;
if (!freq2[freq[a[L]]]) have[freq[a[L]]]=0;
freq[a[L]]--;
if (freq[a[L]]&&!freq2[freq[a[L]]]) have[freq[a[L]]]=1;
freq2[freq[a[L]]]++;
L++;
}
op[qu[i].second]=calcans();
}
for (int i=1; i<=q; i++) cout<<op[i]<<'\n';
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
4 ms |
1244 KB |
Output is correct |
5 |
Correct |
8 ms |
2012 KB |
Output is correct |
6 |
Correct |
15 ms |
2768 KB |
Output is correct |
7 |
Correct |
13 ms |
3416 KB |
Output is correct |
8 |
Correct |
15 ms |
2652 KB |
Output is correct |
9 |
Correct |
15 ms |
2712 KB |
Output is correct |
10 |
Correct |
14 ms |
2908 KB |
Output is correct |
11 |
Correct |
13 ms |
2836 KB |
Output is correct |
12 |
Correct |
13 ms |
2652 KB |
Output is correct |
13 |
Correct |
12 ms |
2584 KB |
Output is correct |
14 |
Correct |
13 ms |
2648 KB |
Output is correct |
15 |
Correct |
12 ms |
2652 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
4 ms |
1244 KB |
Output is correct |
5 |
Correct |
8 ms |
2012 KB |
Output is correct |
6 |
Correct |
15 ms |
2768 KB |
Output is correct |
7 |
Correct |
13 ms |
3416 KB |
Output is correct |
8 |
Correct |
15 ms |
2652 KB |
Output is correct |
9 |
Correct |
15 ms |
2712 KB |
Output is correct |
10 |
Correct |
14 ms |
2908 KB |
Output is correct |
11 |
Correct |
13 ms |
2836 KB |
Output is correct |
12 |
Correct |
13 ms |
2652 KB |
Output is correct |
13 |
Correct |
12 ms |
2584 KB |
Output is correct |
14 |
Correct |
13 ms |
2648 KB |
Output is correct |
15 |
Correct |
12 ms |
2652 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
0 ms |
348 KB |
Output is correct |
18 |
Correct |
1 ms |
348 KB |
Output is correct |
19 |
Correct |
5 ms |
1116 KB |
Output is correct |
20 |
Correct |
11 ms |
1884 KB |
Output is correct |
21 |
Correct |
15 ms |
2904 KB |
Output is correct |
22 |
Correct |
14 ms |
2688 KB |
Output is correct |
23 |
Correct |
13 ms |
2648 KB |
Output is correct |
24 |
Correct |
17 ms |
2652 KB |
Output is correct |
25 |
Correct |
13 ms |
2660 KB |
Output is correct |
26 |
Correct |
13 ms |
2480 KB |
Output is correct |
27 |
Correct |
14 ms |
2744 KB |
Output is correct |
28 |
Correct |
14 ms |
2904 KB |
Output is correct |
29 |
Correct |
14 ms |
2540 KB |
Output is correct |
30 |
Correct |
14 ms |
2648 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
4 ms |
1244 KB |
Output is correct |
5 |
Correct |
8 ms |
2012 KB |
Output is correct |
6 |
Correct |
15 ms |
2768 KB |
Output is correct |
7 |
Correct |
13 ms |
3416 KB |
Output is correct |
8 |
Correct |
15 ms |
2652 KB |
Output is correct |
9 |
Correct |
15 ms |
2712 KB |
Output is correct |
10 |
Correct |
14 ms |
2908 KB |
Output is correct |
11 |
Correct |
13 ms |
2836 KB |
Output is correct |
12 |
Correct |
13 ms |
2652 KB |
Output is correct |
13 |
Correct |
12 ms |
2584 KB |
Output is correct |
14 |
Correct |
13 ms |
2648 KB |
Output is correct |
15 |
Correct |
12 ms |
2652 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
0 ms |
348 KB |
Output is correct |
18 |
Correct |
1 ms |
348 KB |
Output is correct |
19 |
Correct |
5 ms |
1116 KB |
Output is correct |
20 |
Correct |
11 ms |
1884 KB |
Output is correct |
21 |
Correct |
15 ms |
2904 KB |
Output is correct |
22 |
Correct |
14 ms |
2688 KB |
Output is correct |
23 |
Correct |
13 ms |
2648 KB |
Output is correct |
24 |
Correct |
17 ms |
2652 KB |
Output is correct |
25 |
Correct |
13 ms |
2660 KB |
Output is correct |
26 |
Correct |
13 ms |
2480 KB |
Output is correct |
27 |
Correct |
14 ms |
2744 KB |
Output is correct |
28 |
Correct |
14 ms |
2904 KB |
Output is correct |
29 |
Correct |
14 ms |
2540 KB |
Output is correct |
30 |
Correct |
14 ms |
2648 KB |
Output is correct |
31 |
Correct |
0 ms |
604 KB |
Output is correct |
32 |
Correct |
0 ms |
348 KB |
Output is correct |
33 |
Correct |
1 ms |
348 KB |
Output is correct |
34 |
Correct |
1 ms |
348 KB |
Output is correct |
35 |
Correct |
1 ms |
348 KB |
Output is correct |
36 |
Correct |
1 ms |
544 KB |
Output is correct |
37 |
Correct |
3 ms |
860 KB |
Output is correct |
38 |
Correct |
3 ms |
860 KB |
Output is correct |
39 |
Correct |
5 ms |
1116 KB |
Output is correct |
40 |
Correct |
12 ms |
2136 KB |
Output is correct |
41 |
Correct |
15 ms |
2652 KB |
Output is correct |
42 |
Correct |
17 ms |
2652 KB |
Output is correct |
43 |
Correct |
15 ms |
2652 KB |
Output is correct |
44 |
Correct |
17 ms |
2620 KB |
Output is correct |
45 |
Correct |
15 ms |
2652 KB |
Output is correct |
46 |
Correct |
17 ms |
2648 KB |
Output is correct |
47 |
Correct |
15 ms |
2652 KB |
Output is correct |
48 |
Correct |
19 ms |
2584 KB |
Output is correct |
49 |
Correct |
15 ms |
2648 KB |
Output is correct |
50 |
Correct |
16 ms |
2648 KB |
Output is correct |
51 |
Correct |
15 ms |
2652 KB |
Output is correct |
52 |
Correct |
16 ms |
2652 KB |
Output is correct |
53 |
Correct |
16 ms |
2592 KB |
Output is correct |
54 |
Correct |
16 ms |
2652 KB |
Output is correct |
55 |
Correct |
15 ms |
2732 KB |
Output is correct |
56 |
Correct |
15 ms |
2652 KB |
Output is correct |
57 |
Correct |
16 ms |
2652 KB |
Output is correct |
58 |
Correct |
15 ms |
2652 KB |
Output is correct |
59 |
Correct |
16 ms |
2648 KB |
Output is correct |
60 |
Correct |
15 ms |
2652 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
1 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
1 ms |
348 KB |
Output is correct |
14 |
Correct |
4 ms |
1244 KB |
Output is correct |
15 |
Correct |
8 ms |
2012 KB |
Output is correct |
16 |
Correct |
15 ms |
2768 KB |
Output is correct |
17 |
Correct |
13 ms |
3416 KB |
Output is correct |
18 |
Correct |
15 ms |
2652 KB |
Output is correct |
19 |
Correct |
15 ms |
2712 KB |
Output is correct |
20 |
Correct |
14 ms |
2908 KB |
Output is correct |
21 |
Correct |
13 ms |
2836 KB |
Output is correct |
22 |
Correct |
13 ms |
2652 KB |
Output is correct |
23 |
Correct |
12 ms |
2584 KB |
Output is correct |
24 |
Correct |
13 ms |
2648 KB |
Output is correct |
25 |
Correct |
12 ms |
2652 KB |
Output is correct |
26 |
Correct |
0 ms |
348 KB |
Output is correct |
27 |
Correct |
0 ms |
348 KB |
Output is correct |
28 |
Correct |
1 ms |
348 KB |
Output is correct |
29 |
Correct |
5 ms |
1116 KB |
Output is correct |
30 |
Correct |
11 ms |
1884 KB |
Output is correct |
31 |
Correct |
15 ms |
2904 KB |
Output is correct |
32 |
Correct |
14 ms |
2688 KB |
Output is correct |
33 |
Correct |
13 ms |
2648 KB |
Output is correct |
34 |
Correct |
17 ms |
2652 KB |
Output is correct |
35 |
Correct |
13 ms |
2660 KB |
Output is correct |
36 |
Correct |
13 ms |
2480 KB |
Output is correct |
37 |
Correct |
14 ms |
2744 KB |
Output is correct |
38 |
Correct |
14 ms |
2904 KB |
Output is correct |
39 |
Correct |
14 ms |
2540 KB |
Output is correct |
40 |
Correct |
14 ms |
2648 KB |
Output is correct |
41 |
Correct |
0 ms |
604 KB |
Output is correct |
42 |
Correct |
0 ms |
348 KB |
Output is correct |
43 |
Correct |
1 ms |
348 KB |
Output is correct |
44 |
Correct |
1 ms |
348 KB |
Output is correct |
45 |
Correct |
1 ms |
348 KB |
Output is correct |
46 |
Correct |
1 ms |
544 KB |
Output is correct |
47 |
Correct |
3 ms |
860 KB |
Output is correct |
48 |
Correct |
3 ms |
860 KB |
Output is correct |
49 |
Correct |
5 ms |
1116 KB |
Output is correct |
50 |
Correct |
12 ms |
2136 KB |
Output is correct |
51 |
Correct |
15 ms |
2652 KB |
Output is correct |
52 |
Correct |
17 ms |
2652 KB |
Output is correct |
53 |
Correct |
15 ms |
2652 KB |
Output is correct |
54 |
Correct |
17 ms |
2620 KB |
Output is correct |
55 |
Correct |
15 ms |
2652 KB |
Output is correct |
56 |
Correct |
17 ms |
2648 KB |
Output is correct |
57 |
Correct |
15 ms |
2652 KB |
Output is correct |
58 |
Correct |
19 ms |
2584 KB |
Output is correct |
59 |
Correct |
15 ms |
2648 KB |
Output is correct |
60 |
Correct |
16 ms |
2648 KB |
Output is correct |
61 |
Correct |
15 ms |
2652 KB |
Output is correct |
62 |
Correct |
16 ms |
2652 KB |
Output is correct |
63 |
Correct |
16 ms |
2592 KB |
Output is correct |
64 |
Correct |
16 ms |
2652 KB |
Output is correct |
65 |
Correct |
15 ms |
2732 KB |
Output is correct |
66 |
Correct |
15 ms |
2652 KB |
Output is correct |
67 |
Correct |
16 ms |
2652 KB |
Output is correct |
68 |
Correct |
15 ms |
2652 KB |
Output is correct |
69 |
Correct |
16 ms |
2648 KB |
Output is correct |
70 |
Correct |
15 ms |
2652 KB |
Output is correct |
71 |
Correct |
3 ms |
856 KB |
Output is correct |
72 |
Correct |
3 ms |
872 KB |
Output is correct |
73 |
Correct |
3 ms |
860 KB |
Output is correct |
74 |
Correct |
3 ms |
860 KB |
Output is correct |
75 |
Correct |
3 ms |
860 KB |
Output is correct |
76 |
Correct |
6 ms |
1372 KB |
Output is correct |
77 |
Correct |
5 ms |
1292 KB |
Output is correct |
78 |
Correct |
7 ms |
1372 KB |
Output is correct |
79 |
Correct |
9 ms |
1208 KB |
Output is correct |
80 |
Correct |
5 ms |
1372 KB |
Output is correct |
81 |
Correct |
16 ms |
2232 KB |
Output is correct |
82 |
Correct |
10 ms |
2136 KB |
Output is correct |
83 |
Correct |
10 ms |
2140 KB |
Output is correct |
84 |
Correct |
10 ms |
2136 KB |
Output is correct |
85 |
Correct |
12 ms |
2140 KB |
Output is correct |
86 |
Correct |
11 ms |
2396 KB |
Output is correct |
87 |
Correct |
11 ms |
2384 KB |
Output is correct |
88 |
Correct |
12 ms |
2396 KB |
Output is correct |
89 |
Correct |
11 ms |
2392 KB |
Output is correct |
90 |
Correct |
12 ms |
2396 KB |
Output is correct |
91 |
Correct |
18 ms |
4000 KB |
Output is correct |
92 |
Correct |
18 ms |
3924 KB |
Output is correct |
93 |
Correct |
19 ms |
3928 KB |
Output is correct |
94 |
Correct |
19 ms |
3932 KB |
Output is correct |
95 |
Correct |
17 ms |
3932 KB |
Output is correct |
96 |
Correct |
22 ms |
4944 KB |
Output is correct |
97 |
Correct |
21 ms |
4948 KB |
Output is correct |
98 |
Correct |
20 ms |
4952 KB |
Output is correct |
99 |
Correct |
19 ms |
4896 KB |
Output is correct |
100 |
Correct |
21 ms |
4836 KB |
Output is correct |
101 |
Correct |
21 ms |
4948 KB |
Output is correct |
102 |
Correct |
21 ms |
4956 KB |
Output is correct |
103 |
Correct |
19 ms |
4944 KB |
Output is correct |
104 |
Correct |
27 ms |
4944 KB |
Output is correct |
105 |
Correct |
20 ms |
5092 KB |
Output is correct |
106 |
Correct |
19 ms |
5468 KB |
Output is correct |
107 |
Correct |
27 ms |
5340 KB |
Output is correct |
108 |
Correct |
20 ms |
5468 KB |
Output is correct |
109 |
Correct |
18 ms |
5408 KB |
Output is correct |
110 |
Correct |
19 ms |
5468 KB |
Output is correct |
111 |
Correct |
20 ms |
5724 KB |
Output is correct |
112 |
Correct |
19 ms |
5468 KB |
Output is correct |
113 |
Correct |
20 ms |
5456 KB |
Output is correct |
114 |
Correct |
19 ms |
5468 KB |
Output is correct |
115 |
Correct |
18 ms |
5520 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
1 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
1 ms |
348 KB |
Output is correct |
14 |
Correct |
4 ms |
1244 KB |
Output is correct |
15 |
Correct |
8 ms |
2012 KB |
Output is correct |
16 |
Correct |
15 ms |
2768 KB |
Output is correct |
17 |
Correct |
13 ms |
3416 KB |
Output is correct |
18 |
Correct |
15 ms |
2652 KB |
Output is correct |
19 |
Correct |
15 ms |
2712 KB |
Output is correct |
20 |
Correct |
14 ms |
2908 KB |
Output is correct |
21 |
Correct |
13 ms |
2836 KB |
Output is correct |
22 |
Correct |
13 ms |
2652 KB |
Output is correct |
23 |
Correct |
12 ms |
2584 KB |
Output is correct |
24 |
Correct |
13 ms |
2648 KB |
Output is correct |
25 |
Correct |
12 ms |
2652 KB |
Output is correct |
26 |
Correct |
0 ms |
348 KB |
Output is correct |
27 |
Correct |
0 ms |
348 KB |
Output is correct |
28 |
Correct |
1 ms |
348 KB |
Output is correct |
29 |
Correct |
5 ms |
1116 KB |
Output is correct |
30 |
Correct |
11 ms |
1884 KB |
Output is correct |
31 |
Correct |
15 ms |
2904 KB |
Output is correct |
32 |
Correct |
14 ms |
2688 KB |
Output is correct |
33 |
Correct |
13 ms |
2648 KB |
Output is correct |
34 |
Correct |
17 ms |
2652 KB |
Output is correct |
35 |
Correct |
13 ms |
2660 KB |
Output is correct |
36 |
Correct |
13 ms |
2480 KB |
Output is correct |
37 |
Correct |
14 ms |
2744 KB |
Output is correct |
38 |
Correct |
14 ms |
2904 KB |
Output is correct |
39 |
Correct |
14 ms |
2540 KB |
Output is correct |
40 |
Correct |
14 ms |
2648 KB |
Output is correct |
41 |
Correct |
0 ms |
604 KB |
Output is correct |
42 |
Correct |
0 ms |
348 KB |
Output is correct |
43 |
Correct |
1 ms |
348 KB |
Output is correct |
44 |
Correct |
1 ms |
348 KB |
Output is correct |
45 |
Correct |
1 ms |
348 KB |
Output is correct |
46 |
Correct |
1 ms |
544 KB |
Output is correct |
47 |
Correct |
3 ms |
860 KB |
Output is correct |
48 |
Correct |
3 ms |
860 KB |
Output is correct |
49 |
Correct |
5 ms |
1116 KB |
Output is correct |
50 |
Correct |
12 ms |
2136 KB |
Output is correct |
51 |
Correct |
15 ms |
2652 KB |
Output is correct |
52 |
Correct |
17 ms |
2652 KB |
Output is correct |
53 |
Correct |
15 ms |
2652 KB |
Output is correct |
54 |
Correct |
17 ms |
2620 KB |
Output is correct |
55 |
Correct |
15 ms |
2652 KB |
Output is correct |
56 |
Correct |
17 ms |
2648 KB |
Output is correct |
57 |
Correct |
15 ms |
2652 KB |
Output is correct |
58 |
Correct |
19 ms |
2584 KB |
Output is correct |
59 |
Correct |
15 ms |
2648 KB |
Output is correct |
60 |
Correct |
16 ms |
2648 KB |
Output is correct |
61 |
Correct |
15 ms |
2652 KB |
Output is correct |
62 |
Correct |
16 ms |
2652 KB |
Output is correct |
63 |
Correct |
16 ms |
2592 KB |
Output is correct |
64 |
Correct |
16 ms |
2652 KB |
Output is correct |
65 |
Correct |
15 ms |
2732 KB |
Output is correct |
66 |
Correct |
15 ms |
2652 KB |
Output is correct |
67 |
Correct |
16 ms |
2652 KB |
Output is correct |
68 |
Correct |
15 ms |
2652 KB |
Output is correct |
69 |
Correct |
16 ms |
2648 KB |
Output is correct |
70 |
Correct |
15 ms |
2652 KB |
Output is correct |
71 |
Correct |
3 ms |
856 KB |
Output is correct |
72 |
Correct |
3 ms |
872 KB |
Output is correct |
73 |
Correct |
3 ms |
860 KB |
Output is correct |
74 |
Correct |
3 ms |
860 KB |
Output is correct |
75 |
Correct |
3 ms |
860 KB |
Output is correct |
76 |
Correct |
6 ms |
1372 KB |
Output is correct |
77 |
Correct |
5 ms |
1292 KB |
Output is correct |
78 |
Correct |
7 ms |
1372 KB |
Output is correct |
79 |
Correct |
9 ms |
1208 KB |
Output is correct |
80 |
Correct |
5 ms |
1372 KB |
Output is correct |
81 |
Correct |
16 ms |
2232 KB |
Output is correct |
82 |
Correct |
10 ms |
2136 KB |
Output is correct |
83 |
Correct |
10 ms |
2140 KB |
Output is correct |
84 |
Correct |
10 ms |
2136 KB |
Output is correct |
85 |
Correct |
12 ms |
2140 KB |
Output is correct |
86 |
Correct |
11 ms |
2396 KB |
Output is correct |
87 |
Correct |
11 ms |
2384 KB |
Output is correct |
88 |
Correct |
12 ms |
2396 KB |
Output is correct |
89 |
Correct |
11 ms |
2392 KB |
Output is correct |
90 |
Correct |
12 ms |
2396 KB |
Output is correct |
91 |
Correct |
18 ms |
4000 KB |
Output is correct |
92 |
Correct |
18 ms |
3924 KB |
Output is correct |
93 |
Correct |
19 ms |
3928 KB |
Output is correct |
94 |
Correct |
19 ms |
3932 KB |
Output is correct |
95 |
Correct |
17 ms |
3932 KB |
Output is correct |
96 |
Correct |
22 ms |
4944 KB |
Output is correct |
97 |
Correct |
21 ms |
4948 KB |
Output is correct |
98 |
Correct |
20 ms |
4952 KB |
Output is correct |
99 |
Correct |
19 ms |
4896 KB |
Output is correct |
100 |
Correct |
21 ms |
4836 KB |
Output is correct |
101 |
Correct |
21 ms |
4948 KB |
Output is correct |
102 |
Correct |
21 ms |
4956 KB |
Output is correct |
103 |
Correct |
19 ms |
4944 KB |
Output is correct |
104 |
Correct |
27 ms |
4944 KB |
Output is correct |
105 |
Correct |
20 ms |
5092 KB |
Output is correct |
106 |
Correct |
19 ms |
5468 KB |
Output is correct |
107 |
Correct |
27 ms |
5340 KB |
Output is correct |
108 |
Correct |
20 ms |
5468 KB |
Output is correct |
109 |
Correct |
18 ms |
5408 KB |
Output is correct |
110 |
Correct |
19 ms |
5468 KB |
Output is correct |
111 |
Correct |
20 ms |
5724 KB |
Output is correct |
112 |
Correct |
19 ms |
5468 KB |
Output is correct |
113 |
Correct |
20 ms |
5456 KB |
Output is correct |
114 |
Correct |
19 ms |
5468 KB |
Output is correct |
115 |
Correct |
18 ms |
5520 KB |
Output is correct |
116 |
Correct |
234 ms |
2388 KB |
Output is correct |
117 |
Correct |
234 ms |
2388 KB |
Output is correct |
118 |
Correct |
289 ms |
2640 KB |
Output is correct |
119 |
Correct |
299 ms |
2900 KB |
Output is correct |
120 |
Correct |
224 ms |
2900 KB |
Output is correct |
121 |
Correct |
352 ms |
3156 KB |
Output is correct |
122 |
Correct |
261 ms |
3468 KB |
Output is correct |
123 |
Correct |
689 ms |
4132 KB |
Output is correct |
124 |
Correct |
357 ms |
4436 KB |
Output is correct |
125 |
Correct |
315 ms |
4436 KB |
Output is correct |
126 |
Correct |
1193 ms |
4888 KB |
Output is correct |
127 |
Correct |
1199 ms |
4924 KB |
Output is correct |
128 |
Correct |
1235 ms |
4940 KB |
Output is correct |
129 |
Correct |
1234 ms |
4888 KB |
Output is correct |
130 |
Correct |
1263 ms |
4952 KB |
Output is correct |
131 |
Correct |
1486 ms |
4944 KB |
Output is correct |
132 |
Correct |
1431 ms |
4948 KB |
Output is correct |
133 |
Correct |
1421 ms |
4944 KB |
Output is correct |
134 |
Correct |
1424 ms |
4896 KB |
Output is correct |
135 |
Correct |
1430 ms |
4912 KB |
Output is correct |
136 |
Correct |
1452 ms |
4936 KB |
Output is correct |
137 |
Correct |
1462 ms |
4924 KB |
Output is correct |
138 |
Correct |
1427 ms |
4948 KB |
Output is correct |
139 |
Correct |
1417 ms |
4896 KB |
Output is correct |
140 |
Correct |
1466 ms |
4916 KB |
Output is correct |
141 |
Correct |
1226 ms |
4948 KB |
Output is correct |
142 |
Correct |
1220 ms |
4912 KB |
Output is correct |
143 |
Correct |
1250 ms |
4944 KB |
Output is correct |
144 |
Correct |
1247 ms |
4948 KB |
Output is correct |
145 |
Correct |
1222 ms |
4920 KB |
Output is correct |
146 |
Correct |
543 ms |
5204 KB |
Output is correct |
147 |
Correct |
535 ms |
5192 KB |
Output is correct |
148 |
Correct |
550 ms |
5212 KB |
Output is correct |
149 |
Correct |
553 ms |
5224 KB |
Output is correct |
150 |
Correct |
609 ms |
5204 KB |
Output is correct |
151 |
Correct |
503 ms |
5460 KB |
Output is correct |
152 |
Correct |
497 ms |
5284 KB |
Output is correct |
153 |
Correct |
499 ms |
5456 KB |
Output is correct |
154 |
Correct |
517 ms |
5392 KB |
Output is correct |
155 |
Correct |
534 ms |
5276 KB |
Output is correct |
156 |
Correct |
1352 ms |
6228 KB |
Output is correct |
157 |
Correct |
1382 ms |
6152 KB |
Output is correct |
158 |
Correct |
1361 ms |
5972 KB |
Output is correct |
159 |
Correct |
1325 ms |
6012 KB |
Output is correct |
160 |
Correct |
1341 ms |
6020 KB |
Output is correct |
161 |
Correct |
1217 ms |
6212 KB |
Output is correct |
162 |
Correct |
1145 ms |
6072 KB |
Output is correct |
163 |
Correct |
1177 ms |
6044 KB |
Output is correct |
164 |
Correct |
1171 ms |
6064 KB |
Output is correct |
165 |
Correct |
1158 ms |
5968 KB |
Output is correct |
166 |
Correct |
1351 ms |
5528 KB |
Output is correct |
167 |
Correct |
1346 ms |
5460 KB |
Output is correct |
168 |
Correct |
1337 ms |
5452 KB |
Output is correct |
169 |
Correct |
1343 ms |
5520 KB |
Output is correct |
170 |
Correct |
1300 ms |
5488 KB |
Output is correct |
171 |
Correct |
1171 ms |
5456 KB |
Output is correct |
172 |
Correct |
1183 ms |
5552 KB |
Output is correct |
173 |
Correct |
1191 ms |
5552 KB |
Output is correct |
174 |
Correct |
1177 ms |
5560 KB |
Output is correct |
175 |
Correct |
1192 ms |
5616 KB |
Output is correct |