#include "bits/stdc++.h"
using namespace std;
#define ar array
typedef int64_t ll;
const int N = 3e5 + 5;
const int Q = 5e4 + 5;
const int B = 1700;
int a[N], l[Q], r[Q];
int cnt[N], mm[N];
ll res[Q], dp[N];
signed main(){
ios::sync_with_stdio(0); cin.tie(0);
int n, q; cin>>n>>q;
vector<int> p;
for(int i=0;i<n;i++){
cin>>a[i];
}
for(int i=1;i<N;i++){
dp[i] = dp[i-1] + (i * 1ll * (i - 1) / 2);
}
for(int i=0;i<q;i++){
cin>>l[i]>>r[i];
l[i]--;
p.push_back(i);
}
sort(p.begin(), p.end(), [&](int i, int j){
if(l[i] / B != l[j] / B){
return l[i] < l[j];
}
return r[i] < r[j];
});
set<int> ss;
auto add = [&](int i){
if(cnt[a[i]]){
mm[cnt[a[i]]]--;
if(!mm[cnt[a[i]]]) ss.erase(cnt[a[i]]);
}
cnt[a[i]]++;
if(!mm[cnt[a[i]]]) ss.insert(cnt[a[i]]);
mm[cnt[a[i]]]++;
};
auto del = [&](int i){
//~ assert(cnt[a[i]]);
mm[cnt[a[i]]]--;
if(!mm[cnt[a[i]]]) ss.erase(cnt[a[i]]);
cnt[a[i]]--;
if(cnt[a[i]]){
if(!mm[cnt[a[i]]]) ss.insert(cnt[a[i]]);
mm[cnt[a[i]]]++;
}
};
int lx = 0, rx = 0;
for(auto i : p){
if(rx > r[i]){
ss.clear();
lx = rx = l[i];
memset(cnt, 0, sizeof cnt);
memset(mm, 0, sizeof mm);
}
while(rx < r[i]){
add(rx++);
}
while(lx > l[i]){
add(--lx);
}
while(lx < l[i]){
del(lx++);
}
int ls = 0, rs = 0;
vector<ar<ll, 2>> L, R;
for(auto v : ss){
int c = mm[v];
int b = (c + 1) / 2, s = c / 2;
if(ls > rs) swap(b, s);
if(b) L.push_back({v, b}), ls += b;
if(s) R.push_back({v, s}), rs += s;
}
reverse(R.begin(), R.end());
L.insert(L.end(), R.begin(), R.end());
ll sum = 0, sumj = 0, p = 0;
for(auto [v, c] : L){
ll C = p * c + c * (c - 1) / 2;
res[i] = res[i] + v * C * sum - v * c * sumj;
res[i] += dp[c] * v * v;
sumj += v * C;
sum += v * c;
p += c;
}
res[i] += sum * (sum + 1) / 2;
}
for(int i=0;i<q;i++) cout<<res[i]<<"\n";
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
2644 KB |
Output is correct |
2 |
Correct |
2 ms |
2644 KB |
Output is correct |
3 |
Correct |
3 ms |
2644 KB |
Output is correct |
4 |
Correct |
2 ms |
2708 KB |
Output is correct |
5 |
Correct |
2 ms |
2644 KB |
Output is correct |
6 |
Correct |
2 ms |
2644 KB |
Output is correct |
7 |
Correct |
3 ms |
2628 KB |
Output is correct |
8 |
Correct |
3 ms |
2644 KB |
Output is correct |
9 |
Correct |
2 ms |
2644 KB |
Output is correct |
10 |
Correct |
2 ms |
2636 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
2644 KB |
Output is correct |
2 |
Correct |
2 ms |
2712 KB |
Output is correct |
3 |
Correct |
3 ms |
2664 KB |
Output is correct |
4 |
Correct |
17 ms |
3284 KB |
Output is correct |
5 |
Correct |
30 ms |
3912 KB |
Output is correct |
6 |
Correct |
46 ms |
4324 KB |
Output is correct |
7 |
Correct |
48 ms |
4664 KB |
Output is correct |
8 |
Correct |
50 ms |
4324 KB |
Output is correct |
9 |
Correct |
44 ms |
4340 KB |
Output is correct |
10 |
Correct |
45 ms |
4488 KB |
Output is correct |
11 |
Correct |
47 ms |
4280 KB |
Output is correct |
12 |
Correct |
44 ms |
4276 KB |
Output is correct |
13 |
Correct |
46 ms |
4300 KB |
Output is correct |
14 |
Correct |
44 ms |
4316 KB |
Output is correct |
15 |
Correct |
50 ms |
4372 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
2644 KB |
Output is correct |
2 |
Correct |
2 ms |
2712 KB |
Output is correct |
3 |
Correct |
3 ms |
2664 KB |
Output is correct |
4 |
Correct |
17 ms |
3284 KB |
Output is correct |
5 |
Correct |
30 ms |
3912 KB |
Output is correct |
6 |
Correct |
46 ms |
4324 KB |
Output is correct |
7 |
Correct |
48 ms |
4664 KB |
Output is correct |
8 |
Correct |
50 ms |
4324 KB |
Output is correct |
9 |
Correct |
44 ms |
4340 KB |
Output is correct |
10 |
Correct |
45 ms |
4488 KB |
Output is correct |
11 |
Correct |
47 ms |
4280 KB |
Output is correct |
12 |
Correct |
44 ms |
4276 KB |
Output is correct |
13 |
Correct |
46 ms |
4300 KB |
Output is correct |
14 |
Correct |
44 ms |
4316 KB |
Output is correct |
15 |
Correct |
50 ms |
4372 KB |
Output is correct |
16 |
Correct |
2 ms |
2644 KB |
Output is correct |
17 |
Correct |
2 ms |
2644 KB |
Output is correct |
18 |
Correct |
4 ms |
2680 KB |
Output is correct |
19 |
Correct |
18 ms |
3268 KB |
Output is correct |
20 |
Correct |
33 ms |
3768 KB |
Output is correct |
21 |
Correct |
51 ms |
4360 KB |
Output is correct |
22 |
Correct |
49 ms |
4220 KB |
Output is correct |
23 |
Correct |
55 ms |
4300 KB |
Output is correct |
24 |
Correct |
52 ms |
4212 KB |
Output is correct |
25 |
Correct |
49 ms |
4232 KB |
Output is correct |
26 |
Correct |
53 ms |
4244 KB |
Output is correct |
27 |
Correct |
53 ms |
4384 KB |
Output is correct |
28 |
Correct |
47 ms |
4388 KB |
Output is correct |
29 |
Correct |
54 ms |
4224 KB |
Output is correct |
30 |
Correct |
54 ms |
4172 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
2644 KB |
Output is correct |
2 |
Correct |
2 ms |
2712 KB |
Output is correct |
3 |
Correct |
3 ms |
2664 KB |
Output is correct |
4 |
Correct |
17 ms |
3284 KB |
Output is correct |
5 |
Correct |
30 ms |
3912 KB |
Output is correct |
6 |
Correct |
46 ms |
4324 KB |
Output is correct |
7 |
Correct |
48 ms |
4664 KB |
Output is correct |
8 |
Correct |
50 ms |
4324 KB |
Output is correct |
9 |
Correct |
44 ms |
4340 KB |
Output is correct |
10 |
Correct |
45 ms |
4488 KB |
Output is correct |
11 |
Correct |
47 ms |
4280 KB |
Output is correct |
12 |
Correct |
44 ms |
4276 KB |
Output is correct |
13 |
Correct |
46 ms |
4300 KB |
Output is correct |
14 |
Correct |
44 ms |
4316 KB |
Output is correct |
15 |
Correct |
50 ms |
4372 KB |
Output is correct |
16 |
Correct |
2 ms |
2644 KB |
Output is correct |
17 |
Correct |
2 ms |
2644 KB |
Output is correct |
18 |
Correct |
4 ms |
2680 KB |
Output is correct |
19 |
Correct |
18 ms |
3268 KB |
Output is correct |
20 |
Correct |
33 ms |
3768 KB |
Output is correct |
21 |
Correct |
51 ms |
4360 KB |
Output is correct |
22 |
Correct |
49 ms |
4220 KB |
Output is correct |
23 |
Correct |
55 ms |
4300 KB |
Output is correct |
24 |
Correct |
52 ms |
4212 KB |
Output is correct |
25 |
Correct |
49 ms |
4232 KB |
Output is correct |
26 |
Correct |
53 ms |
4244 KB |
Output is correct |
27 |
Correct |
53 ms |
4384 KB |
Output is correct |
28 |
Correct |
47 ms |
4388 KB |
Output is correct |
29 |
Correct |
54 ms |
4224 KB |
Output is correct |
30 |
Correct |
54 ms |
4172 KB |
Output is correct |
31 |
Correct |
2 ms |
2684 KB |
Output is correct |
32 |
Correct |
2 ms |
2644 KB |
Output is correct |
33 |
Correct |
2 ms |
2644 KB |
Output is correct |
34 |
Correct |
3 ms |
2736 KB |
Output is correct |
35 |
Correct |
3 ms |
2772 KB |
Output is correct |
36 |
Correct |
3 ms |
2772 KB |
Output is correct |
37 |
Correct |
7 ms |
3028 KB |
Output is correct |
38 |
Correct |
8 ms |
2944 KB |
Output is correct |
39 |
Correct |
16 ms |
3328 KB |
Output is correct |
40 |
Correct |
27 ms |
3712 KB |
Output is correct |
41 |
Correct |
38 ms |
4244 KB |
Output is correct |
42 |
Correct |
38 ms |
4172 KB |
Output is correct |
43 |
Correct |
45 ms |
4148 KB |
Output is correct |
44 |
Correct |
41 ms |
4076 KB |
Output is correct |
45 |
Correct |
49 ms |
4132 KB |
Output is correct |
46 |
Correct |
38 ms |
4168 KB |
Output is correct |
47 |
Correct |
37 ms |
4112 KB |
Output is correct |
48 |
Correct |
40 ms |
4144 KB |
Output is correct |
49 |
Correct |
45 ms |
4236 KB |
Output is correct |
50 |
Correct |
42 ms |
4164 KB |
Output is correct |
51 |
Correct |
40 ms |
4112 KB |
Output is correct |
52 |
Correct |
38 ms |
4172 KB |
Output is correct |
53 |
Correct |
40 ms |
4168 KB |
Output is correct |
54 |
Correct |
39 ms |
4140 KB |
Output is correct |
55 |
Correct |
43 ms |
4196 KB |
Output is correct |
56 |
Correct |
40 ms |
4184 KB |
Output is correct |
57 |
Correct |
37 ms |
4180 KB |
Output is correct |
58 |
Correct |
39 ms |
4188 KB |
Output is correct |
59 |
Correct |
40 ms |
4140 KB |
Output is correct |
60 |
Correct |
40 ms |
4144 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
2644 KB |
Output is correct |
2 |
Correct |
2 ms |
2644 KB |
Output is correct |
3 |
Correct |
3 ms |
2644 KB |
Output is correct |
4 |
Correct |
2 ms |
2708 KB |
Output is correct |
5 |
Correct |
2 ms |
2644 KB |
Output is correct |
6 |
Correct |
2 ms |
2644 KB |
Output is correct |
7 |
Correct |
3 ms |
2628 KB |
Output is correct |
8 |
Correct |
3 ms |
2644 KB |
Output is correct |
9 |
Correct |
2 ms |
2644 KB |
Output is correct |
10 |
Correct |
2 ms |
2636 KB |
Output is correct |
11 |
Correct |
2 ms |
2644 KB |
Output is correct |
12 |
Correct |
2 ms |
2712 KB |
Output is correct |
13 |
Correct |
3 ms |
2664 KB |
Output is correct |
14 |
Correct |
17 ms |
3284 KB |
Output is correct |
15 |
Correct |
30 ms |
3912 KB |
Output is correct |
16 |
Correct |
46 ms |
4324 KB |
Output is correct |
17 |
Correct |
48 ms |
4664 KB |
Output is correct |
18 |
Correct |
50 ms |
4324 KB |
Output is correct |
19 |
Correct |
44 ms |
4340 KB |
Output is correct |
20 |
Correct |
45 ms |
4488 KB |
Output is correct |
21 |
Correct |
47 ms |
4280 KB |
Output is correct |
22 |
Correct |
44 ms |
4276 KB |
Output is correct |
23 |
Correct |
46 ms |
4300 KB |
Output is correct |
24 |
Correct |
44 ms |
4316 KB |
Output is correct |
25 |
Correct |
50 ms |
4372 KB |
Output is correct |
26 |
Correct |
2 ms |
2644 KB |
Output is correct |
27 |
Correct |
2 ms |
2644 KB |
Output is correct |
28 |
Correct |
4 ms |
2680 KB |
Output is correct |
29 |
Correct |
18 ms |
3268 KB |
Output is correct |
30 |
Correct |
33 ms |
3768 KB |
Output is correct |
31 |
Correct |
51 ms |
4360 KB |
Output is correct |
32 |
Correct |
49 ms |
4220 KB |
Output is correct |
33 |
Correct |
55 ms |
4300 KB |
Output is correct |
34 |
Correct |
52 ms |
4212 KB |
Output is correct |
35 |
Correct |
49 ms |
4232 KB |
Output is correct |
36 |
Correct |
53 ms |
4244 KB |
Output is correct |
37 |
Correct |
53 ms |
4384 KB |
Output is correct |
38 |
Correct |
47 ms |
4388 KB |
Output is correct |
39 |
Correct |
54 ms |
4224 KB |
Output is correct |
40 |
Correct |
54 ms |
4172 KB |
Output is correct |
41 |
Correct |
2 ms |
2684 KB |
Output is correct |
42 |
Correct |
2 ms |
2644 KB |
Output is correct |
43 |
Correct |
2 ms |
2644 KB |
Output is correct |
44 |
Correct |
3 ms |
2736 KB |
Output is correct |
45 |
Correct |
3 ms |
2772 KB |
Output is correct |
46 |
Correct |
3 ms |
2772 KB |
Output is correct |
47 |
Correct |
7 ms |
3028 KB |
Output is correct |
48 |
Correct |
8 ms |
2944 KB |
Output is correct |
49 |
Correct |
16 ms |
3328 KB |
Output is correct |
50 |
Correct |
27 ms |
3712 KB |
Output is correct |
51 |
Correct |
38 ms |
4244 KB |
Output is correct |
52 |
Correct |
38 ms |
4172 KB |
Output is correct |
53 |
Correct |
45 ms |
4148 KB |
Output is correct |
54 |
Correct |
41 ms |
4076 KB |
Output is correct |
55 |
Correct |
49 ms |
4132 KB |
Output is correct |
56 |
Correct |
38 ms |
4168 KB |
Output is correct |
57 |
Correct |
37 ms |
4112 KB |
Output is correct |
58 |
Correct |
40 ms |
4144 KB |
Output is correct |
59 |
Correct |
45 ms |
4236 KB |
Output is correct |
60 |
Correct |
42 ms |
4164 KB |
Output is correct |
61 |
Correct |
40 ms |
4112 KB |
Output is correct |
62 |
Correct |
38 ms |
4172 KB |
Output is correct |
63 |
Correct |
40 ms |
4168 KB |
Output is correct |
64 |
Correct |
39 ms |
4140 KB |
Output is correct |
65 |
Correct |
43 ms |
4196 KB |
Output is correct |
66 |
Correct |
40 ms |
4184 KB |
Output is correct |
67 |
Correct |
37 ms |
4180 KB |
Output is correct |
68 |
Correct |
39 ms |
4188 KB |
Output is correct |
69 |
Correct |
40 ms |
4140 KB |
Output is correct |
70 |
Correct |
40 ms |
4144 KB |
Output is correct |
71 |
Correct |
9 ms |
3016 KB |
Output is correct |
72 |
Correct |
7 ms |
2952 KB |
Output is correct |
73 |
Correct |
7 ms |
3012 KB |
Output is correct |
74 |
Correct |
6 ms |
3024 KB |
Output is correct |
75 |
Correct |
6 ms |
3040 KB |
Output is correct |
76 |
Correct |
9 ms |
3324 KB |
Output is correct |
77 |
Correct |
10 ms |
3284 KB |
Output is correct |
78 |
Correct |
10 ms |
3276 KB |
Output is correct |
79 |
Correct |
10 ms |
3344 KB |
Output is correct |
80 |
Correct |
12 ms |
3284 KB |
Output is correct |
81 |
Correct |
18 ms |
3704 KB |
Output is correct |
82 |
Correct |
18 ms |
3768 KB |
Output is correct |
83 |
Correct |
20 ms |
3784 KB |
Output is correct |
84 |
Correct |
16 ms |
3704 KB |
Output is correct |
85 |
Correct |
18 ms |
3740 KB |
Output is correct |
86 |
Correct |
20 ms |
3796 KB |
Output is correct |
87 |
Correct |
19 ms |
3796 KB |
Output is correct |
88 |
Correct |
19 ms |
3744 KB |
Output is correct |
89 |
Correct |
24 ms |
3772 KB |
Output is correct |
90 |
Correct |
20 ms |
3804 KB |
Output is correct |
91 |
Correct |
29 ms |
4404 KB |
Output is correct |
92 |
Correct |
27 ms |
4400 KB |
Output is correct |
93 |
Correct |
27 ms |
4512 KB |
Output is correct |
94 |
Correct |
29 ms |
4412 KB |
Output is correct |
95 |
Correct |
31 ms |
4616 KB |
Output is correct |
96 |
Correct |
34 ms |
5376 KB |
Output is correct |
97 |
Correct |
33 ms |
4776 KB |
Output is correct |
98 |
Correct |
32 ms |
4828 KB |
Output is correct |
99 |
Correct |
33 ms |
4812 KB |
Output is correct |
100 |
Correct |
33 ms |
5316 KB |
Output is correct |
101 |
Correct |
34 ms |
4868 KB |
Output is correct |
102 |
Correct |
32 ms |
5324 KB |
Output is correct |
103 |
Correct |
33 ms |
4848 KB |
Output is correct |
104 |
Correct |
31 ms |
4792 KB |
Output is correct |
105 |
Correct |
37 ms |
4940 KB |
Output is correct |
106 |
Correct |
33 ms |
5164 KB |
Output is correct |
107 |
Correct |
32 ms |
5040 KB |
Output is correct |
108 |
Correct |
35 ms |
5640 KB |
Output is correct |
109 |
Correct |
33 ms |
5588 KB |
Output is correct |
110 |
Correct |
33 ms |
5480 KB |
Output is correct |
111 |
Correct |
32 ms |
5600 KB |
Output is correct |
112 |
Correct |
34 ms |
5452 KB |
Output is correct |
113 |
Correct |
30 ms |
5080 KB |
Output is correct |
114 |
Correct |
35 ms |
5520 KB |
Output is correct |
115 |
Correct |
34 ms |
5492 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
2644 KB |
Output is correct |
2 |
Correct |
2 ms |
2644 KB |
Output is correct |
3 |
Correct |
3 ms |
2644 KB |
Output is correct |
4 |
Correct |
2 ms |
2708 KB |
Output is correct |
5 |
Correct |
2 ms |
2644 KB |
Output is correct |
6 |
Correct |
2 ms |
2644 KB |
Output is correct |
7 |
Correct |
3 ms |
2628 KB |
Output is correct |
8 |
Correct |
3 ms |
2644 KB |
Output is correct |
9 |
Correct |
2 ms |
2644 KB |
Output is correct |
10 |
Correct |
2 ms |
2636 KB |
Output is correct |
11 |
Correct |
2 ms |
2644 KB |
Output is correct |
12 |
Correct |
2 ms |
2712 KB |
Output is correct |
13 |
Correct |
3 ms |
2664 KB |
Output is correct |
14 |
Correct |
17 ms |
3284 KB |
Output is correct |
15 |
Correct |
30 ms |
3912 KB |
Output is correct |
16 |
Correct |
46 ms |
4324 KB |
Output is correct |
17 |
Correct |
48 ms |
4664 KB |
Output is correct |
18 |
Correct |
50 ms |
4324 KB |
Output is correct |
19 |
Correct |
44 ms |
4340 KB |
Output is correct |
20 |
Correct |
45 ms |
4488 KB |
Output is correct |
21 |
Correct |
47 ms |
4280 KB |
Output is correct |
22 |
Correct |
44 ms |
4276 KB |
Output is correct |
23 |
Correct |
46 ms |
4300 KB |
Output is correct |
24 |
Correct |
44 ms |
4316 KB |
Output is correct |
25 |
Correct |
50 ms |
4372 KB |
Output is correct |
26 |
Correct |
2 ms |
2644 KB |
Output is correct |
27 |
Correct |
2 ms |
2644 KB |
Output is correct |
28 |
Correct |
4 ms |
2680 KB |
Output is correct |
29 |
Correct |
18 ms |
3268 KB |
Output is correct |
30 |
Correct |
33 ms |
3768 KB |
Output is correct |
31 |
Correct |
51 ms |
4360 KB |
Output is correct |
32 |
Correct |
49 ms |
4220 KB |
Output is correct |
33 |
Correct |
55 ms |
4300 KB |
Output is correct |
34 |
Correct |
52 ms |
4212 KB |
Output is correct |
35 |
Correct |
49 ms |
4232 KB |
Output is correct |
36 |
Correct |
53 ms |
4244 KB |
Output is correct |
37 |
Correct |
53 ms |
4384 KB |
Output is correct |
38 |
Correct |
47 ms |
4388 KB |
Output is correct |
39 |
Correct |
54 ms |
4224 KB |
Output is correct |
40 |
Correct |
54 ms |
4172 KB |
Output is correct |
41 |
Correct |
2 ms |
2684 KB |
Output is correct |
42 |
Correct |
2 ms |
2644 KB |
Output is correct |
43 |
Correct |
2 ms |
2644 KB |
Output is correct |
44 |
Correct |
3 ms |
2736 KB |
Output is correct |
45 |
Correct |
3 ms |
2772 KB |
Output is correct |
46 |
Correct |
3 ms |
2772 KB |
Output is correct |
47 |
Correct |
7 ms |
3028 KB |
Output is correct |
48 |
Correct |
8 ms |
2944 KB |
Output is correct |
49 |
Correct |
16 ms |
3328 KB |
Output is correct |
50 |
Correct |
27 ms |
3712 KB |
Output is correct |
51 |
Correct |
38 ms |
4244 KB |
Output is correct |
52 |
Correct |
38 ms |
4172 KB |
Output is correct |
53 |
Correct |
45 ms |
4148 KB |
Output is correct |
54 |
Correct |
41 ms |
4076 KB |
Output is correct |
55 |
Correct |
49 ms |
4132 KB |
Output is correct |
56 |
Correct |
38 ms |
4168 KB |
Output is correct |
57 |
Correct |
37 ms |
4112 KB |
Output is correct |
58 |
Correct |
40 ms |
4144 KB |
Output is correct |
59 |
Correct |
45 ms |
4236 KB |
Output is correct |
60 |
Correct |
42 ms |
4164 KB |
Output is correct |
61 |
Correct |
40 ms |
4112 KB |
Output is correct |
62 |
Correct |
38 ms |
4172 KB |
Output is correct |
63 |
Correct |
40 ms |
4168 KB |
Output is correct |
64 |
Correct |
39 ms |
4140 KB |
Output is correct |
65 |
Correct |
43 ms |
4196 KB |
Output is correct |
66 |
Correct |
40 ms |
4184 KB |
Output is correct |
67 |
Correct |
37 ms |
4180 KB |
Output is correct |
68 |
Correct |
39 ms |
4188 KB |
Output is correct |
69 |
Correct |
40 ms |
4140 KB |
Output is correct |
70 |
Correct |
40 ms |
4144 KB |
Output is correct |
71 |
Correct |
9 ms |
3016 KB |
Output is correct |
72 |
Correct |
7 ms |
2952 KB |
Output is correct |
73 |
Correct |
7 ms |
3012 KB |
Output is correct |
74 |
Correct |
6 ms |
3024 KB |
Output is correct |
75 |
Correct |
6 ms |
3040 KB |
Output is correct |
76 |
Correct |
9 ms |
3324 KB |
Output is correct |
77 |
Correct |
10 ms |
3284 KB |
Output is correct |
78 |
Correct |
10 ms |
3276 KB |
Output is correct |
79 |
Correct |
10 ms |
3344 KB |
Output is correct |
80 |
Correct |
12 ms |
3284 KB |
Output is correct |
81 |
Correct |
18 ms |
3704 KB |
Output is correct |
82 |
Correct |
18 ms |
3768 KB |
Output is correct |
83 |
Correct |
20 ms |
3784 KB |
Output is correct |
84 |
Correct |
16 ms |
3704 KB |
Output is correct |
85 |
Correct |
18 ms |
3740 KB |
Output is correct |
86 |
Correct |
20 ms |
3796 KB |
Output is correct |
87 |
Correct |
19 ms |
3796 KB |
Output is correct |
88 |
Correct |
19 ms |
3744 KB |
Output is correct |
89 |
Correct |
24 ms |
3772 KB |
Output is correct |
90 |
Correct |
20 ms |
3804 KB |
Output is correct |
91 |
Correct |
29 ms |
4404 KB |
Output is correct |
92 |
Correct |
27 ms |
4400 KB |
Output is correct |
93 |
Correct |
27 ms |
4512 KB |
Output is correct |
94 |
Correct |
29 ms |
4412 KB |
Output is correct |
95 |
Correct |
31 ms |
4616 KB |
Output is correct |
96 |
Correct |
34 ms |
5376 KB |
Output is correct |
97 |
Correct |
33 ms |
4776 KB |
Output is correct |
98 |
Correct |
32 ms |
4828 KB |
Output is correct |
99 |
Correct |
33 ms |
4812 KB |
Output is correct |
100 |
Correct |
33 ms |
5316 KB |
Output is correct |
101 |
Correct |
34 ms |
4868 KB |
Output is correct |
102 |
Correct |
32 ms |
5324 KB |
Output is correct |
103 |
Correct |
33 ms |
4848 KB |
Output is correct |
104 |
Correct |
31 ms |
4792 KB |
Output is correct |
105 |
Correct |
37 ms |
4940 KB |
Output is correct |
106 |
Correct |
33 ms |
5164 KB |
Output is correct |
107 |
Correct |
32 ms |
5040 KB |
Output is correct |
108 |
Correct |
35 ms |
5640 KB |
Output is correct |
109 |
Correct |
33 ms |
5588 KB |
Output is correct |
110 |
Correct |
33 ms |
5480 KB |
Output is correct |
111 |
Correct |
32 ms |
5600 KB |
Output is correct |
112 |
Correct |
34 ms |
5452 KB |
Output is correct |
113 |
Correct |
30 ms |
5080 KB |
Output is correct |
114 |
Correct |
35 ms |
5520 KB |
Output is correct |
115 |
Correct |
34 ms |
5492 KB |
Output is correct |
116 |
Correct |
2730 ms |
6928 KB |
Output is correct |
117 |
Correct |
2033 ms |
7040 KB |
Output is correct |
118 |
Correct |
3273 ms |
7412 KB |
Output is correct |
119 |
Correct |
1228 ms |
7560 KB |
Output is correct |
120 |
Correct |
645 ms |
7128 KB |
Output is correct |
121 |
Correct |
1114 ms |
7852 KB |
Output is correct |
122 |
Correct |
601 ms |
7356 KB |
Output is correct |
123 |
Correct |
2029 ms |
7800 KB |
Output is correct |
124 |
Correct |
575 ms |
7676 KB |
Output is correct |
125 |
Correct |
434 ms |
7676 KB |
Output is correct |
126 |
Correct |
6671 ms |
7936 KB |
Output is correct |
127 |
Correct |
6620 ms |
7936 KB |
Output is correct |
128 |
Correct |
6583 ms |
7936 KB |
Output is correct |
129 |
Correct |
6589 ms |
7932 KB |
Output is correct |
130 |
Correct |
6474 ms |
7968 KB |
Output is correct |
131 |
Correct |
5453 ms |
8064 KB |
Output is correct |
132 |
Correct |
5432 ms |
8064 KB |
Output is correct |
133 |
Correct |
5795 ms |
8164 KB |
Output is correct |
134 |
Correct |
5407 ms |
8060 KB |
Output is correct |
135 |
Correct |
5464 ms |
8064 KB |
Output is correct |
136 |
Correct |
5210 ms |
8068 KB |
Output is correct |
137 |
Correct |
5471 ms |
8064 KB |
Output is correct |
138 |
Correct |
5279 ms |
8028 KB |
Output is correct |
139 |
Correct |
5452 ms |
8056 KB |
Output is correct |
140 |
Correct |
5363 ms |
8068 KB |
Output is correct |
141 |
Correct |
3113 ms |
8064 KB |
Output is correct |
142 |
Correct |
3285 ms |
8064 KB |
Output is correct |
143 |
Correct |
3270 ms |
8060 KB |
Output is correct |
144 |
Correct |
3235 ms |
8072 KB |
Output is correct |
145 |
Correct |
3153 ms |
8068 KB |
Output is correct |
146 |
Correct |
802 ms |
8068 KB |
Output is correct |
147 |
Correct |
796 ms |
8064 KB |
Output is correct |
148 |
Correct |
855 ms |
8060 KB |
Output is correct |
149 |
Correct |
776 ms |
8060 KB |
Output is correct |
150 |
Correct |
791 ms |
8144 KB |
Output is correct |
151 |
Correct |
629 ms |
8064 KB |
Output is correct |
152 |
Correct |
622 ms |
8016 KB |
Output is correct |
153 |
Correct |
642 ms |
8068 KB |
Output is correct |
154 |
Correct |
632 ms |
8144 KB |
Output is correct |
155 |
Correct |
610 ms |
8072 KB |
Output is correct |
156 |
Correct |
2767 ms |
8064 KB |
Output is correct |
157 |
Correct |
2663 ms |
8068 KB |
Output is correct |
158 |
Correct |
2751 ms |
8068 KB |
Output is correct |
159 |
Correct |
2618 ms |
8060 KB |
Output is correct |
160 |
Correct |
2650 ms |
8064 KB |
Output is correct |
161 |
Correct |
2621 ms |
8068 KB |
Output is correct |
162 |
Correct |
2689 ms |
8072 KB |
Output is correct |
163 |
Correct |
2722 ms |
8064 KB |
Output is correct |
164 |
Correct |
2717 ms |
8140 KB |
Output is correct |
165 |
Correct |
2774 ms |
8068 KB |
Output is correct |
166 |
Correct |
4715 ms |
8068 KB |
Output is correct |
167 |
Correct |
4793 ms |
8076 KB |
Output is correct |
168 |
Correct |
4809 ms |
8072 KB |
Output is correct |
169 |
Correct |
4824 ms |
8064 KB |
Output is correct |
170 |
Correct |
4833 ms |
8068 KB |
Output is correct |
171 |
Correct |
6135 ms |
7936 KB |
Output is correct |
172 |
Correct |
6097 ms |
7936 KB |
Output is correct |
173 |
Correct |
6145 ms |
7936 KB |
Output is correct |
174 |
Correct |
6076 ms |
7940 KB |
Output is correct |
175 |
Correct |
6113 ms |
7940 KB |
Output is correct |