#include <bits/stdc++.h>
using namespace std;
#define int long long
vector<int> freq(300005);
vector<int> s, does(300005);
int val(int a, int b, int c)
{
return a*c*(a+(c-1)*b)+b*b*((((c-1)*c*(2*c-1))/6));
}
int get()
{
int k=0, n=0;
int mod=1;
sort(s.begin(),s.end());
vector<int> cur;
int l=0, r=0, ans=0;
for(auto x: s)
{
int i=x, j=freq[x];
does[i]=0;
if(j==0) continue;
does[i]=1;
cur.push_back(i);
k+=j;
n+=(i*j);
}
for(auto x: cur)
{
int i=x, j=freq[x];
int addleft=(j+mod)/2;
int addright=j-addleft;
ans+=val(l, i, addleft);
ans+=val(n-l-i, -i, addleft);
ans+=val(r, i, addright);
ans+=val(n-r-i, -i, addright);
l+=addleft*i;
r+=addright*i;
mod=(j+mod)%2;
}
s=cur;
return (k*n*(n+1)-n*(k-1)-ans)/2;
}
int32_t main()
{
ios_base::sync_with_stdio(false); cin.tie(0);
int n, q, b=550, cnt=0; cin>>n>>q;
vector<int> a(n), ans(q);
vector<array<int, 3>> query[n/b+2];
for(int i=0; i<n; i++) cin>>a[i];
while(q--)
{
int l, r; cin>>l>>r;
l--; r--;
query[l/b].push_back({r, l, ++cnt});
}
int l=0, r=-1;
vector<int> count(3000005);
for(int i=0; i<n/b+1; i++)
{
sort(query[i].begin(), query[i].end());
for(auto x: query[i])
{
swap(x[0], x[1]);
while(x[0]>l)
{
count[a[l]]--;
if(count[a[l]]!=0)
freq[count[a[l]]]++;
freq[count[a[l]]+1]--;
if(does[count[a[l]]]==0&&count[a[l]]!=0) does[count[a[l]]]=1,s.push_back(count[a[l]]);
l++;
}
while(x[0]<l)
{
l--;
count[a[l]]++;
freq[count[a[l]]]++;
if(freq[count[a[l]]-1]>0)
freq[count[a[l]]-1]--;
if(does[count[a[l]]]==0&&count[a[l]]!=0) does[count[a[l]]]=1, s.push_back(count[a[l]]);
}
while(x[1]<r)
{
if(count[a[r]]!=0)
freq[count[a[r]]]--;
count[a[r]]--;
freq[count[a[r]]]++;
if(does[count[a[r]]]==0&&count[a[r]]!=0)does[count[a[r]]]=1, s.push_back(count[a[r]]);
r--;
}
while(x[1]>r)
{
r++;
if(count[a[r]]!=0)
freq[count[a[r]]]--;
count[a[r]]++;
freq[count[a[r]]]++;
if(does[count[a[r]]]==0&&count[a[r]]!=0)does[count[a[r]]]=1, s.push_back(count[a[r]]);
}
ans[x[2]-1]=get();
}
}
for(int i=0; i<ans.size(); i++) cout<<ans[i]<<"\n";
}
Compilation message
diversity.cpp: In function 'int32_t main()':
diversity.cpp:137:19: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
137 | for(int i=0; i<ans.size(); i++) cout<<ans[i]<<"\n";
| ~^~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
12 ms |
28500 KB |
Output is correct |
2 |
Correct |
16 ms |
28512 KB |
Output is correct |
3 |
Correct |
15 ms |
28408 KB |
Output is correct |
4 |
Correct |
12 ms |
28500 KB |
Output is correct |
5 |
Correct |
13 ms |
28400 KB |
Output is correct |
6 |
Correct |
12 ms |
28476 KB |
Output is correct |
7 |
Correct |
13 ms |
28380 KB |
Output is correct |
8 |
Correct |
12 ms |
28500 KB |
Output is correct |
9 |
Correct |
12 ms |
28500 KB |
Output is correct |
10 |
Correct |
11 ms |
28416 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
13 ms |
28416 KB |
Output is correct |
2 |
Correct |
12 ms |
28476 KB |
Output is correct |
3 |
Correct |
12 ms |
28608 KB |
Output is correct |
4 |
Correct |
18 ms |
29664 KB |
Output is correct |
5 |
Correct |
26 ms |
31248 KB |
Output is correct |
6 |
Correct |
33 ms |
31488 KB |
Output is correct |
7 |
Correct |
38 ms |
33020 KB |
Output is correct |
8 |
Correct |
33 ms |
31448 KB |
Output is correct |
9 |
Correct |
33 ms |
31440 KB |
Output is correct |
10 |
Correct |
38 ms |
31900 KB |
Output is correct |
11 |
Correct |
34 ms |
31992 KB |
Output is correct |
12 |
Correct |
31 ms |
31448 KB |
Output is correct |
13 |
Correct |
33 ms |
31420 KB |
Output is correct |
14 |
Correct |
37 ms |
31952 KB |
Output is correct |
15 |
Correct |
38 ms |
31952 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
13 ms |
28416 KB |
Output is correct |
2 |
Correct |
12 ms |
28476 KB |
Output is correct |
3 |
Correct |
12 ms |
28608 KB |
Output is correct |
4 |
Correct |
18 ms |
29664 KB |
Output is correct |
5 |
Correct |
26 ms |
31248 KB |
Output is correct |
6 |
Correct |
33 ms |
31488 KB |
Output is correct |
7 |
Correct |
38 ms |
33020 KB |
Output is correct |
8 |
Correct |
33 ms |
31448 KB |
Output is correct |
9 |
Correct |
33 ms |
31440 KB |
Output is correct |
10 |
Correct |
38 ms |
31900 KB |
Output is correct |
11 |
Correct |
34 ms |
31992 KB |
Output is correct |
12 |
Correct |
31 ms |
31448 KB |
Output is correct |
13 |
Correct |
33 ms |
31420 KB |
Output is correct |
14 |
Correct |
37 ms |
31952 KB |
Output is correct |
15 |
Correct |
38 ms |
31952 KB |
Output is correct |
16 |
Correct |
16 ms |
28500 KB |
Output is correct |
17 |
Correct |
15 ms |
28472 KB |
Output is correct |
18 |
Correct |
12 ms |
28500 KB |
Output is correct |
19 |
Correct |
22 ms |
29548 KB |
Output is correct |
20 |
Correct |
26 ms |
30400 KB |
Output is correct |
21 |
Correct |
37 ms |
31456 KB |
Output is correct |
22 |
Correct |
38 ms |
31428 KB |
Output is correct |
23 |
Correct |
46 ms |
31428 KB |
Output is correct |
24 |
Correct |
35 ms |
31448 KB |
Output is correct |
25 |
Correct |
32 ms |
31452 KB |
Output is correct |
26 |
Correct |
39 ms |
31440 KB |
Output is correct |
27 |
Correct |
33 ms |
31492 KB |
Output is correct |
28 |
Correct |
36 ms |
31940 KB |
Output is correct |
29 |
Correct |
32 ms |
31464 KB |
Output is correct |
30 |
Correct |
35 ms |
31444 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
13 ms |
28416 KB |
Output is correct |
2 |
Correct |
12 ms |
28476 KB |
Output is correct |
3 |
Correct |
12 ms |
28608 KB |
Output is correct |
4 |
Correct |
18 ms |
29664 KB |
Output is correct |
5 |
Correct |
26 ms |
31248 KB |
Output is correct |
6 |
Correct |
33 ms |
31488 KB |
Output is correct |
7 |
Correct |
38 ms |
33020 KB |
Output is correct |
8 |
Correct |
33 ms |
31448 KB |
Output is correct |
9 |
Correct |
33 ms |
31440 KB |
Output is correct |
10 |
Correct |
38 ms |
31900 KB |
Output is correct |
11 |
Correct |
34 ms |
31992 KB |
Output is correct |
12 |
Correct |
31 ms |
31448 KB |
Output is correct |
13 |
Correct |
33 ms |
31420 KB |
Output is correct |
14 |
Correct |
37 ms |
31952 KB |
Output is correct |
15 |
Correct |
38 ms |
31952 KB |
Output is correct |
16 |
Correct |
16 ms |
28500 KB |
Output is correct |
17 |
Correct |
15 ms |
28472 KB |
Output is correct |
18 |
Correct |
12 ms |
28500 KB |
Output is correct |
19 |
Correct |
22 ms |
29548 KB |
Output is correct |
20 |
Correct |
26 ms |
30400 KB |
Output is correct |
21 |
Correct |
37 ms |
31456 KB |
Output is correct |
22 |
Correct |
38 ms |
31428 KB |
Output is correct |
23 |
Correct |
46 ms |
31428 KB |
Output is correct |
24 |
Correct |
35 ms |
31448 KB |
Output is correct |
25 |
Correct |
32 ms |
31452 KB |
Output is correct |
26 |
Correct |
39 ms |
31440 KB |
Output is correct |
27 |
Correct |
33 ms |
31492 KB |
Output is correct |
28 |
Correct |
36 ms |
31940 KB |
Output is correct |
29 |
Correct |
32 ms |
31464 KB |
Output is correct |
30 |
Correct |
35 ms |
31444 KB |
Output is correct |
31 |
Correct |
12 ms |
28500 KB |
Output is correct |
32 |
Correct |
12 ms |
28500 KB |
Output is correct |
33 |
Correct |
12 ms |
28420 KB |
Output is correct |
34 |
Correct |
12 ms |
28500 KB |
Output is correct |
35 |
Correct |
17 ms |
28460 KB |
Output is correct |
36 |
Correct |
14 ms |
28500 KB |
Output is correct |
37 |
Correct |
18 ms |
28884 KB |
Output is correct |
38 |
Correct |
15 ms |
28840 KB |
Output is correct |
39 |
Correct |
20 ms |
29276 KB |
Output is correct |
40 |
Correct |
27 ms |
30020 KB |
Output is correct |
41 |
Correct |
32 ms |
30820 KB |
Output is correct |
42 |
Correct |
34 ms |
30900 KB |
Output is correct |
43 |
Correct |
38 ms |
30896 KB |
Output is correct |
44 |
Correct |
35 ms |
30784 KB |
Output is correct |
45 |
Correct |
34 ms |
30800 KB |
Output is correct |
46 |
Correct |
33 ms |
30920 KB |
Output is correct |
47 |
Correct |
39 ms |
30804 KB |
Output is correct |
48 |
Correct |
34 ms |
30820 KB |
Output is correct |
49 |
Correct |
32 ms |
30800 KB |
Output is correct |
50 |
Correct |
34 ms |
30812 KB |
Output is correct |
51 |
Correct |
33 ms |
30796 KB |
Output is correct |
52 |
Correct |
45 ms |
30800 KB |
Output is correct |
53 |
Correct |
36 ms |
30796 KB |
Output is correct |
54 |
Correct |
41 ms |
30932 KB |
Output is correct |
55 |
Correct |
35 ms |
30872 KB |
Output is correct |
56 |
Correct |
35 ms |
30788 KB |
Output is correct |
57 |
Correct |
33 ms |
30872 KB |
Output is correct |
58 |
Correct |
37 ms |
30800 KB |
Output is correct |
59 |
Correct |
34 ms |
30804 KB |
Output is correct |
60 |
Correct |
38 ms |
30784 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
12 ms |
28500 KB |
Output is correct |
2 |
Correct |
16 ms |
28512 KB |
Output is correct |
3 |
Correct |
15 ms |
28408 KB |
Output is correct |
4 |
Correct |
12 ms |
28500 KB |
Output is correct |
5 |
Correct |
13 ms |
28400 KB |
Output is correct |
6 |
Correct |
12 ms |
28476 KB |
Output is correct |
7 |
Correct |
13 ms |
28380 KB |
Output is correct |
8 |
Correct |
12 ms |
28500 KB |
Output is correct |
9 |
Correct |
12 ms |
28500 KB |
Output is correct |
10 |
Correct |
11 ms |
28416 KB |
Output is correct |
11 |
Correct |
13 ms |
28416 KB |
Output is correct |
12 |
Correct |
12 ms |
28476 KB |
Output is correct |
13 |
Correct |
12 ms |
28608 KB |
Output is correct |
14 |
Correct |
18 ms |
29664 KB |
Output is correct |
15 |
Correct |
26 ms |
31248 KB |
Output is correct |
16 |
Correct |
33 ms |
31488 KB |
Output is correct |
17 |
Correct |
38 ms |
33020 KB |
Output is correct |
18 |
Correct |
33 ms |
31448 KB |
Output is correct |
19 |
Correct |
33 ms |
31440 KB |
Output is correct |
20 |
Correct |
38 ms |
31900 KB |
Output is correct |
21 |
Correct |
34 ms |
31992 KB |
Output is correct |
22 |
Correct |
31 ms |
31448 KB |
Output is correct |
23 |
Correct |
33 ms |
31420 KB |
Output is correct |
24 |
Correct |
37 ms |
31952 KB |
Output is correct |
25 |
Correct |
38 ms |
31952 KB |
Output is correct |
26 |
Correct |
16 ms |
28500 KB |
Output is correct |
27 |
Correct |
15 ms |
28472 KB |
Output is correct |
28 |
Correct |
12 ms |
28500 KB |
Output is correct |
29 |
Correct |
22 ms |
29548 KB |
Output is correct |
30 |
Correct |
26 ms |
30400 KB |
Output is correct |
31 |
Correct |
37 ms |
31456 KB |
Output is correct |
32 |
Correct |
38 ms |
31428 KB |
Output is correct |
33 |
Correct |
46 ms |
31428 KB |
Output is correct |
34 |
Correct |
35 ms |
31448 KB |
Output is correct |
35 |
Correct |
32 ms |
31452 KB |
Output is correct |
36 |
Correct |
39 ms |
31440 KB |
Output is correct |
37 |
Correct |
33 ms |
31492 KB |
Output is correct |
38 |
Correct |
36 ms |
31940 KB |
Output is correct |
39 |
Correct |
32 ms |
31464 KB |
Output is correct |
40 |
Correct |
35 ms |
31444 KB |
Output is correct |
41 |
Correct |
12 ms |
28500 KB |
Output is correct |
42 |
Correct |
12 ms |
28500 KB |
Output is correct |
43 |
Correct |
12 ms |
28420 KB |
Output is correct |
44 |
Correct |
12 ms |
28500 KB |
Output is correct |
45 |
Correct |
17 ms |
28460 KB |
Output is correct |
46 |
Correct |
14 ms |
28500 KB |
Output is correct |
47 |
Correct |
18 ms |
28884 KB |
Output is correct |
48 |
Correct |
15 ms |
28840 KB |
Output is correct |
49 |
Correct |
20 ms |
29276 KB |
Output is correct |
50 |
Correct |
27 ms |
30020 KB |
Output is correct |
51 |
Correct |
32 ms |
30820 KB |
Output is correct |
52 |
Correct |
34 ms |
30900 KB |
Output is correct |
53 |
Correct |
38 ms |
30896 KB |
Output is correct |
54 |
Correct |
35 ms |
30784 KB |
Output is correct |
55 |
Correct |
34 ms |
30800 KB |
Output is correct |
56 |
Correct |
33 ms |
30920 KB |
Output is correct |
57 |
Correct |
39 ms |
30804 KB |
Output is correct |
58 |
Correct |
34 ms |
30820 KB |
Output is correct |
59 |
Correct |
32 ms |
30800 KB |
Output is correct |
60 |
Correct |
34 ms |
30812 KB |
Output is correct |
61 |
Correct |
33 ms |
30796 KB |
Output is correct |
62 |
Correct |
45 ms |
30800 KB |
Output is correct |
63 |
Correct |
36 ms |
30796 KB |
Output is correct |
64 |
Correct |
41 ms |
30932 KB |
Output is correct |
65 |
Correct |
35 ms |
30872 KB |
Output is correct |
66 |
Correct |
35 ms |
30788 KB |
Output is correct |
67 |
Correct |
33 ms |
30872 KB |
Output is correct |
68 |
Correct |
37 ms |
30800 KB |
Output is correct |
69 |
Correct |
34 ms |
30804 KB |
Output is correct |
70 |
Correct |
38 ms |
30784 KB |
Output is correct |
71 |
Correct |
19 ms |
28848 KB |
Output is correct |
72 |
Correct |
22 ms |
28792 KB |
Output is correct |
73 |
Correct |
18 ms |
28844 KB |
Output is correct |
74 |
Correct |
18 ms |
28856 KB |
Output is correct |
75 |
Correct |
19 ms |
28884 KB |
Output is correct |
76 |
Correct |
20 ms |
29256 KB |
Output is correct |
77 |
Correct |
19 ms |
29304 KB |
Output is correct |
78 |
Correct |
19 ms |
29208 KB |
Output is correct |
79 |
Correct |
20 ms |
29248 KB |
Output is correct |
80 |
Correct |
19 ms |
29216 KB |
Output is correct |
81 |
Correct |
29 ms |
30036 KB |
Output is correct |
82 |
Correct |
29 ms |
30024 KB |
Output is correct |
83 |
Correct |
35 ms |
30036 KB |
Output is correct |
84 |
Correct |
28 ms |
29992 KB |
Output is correct |
85 |
Correct |
39 ms |
30024 KB |
Output is correct |
86 |
Correct |
31 ms |
30020 KB |
Output is correct |
87 |
Correct |
30 ms |
30016 KB |
Output is correct |
88 |
Correct |
30 ms |
29960 KB |
Output is correct |
89 |
Correct |
28 ms |
30064 KB |
Output is correct |
90 |
Correct |
32 ms |
30060 KB |
Output is correct |
91 |
Correct |
43 ms |
30852 KB |
Output is correct |
92 |
Correct |
40 ms |
30796 KB |
Output is correct |
93 |
Correct |
38 ms |
30804 KB |
Output is correct |
94 |
Correct |
42 ms |
30804 KB |
Output is correct |
95 |
Correct |
40 ms |
30796 KB |
Output is correct |
96 |
Correct |
45 ms |
30796 KB |
Output is correct |
97 |
Correct |
45 ms |
30832 KB |
Output is correct |
98 |
Correct |
43 ms |
30800 KB |
Output is correct |
99 |
Correct |
48 ms |
30808 KB |
Output is correct |
100 |
Correct |
58 ms |
30800 KB |
Output is correct |
101 |
Correct |
44 ms |
30796 KB |
Output is correct |
102 |
Correct |
43 ms |
30852 KB |
Output is correct |
103 |
Correct |
58 ms |
30804 KB |
Output is correct |
104 |
Correct |
44 ms |
30820 KB |
Output is correct |
105 |
Correct |
45 ms |
30788 KB |
Output is correct |
106 |
Correct |
44 ms |
30788 KB |
Output is correct |
107 |
Correct |
45 ms |
30796 KB |
Output is correct |
108 |
Correct |
57 ms |
30800 KB |
Output is correct |
109 |
Correct |
44 ms |
30792 KB |
Output is correct |
110 |
Correct |
44 ms |
30780 KB |
Output is correct |
111 |
Correct |
42 ms |
30800 KB |
Output is correct |
112 |
Correct |
44 ms |
30776 KB |
Output is correct |
113 |
Correct |
47 ms |
30788 KB |
Output is correct |
114 |
Correct |
52 ms |
30796 KB |
Output is correct |
115 |
Correct |
46 ms |
30808 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
12 ms |
28500 KB |
Output is correct |
2 |
Correct |
16 ms |
28512 KB |
Output is correct |
3 |
Correct |
15 ms |
28408 KB |
Output is correct |
4 |
Correct |
12 ms |
28500 KB |
Output is correct |
5 |
Correct |
13 ms |
28400 KB |
Output is correct |
6 |
Correct |
12 ms |
28476 KB |
Output is correct |
7 |
Correct |
13 ms |
28380 KB |
Output is correct |
8 |
Correct |
12 ms |
28500 KB |
Output is correct |
9 |
Correct |
12 ms |
28500 KB |
Output is correct |
10 |
Correct |
11 ms |
28416 KB |
Output is correct |
11 |
Correct |
13 ms |
28416 KB |
Output is correct |
12 |
Correct |
12 ms |
28476 KB |
Output is correct |
13 |
Correct |
12 ms |
28608 KB |
Output is correct |
14 |
Correct |
18 ms |
29664 KB |
Output is correct |
15 |
Correct |
26 ms |
31248 KB |
Output is correct |
16 |
Correct |
33 ms |
31488 KB |
Output is correct |
17 |
Correct |
38 ms |
33020 KB |
Output is correct |
18 |
Correct |
33 ms |
31448 KB |
Output is correct |
19 |
Correct |
33 ms |
31440 KB |
Output is correct |
20 |
Correct |
38 ms |
31900 KB |
Output is correct |
21 |
Correct |
34 ms |
31992 KB |
Output is correct |
22 |
Correct |
31 ms |
31448 KB |
Output is correct |
23 |
Correct |
33 ms |
31420 KB |
Output is correct |
24 |
Correct |
37 ms |
31952 KB |
Output is correct |
25 |
Correct |
38 ms |
31952 KB |
Output is correct |
26 |
Correct |
16 ms |
28500 KB |
Output is correct |
27 |
Correct |
15 ms |
28472 KB |
Output is correct |
28 |
Correct |
12 ms |
28500 KB |
Output is correct |
29 |
Correct |
22 ms |
29548 KB |
Output is correct |
30 |
Correct |
26 ms |
30400 KB |
Output is correct |
31 |
Correct |
37 ms |
31456 KB |
Output is correct |
32 |
Correct |
38 ms |
31428 KB |
Output is correct |
33 |
Correct |
46 ms |
31428 KB |
Output is correct |
34 |
Correct |
35 ms |
31448 KB |
Output is correct |
35 |
Correct |
32 ms |
31452 KB |
Output is correct |
36 |
Correct |
39 ms |
31440 KB |
Output is correct |
37 |
Correct |
33 ms |
31492 KB |
Output is correct |
38 |
Correct |
36 ms |
31940 KB |
Output is correct |
39 |
Correct |
32 ms |
31464 KB |
Output is correct |
40 |
Correct |
35 ms |
31444 KB |
Output is correct |
41 |
Correct |
12 ms |
28500 KB |
Output is correct |
42 |
Correct |
12 ms |
28500 KB |
Output is correct |
43 |
Correct |
12 ms |
28420 KB |
Output is correct |
44 |
Correct |
12 ms |
28500 KB |
Output is correct |
45 |
Correct |
17 ms |
28460 KB |
Output is correct |
46 |
Correct |
14 ms |
28500 KB |
Output is correct |
47 |
Correct |
18 ms |
28884 KB |
Output is correct |
48 |
Correct |
15 ms |
28840 KB |
Output is correct |
49 |
Correct |
20 ms |
29276 KB |
Output is correct |
50 |
Correct |
27 ms |
30020 KB |
Output is correct |
51 |
Correct |
32 ms |
30820 KB |
Output is correct |
52 |
Correct |
34 ms |
30900 KB |
Output is correct |
53 |
Correct |
38 ms |
30896 KB |
Output is correct |
54 |
Correct |
35 ms |
30784 KB |
Output is correct |
55 |
Correct |
34 ms |
30800 KB |
Output is correct |
56 |
Correct |
33 ms |
30920 KB |
Output is correct |
57 |
Correct |
39 ms |
30804 KB |
Output is correct |
58 |
Correct |
34 ms |
30820 KB |
Output is correct |
59 |
Correct |
32 ms |
30800 KB |
Output is correct |
60 |
Correct |
34 ms |
30812 KB |
Output is correct |
61 |
Correct |
33 ms |
30796 KB |
Output is correct |
62 |
Correct |
45 ms |
30800 KB |
Output is correct |
63 |
Correct |
36 ms |
30796 KB |
Output is correct |
64 |
Correct |
41 ms |
30932 KB |
Output is correct |
65 |
Correct |
35 ms |
30872 KB |
Output is correct |
66 |
Correct |
35 ms |
30788 KB |
Output is correct |
67 |
Correct |
33 ms |
30872 KB |
Output is correct |
68 |
Correct |
37 ms |
30800 KB |
Output is correct |
69 |
Correct |
34 ms |
30804 KB |
Output is correct |
70 |
Correct |
38 ms |
30784 KB |
Output is correct |
71 |
Correct |
19 ms |
28848 KB |
Output is correct |
72 |
Correct |
22 ms |
28792 KB |
Output is correct |
73 |
Correct |
18 ms |
28844 KB |
Output is correct |
74 |
Correct |
18 ms |
28856 KB |
Output is correct |
75 |
Correct |
19 ms |
28884 KB |
Output is correct |
76 |
Correct |
20 ms |
29256 KB |
Output is correct |
77 |
Correct |
19 ms |
29304 KB |
Output is correct |
78 |
Correct |
19 ms |
29208 KB |
Output is correct |
79 |
Correct |
20 ms |
29248 KB |
Output is correct |
80 |
Correct |
19 ms |
29216 KB |
Output is correct |
81 |
Correct |
29 ms |
30036 KB |
Output is correct |
82 |
Correct |
29 ms |
30024 KB |
Output is correct |
83 |
Correct |
35 ms |
30036 KB |
Output is correct |
84 |
Correct |
28 ms |
29992 KB |
Output is correct |
85 |
Correct |
39 ms |
30024 KB |
Output is correct |
86 |
Correct |
31 ms |
30020 KB |
Output is correct |
87 |
Correct |
30 ms |
30016 KB |
Output is correct |
88 |
Correct |
30 ms |
29960 KB |
Output is correct |
89 |
Correct |
28 ms |
30064 KB |
Output is correct |
90 |
Correct |
32 ms |
30060 KB |
Output is correct |
91 |
Correct |
43 ms |
30852 KB |
Output is correct |
92 |
Correct |
40 ms |
30796 KB |
Output is correct |
93 |
Correct |
38 ms |
30804 KB |
Output is correct |
94 |
Correct |
42 ms |
30804 KB |
Output is correct |
95 |
Correct |
40 ms |
30796 KB |
Output is correct |
96 |
Correct |
45 ms |
30796 KB |
Output is correct |
97 |
Correct |
45 ms |
30832 KB |
Output is correct |
98 |
Correct |
43 ms |
30800 KB |
Output is correct |
99 |
Correct |
48 ms |
30808 KB |
Output is correct |
100 |
Correct |
58 ms |
30800 KB |
Output is correct |
101 |
Correct |
44 ms |
30796 KB |
Output is correct |
102 |
Correct |
43 ms |
30852 KB |
Output is correct |
103 |
Correct |
58 ms |
30804 KB |
Output is correct |
104 |
Correct |
44 ms |
30820 KB |
Output is correct |
105 |
Correct |
45 ms |
30788 KB |
Output is correct |
106 |
Correct |
44 ms |
30788 KB |
Output is correct |
107 |
Correct |
45 ms |
30796 KB |
Output is correct |
108 |
Correct |
57 ms |
30800 KB |
Output is correct |
109 |
Correct |
44 ms |
30792 KB |
Output is correct |
110 |
Correct |
44 ms |
30780 KB |
Output is correct |
111 |
Correct |
42 ms |
30800 KB |
Output is correct |
112 |
Correct |
44 ms |
30776 KB |
Output is correct |
113 |
Correct |
47 ms |
30788 KB |
Output is correct |
114 |
Correct |
52 ms |
30796 KB |
Output is correct |
115 |
Correct |
46 ms |
30808 KB |
Output is correct |
116 |
Correct |
448 ms |
31080 KB |
Output is correct |
117 |
Correct |
354 ms |
31124 KB |
Output is correct |
118 |
Correct |
715 ms |
31512 KB |
Output is correct |
119 |
Correct |
466 ms |
31436 KB |
Output is correct |
120 |
Correct |
368 ms |
31420 KB |
Output is correct |
121 |
Correct |
700 ms |
32032 KB |
Output is correct |
122 |
Correct |
550 ms |
31972 KB |
Output is correct |
123 |
Correct |
1752 ms |
32976 KB |
Output is correct |
124 |
Correct |
1333 ms |
34560 KB |
Output is correct |
125 |
Correct |
1378 ms |
34544 KB |
Output is correct |
126 |
Correct |
4864 ms |
35632 KB |
Output is correct |
127 |
Correct |
4796 ms |
35636 KB |
Output is correct |
128 |
Correct |
4886 ms |
35712 KB |
Output is correct |
129 |
Correct |
4925 ms |
35660 KB |
Output is correct |
130 |
Correct |
4674 ms |
35660 KB |
Output is correct |
131 |
Correct |
4129 ms |
35728 KB |
Output is correct |
132 |
Correct |
4115 ms |
35768 KB |
Output is correct |
133 |
Correct |
4286 ms |
35760 KB |
Output is correct |
134 |
Correct |
4183 ms |
35740 KB |
Output is correct |
135 |
Correct |
4171 ms |
35852 KB |
Output is correct |
136 |
Correct |
4182 ms |
35796 KB |
Output is correct |
137 |
Correct |
4198 ms |
35792 KB |
Output is correct |
138 |
Correct |
4201 ms |
35824 KB |
Output is correct |
139 |
Correct |
4137 ms |
35720 KB |
Output is correct |
140 |
Correct |
4240 ms |
35804 KB |
Output is correct |
141 |
Correct |
3345 ms |
35744 KB |
Output is correct |
142 |
Correct |
3393 ms |
35744 KB |
Output is correct |
143 |
Correct |
3372 ms |
35748 KB |
Output is correct |
144 |
Correct |
3397 ms |
35768 KB |
Output is correct |
145 |
Correct |
3361 ms |
35792 KB |
Output is correct |
146 |
Correct |
2796 ms |
35980 KB |
Output is correct |
147 |
Correct |
2799 ms |
36096 KB |
Output is correct |
148 |
Correct |
2788 ms |
36000 KB |
Output is correct |
149 |
Correct |
2660 ms |
36056 KB |
Output is correct |
150 |
Correct |
2779 ms |
35960 KB |
Output is correct |
151 |
Correct |
2816 ms |
35964 KB |
Output is correct |
152 |
Correct |
2879 ms |
36028 KB |
Output is correct |
153 |
Correct |
2883 ms |
36044 KB |
Output is correct |
154 |
Correct |
2878 ms |
35972 KB |
Output is correct |
155 |
Correct |
2863 ms |
36040 KB |
Output is correct |
156 |
Correct |
5017 ms |
36636 KB |
Output is correct |
157 |
Correct |
5051 ms |
36676 KB |
Output is correct |
158 |
Correct |
4703 ms |
36524 KB |
Output is correct |
159 |
Correct |
4656 ms |
36552 KB |
Output is correct |
160 |
Correct |
4597 ms |
36560 KB |
Output is correct |
161 |
Correct |
5764 ms |
36940 KB |
Output is correct |
162 |
Correct |
5427 ms |
36756 KB |
Output is correct |
163 |
Correct |
4935 ms |
36860 KB |
Output is correct |
164 |
Correct |
5407 ms |
36716 KB |
Output is correct |
165 |
Correct |
5173 ms |
36736 KB |
Output is correct |
166 |
Correct |
5295 ms |
36552 KB |
Output is correct |
167 |
Correct |
4964 ms |
36384 KB |
Output is correct |
168 |
Correct |
4863 ms |
36404 KB |
Output is correct |
169 |
Correct |
5246 ms |
36440 KB |
Output is correct |
170 |
Correct |
5146 ms |
36408 KB |
Output is correct |
171 |
Correct |
5534 ms |
36340 KB |
Output is correct |
172 |
Correct |
5636 ms |
36348 KB |
Output is correct |
173 |
Correct |
5706 ms |
36368 KB |
Output is correct |
174 |
Correct |
5719 ms |
36412 KB |
Output is correct |
175 |
Correct |
5866 ms |
36436 KB |
Output is correct |