#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
#define int long long
using namespace std;
const int MAXN = 3e5 + 11;
const int MAXQ = 5e4 + 11;
const int SQ = 1000;
int a[MAXN];
int ans[MAXQ];
int c[MAXN], cc[MAXN];
int s0, s1, s2;
set<int> s;
void add(int x){
s0 -= c[x] * (c[x] + 1) / 2;
s1 -= c[x];
s2 -= c[x] * c[x];
cc[c[x]]--; if(cc[c[x]] == 0) s.erase(c[x]);
c[x]++;
s0 += c[x] * (c[x] + 1) / 2;
s1 += c[x];
s2 += c[x] * c[x];
cc[c[x]]++; if(cc[c[x]] == 1) s.insert(c[x]);
}
void rem(int x){
s0 -= c[x] * (c[x] + 1) / 2;
s1 -= c[x];
s2 -= c[x] * c[x];
cc[c[x]]--; if(cc[c[x]] == 0) s.erase(c[x]);
c[x]--;
s0 += c[x] * (c[x] + 1) / 2;
s1 += c[x];
s2 += c[x] * c[x];
cc[c[x]]++; if(cc[c[x]] == 1) s.insert(c[x]);
}
int f(int x0, int d, int y, int n){
int t1 = n * d * (x0 * 2 + (d - 1) * y) / 2;
int t2 = d * x0 * x0;
int t3 = (d - 1) * d * x0 * y;
int t4 = (d - 1) * d * (d * 2 - 1) / 6 * y * y;
return t1 - t2 - t3 - t4;
}
struct query{
int l, r, id;
};
int32_t main(){
int n, q; cin >> n >> q;
for(int i = 0; i < n; i++){
cin >> a[i];
}
vector<query> Q;
for(int i = 0; i < q; i++){
int l, r; cin >> l >> r; --l; --r; Q.push_back({l, r, i});
}
sort(Q.begin(), Q.end(), [](query a, query b){
if(a.l / SQ != b.l / SQ) return a.l / SQ < b.l / SQ;
return a.l / SQ % 2 ? a.r > b.r : a.r < b.r;
});
int l = 0, r = -1;
for(auto [ql, qr, id] : Q){
while(l > ql) add(a[--l]);
while(r < qr) add(a[++r]);
while(l < ql) rem(a[l++]);
while(r > qr) rem(a[r--]);
int res = s0 + (s1 * s1 - s2) / 2;
int cl = 0, cr = 0;
for(auto y : s){
if(cl > cr) swap(cl, cr);
int cnt = cc[y];
int d = min(cnt, (cr - cl) / y);
res += f(cl, d, y, s1); cl += d * y; cnt -= d;
res += f(cl, (cnt + 1) / 2, y, s1);
res += f(cr, cnt / 2, y, s1);
cl += ((cnt + 1) / 2) * y, cr += (cnt / 2) * y;
}
res += cl * (s1 - cl);
ans[id] = res;
}
for(int i = 0; i < q; i++){
cout << ans[i] << '\n';
}
}
Compilation message
diversity.cpp: In function 'int32_t main()':
diversity.cpp:67:14: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
67 | for(auto [ql, qr, id] : Q){
| ^
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
1 ms |
212 KB |
Output is correct |
10 |
Correct |
0 ms |
340 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
3 |
Correct |
2 ms |
340 KB |
Output is correct |
4 |
Correct |
18 ms |
1208 KB |
Output is correct |
5 |
Correct |
36 ms |
2432 KB |
Output is correct |
6 |
Correct |
57 ms |
3100 KB |
Output is correct |
7 |
Correct |
53 ms |
3904 KB |
Output is correct |
8 |
Correct |
56 ms |
2988 KB |
Output is correct |
9 |
Correct |
56 ms |
3020 KB |
Output is correct |
10 |
Correct |
56 ms |
3364 KB |
Output is correct |
11 |
Correct |
56 ms |
3148 KB |
Output is correct |
12 |
Correct |
57 ms |
3028 KB |
Output is correct |
13 |
Correct |
56 ms |
3004 KB |
Output is correct |
14 |
Correct |
55 ms |
3148 KB |
Output is correct |
15 |
Correct |
57 ms |
3124 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
3 |
Correct |
2 ms |
340 KB |
Output is correct |
4 |
Correct |
18 ms |
1208 KB |
Output is correct |
5 |
Correct |
36 ms |
2432 KB |
Output is correct |
6 |
Correct |
57 ms |
3100 KB |
Output is correct |
7 |
Correct |
53 ms |
3904 KB |
Output is correct |
8 |
Correct |
56 ms |
2988 KB |
Output is correct |
9 |
Correct |
56 ms |
3020 KB |
Output is correct |
10 |
Correct |
56 ms |
3364 KB |
Output is correct |
11 |
Correct |
56 ms |
3148 KB |
Output is correct |
12 |
Correct |
57 ms |
3028 KB |
Output is correct |
13 |
Correct |
56 ms |
3004 KB |
Output is correct |
14 |
Correct |
55 ms |
3148 KB |
Output is correct |
15 |
Correct |
57 ms |
3124 KB |
Output is correct |
16 |
Correct |
1 ms |
212 KB |
Output is correct |
17 |
Correct |
1 ms |
212 KB |
Output is correct |
18 |
Correct |
2 ms |
340 KB |
Output is correct |
19 |
Correct |
21 ms |
1200 KB |
Output is correct |
20 |
Correct |
42 ms |
2068 KB |
Output is correct |
21 |
Correct |
62 ms |
3040 KB |
Output is correct |
22 |
Correct |
63 ms |
2936 KB |
Output is correct |
23 |
Correct |
62 ms |
3012 KB |
Output is correct |
24 |
Correct |
64 ms |
3148 KB |
Output is correct |
25 |
Correct |
76 ms |
2936 KB |
Output is correct |
26 |
Correct |
63 ms |
2944 KB |
Output is correct |
27 |
Correct |
63 ms |
2980 KB |
Output is correct |
28 |
Correct |
61 ms |
3260 KB |
Output is correct |
29 |
Correct |
61 ms |
2912 KB |
Output is correct |
30 |
Correct |
64 ms |
2892 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
3 |
Correct |
2 ms |
340 KB |
Output is correct |
4 |
Correct |
18 ms |
1208 KB |
Output is correct |
5 |
Correct |
36 ms |
2432 KB |
Output is correct |
6 |
Correct |
57 ms |
3100 KB |
Output is correct |
7 |
Correct |
53 ms |
3904 KB |
Output is correct |
8 |
Correct |
56 ms |
2988 KB |
Output is correct |
9 |
Correct |
56 ms |
3020 KB |
Output is correct |
10 |
Correct |
56 ms |
3364 KB |
Output is correct |
11 |
Correct |
56 ms |
3148 KB |
Output is correct |
12 |
Correct |
57 ms |
3028 KB |
Output is correct |
13 |
Correct |
56 ms |
3004 KB |
Output is correct |
14 |
Correct |
55 ms |
3148 KB |
Output is correct |
15 |
Correct |
57 ms |
3124 KB |
Output is correct |
16 |
Correct |
1 ms |
212 KB |
Output is correct |
17 |
Correct |
1 ms |
212 KB |
Output is correct |
18 |
Correct |
2 ms |
340 KB |
Output is correct |
19 |
Correct |
21 ms |
1200 KB |
Output is correct |
20 |
Correct |
42 ms |
2068 KB |
Output is correct |
21 |
Correct |
62 ms |
3040 KB |
Output is correct |
22 |
Correct |
63 ms |
2936 KB |
Output is correct |
23 |
Correct |
62 ms |
3012 KB |
Output is correct |
24 |
Correct |
64 ms |
3148 KB |
Output is correct |
25 |
Correct |
76 ms |
2936 KB |
Output is correct |
26 |
Correct |
63 ms |
2944 KB |
Output is correct |
27 |
Correct |
63 ms |
2980 KB |
Output is correct |
28 |
Correct |
61 ms |
3260 KB |
Output is correct |
29 |
Correct |
61 ms |
2912 KB |
Output is correct |
30 |
Correct |
64 ms |
2892 KB |
Output is correct |
31 |
Correct |
1 ms |
212 KB |
Output is correct |
32 |
Correct |
1 ms |
300 KB |
Output is correct |
33 |
Correct |
1 ms |
212 KB |
Output is correct |
34 |
Correct |
2 ms |
340 KB |
Output is correct |
35 |
Correct |
2 ms |
340 KB |
Output is correct |
36 |
Correct |
2 ms |
340 KB |
Output is correct |
37 |
Correct |
12 ms |
724 KB |
Output is correct |
38 |
Correct |
9 ms |
680 KB |
Output is correct |
39 |
Correct |
18 ms |
1108 KB |
Output is correct |
40 |
Correct |
38 ms |
1888 KB |
Output is correct |
41 |
Correct |
60 ms |
2688 KB |
Output is correct |
42 |
Correct |
61 ms |
2636 KB |
Output is correct |
43 |
Correct |
60 ms |
2584 KB |
Output is correct |
44 |
Correct |
61 ms |
2676 KB |
Output is correct |
45 |
Correct |
60 ms |
2636 KB |
Output is correct |
46 |
Correct |
60 ms |
2676 KB |
Output is correct |
47 |
Correct |
60 ms |
2696 KB |
Output is correct |
48 |
Correct |
61 ms |
2592 KB |
Output is correct |
49 |
Correct |
60 ms |
2632 KB |
Output is correct |
50 |
Correct |
66 ms |
2688 KB |
Output is correct |
51 |
Correct |
59 ms |
2688 KB |
Output is correct |
52 |
Correct |
59 ms |
2636 KB |
Output is correct |
53 |
Correct |
60 ms |
2636 KB |
Output is correct |
54 |
Correct |
61 ms |
2600 KB |
Output is correct |
55 |
Correct |
60 ms |
2628 KB |
Output is correct |
56 |
Correct |
60 ms |
2688 KB |
Output is correct |
57 |
Correct |
68 ms |
2636 KB |
Output is correct |
58 |
Correct |
60 ms |
2692 KB |
Output is correct |
59 |
Correct |
61 ms |
2668 KB |
Output is correct |
60 |
Correct |
60 ms |
2684 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
1 ms |
212 KB |
Output is correct |
10 |
Correct |
0 ms |
340 KB |
Output is correct |
11 |
Correct |
0 ms |
212 KB |
Output is correct |
12 |
Correct |
1 ms |
340 KB |
Output is correct |
13 |
Correct |
2 ms |
340 KB |
Output is correct |
14 |
Correct |
18 ms |
1208 KB |
Output is correct |
15 |
Correct |
36 ms |
2432 KB |
Output is correct |
16 |
Correct |
57 ms |
3100 KB |
Output is correct |
17 |
Correct |
53 ms |
3904 KB |
Output is correct |
18 |
Correct |
56 ms |
2988 KB |
Output is correct |
19 |
Correct |
56 ms |
3020 KB |
Output is correct |
20 |
Correct |
56 ms |
3364 KB |
Output is correct |
21 |
Correct |
56 ms |
3148 KB |
Output is correct |
22 |
Correct |
57 ms |
3028 KB |
Output is correct |
23 |
Correct |
56 ms |
3004 KB |
Output is correct |
24 |
Correct |
55 ms |
3148 KB |
Output is correct |
25 |
Correct |
57 ms |
3124 KB |
Output is correct |
26 |
Correct |
1 ms |
212 KB |
Output is correct |
27 |
Correct |
1 ms |
212 KB |
Output is correct |
28 |
Correct |
2 ms |
340 KB |
Output is correct |
29 |
Correct |
21 ms |
1200 KB |
Output is correct |
30 |
Correct |
42 ms |
2068 KB |
Output is correct |
31 |
Correct |
62 ms |
3040 KB |
Output is correct |
32 |
Correct |
63 ms |
2936 KB |
Output is correct |
33 |
Correct |
62 ms |
3012 KB |
Output is correct |
34 |
Correct |
64 ms |
3148 KB |
Output is correct |
35 |
Correct |
76 ms |
2936 KB |
Output is correct |
36 |
Correct |
63 ms |
2944 KB |
Output is correct |
37 |
Correct |
63 ms |
2980 KB |
Output is correct |
38 |
Correct |
61 ms |
3260 KB |
Output is correct |
39 |
Correct |
61 ms |
2912 KB |
Output is correct |
40 |
Correct |
64 ms |
2892 KB |
Output is correct |
41 |
Correct |
1 ms |
212 KB |
Output is correct |
42 |
Correct |
1 ms |
300 KB |
Output is correct |
43 |
Correct |
1 ms |
212 KB |
Output is correct |
44 |
Correct |
2 ms |
340 KB |
Output is correct |
45 |
Correct |
2 ms |
340 KB |
Output is correct |
46 |
Correct |
2 ms |
340 KB |
Output is correct |
47 |
Correct |
12 ms |
724 KB |
Output is correct |
48 |
Correct |
9 ms |
680 KB |
Output is correct |
49 |
Correct |
18 ms |
1108 KB |
Output is correct |
50 |
Correct |
38 ms |
1888 KB |
Output is correct |
51 |
Correct |
60 ms |
2688 KB |
Output is correct |
52 |
Correct |
61 ms |
2636 KB |
Output is correct |
53 |
Correct |
60 ms |
2584 KB |
Output is correct |
54 |
Correct |
61 ms |
2676 KB |
Output is correct |
55 |
Correct |
60 ms |
2636 KB |
Output is correct |
56 |
Correct |
60 ms |
2676 KB |
Output is correct |
57 |
Correct |
60 ms |
2696 KB |
Output is correct |
58 |
Correct |
61 ms |
2592 KB |
Output is correct |
59 |
Correct |
60 ms |
2632 KB |
Output is correct |
60 |
Correct |
66 ms |
2688 KB |
Output is correct |
61 |
Correct |
59 ms |
2688 KB |
Output is correct |
62 |
Correct |
59 ms |
2636 KB |
Output is correct |
63 |
Correct |
60 ms |
2636 KB |
Output is correct |
64 |
Correct |
61 ms |
2600 KB |
Output is correct |
65 |
Correct |
60 ms |
2628 KB |
Output is correct |
66 |
Correct |
60 ms |
2688 KB |
Output is correct |
67 |
Correct |
68 ms |
2636 KB |
Output is correct |
68 |
Correct |
60 ms |
2692 KB |
Output is correct |
69 |
Correct |
61 ms |
2668 KB |
Output is correct |
70 |
Correct |
60 ms |
2684 KB |
Output is correct |
71 |
Correct |
9 ms |
724 KB |
Output is correct |
72 |
Correct |
9 ms |
652 KB |
Output is correct |
73 |
Correct |
9 ms |
712 KB |
Output is correct |
74 |
Correct |
11 ms |
724 KB |
Output is correct |
75 |
Correct |
9 ms |
724 KB |
Output is correct |
76 |
Correct |
19 ms |
1108 KB |
Output is correct |
77 |
Correct |
23 ms |
1036 KB |
Output is correct |
78 |
Correct |
18 ms |
1144 KB |
Output is correct |
79 |
Correct |
18 ms |
1108 KB |
Output is correct |
80 |
Correct |
18 ms |
1052 KB |
Output is correct |
81 |
Correct |
36 ms |
1892 KB |
Output is correct |
82 |
Correct |
37 ms |
1844 KB |
Output is correct |
83 |
Correct |
37 ms |
1876 KB |
Output is correct |
84 |
Correct |
36 ms |
1888 KB |
Output is correct |
85 |
Correct |
40 ms |
1856 KB |
Output is correct |
86 |
Correct |
39 ms |
1968 KB |
Output is correct |
87 |
Correct |
38 ms |
2036 KB |
Output is correct |
88 |
Correct |
39 ms |
1992 KB |
Output is correct |
89 |
Correct |
39 ms |
1952 KB |
Output is correct |
90 |
Correct |
42 ms |
1928 KB |
Output is correct |
91 |
Correct |
61 ms |
3400 KB |
Output is correct |
92 |
Correct |
62 ms |
3404 KB |
Output is correct |
93 |
Correct |
62 ms |
3424 KB |
Output is correct |
94 |
Correct |
61 ms |
3380 KB |
Output is correct |
95 |
Correct |
61 ms |
3408 KB |
Output is correct |
96 |
Correct |
65 ms |
4212 KB |
Output is correct |
97 |
Correct |
66 ms |
4100 KB |
Output is correct |
98 |
Correct |
66 ms |
4132 KB |
Output is correct |
99 |
Correct |
69 ms |
4192 KB |
Output is correct |
100 |
Correct |
65 ms |
4164 KB |
Output is correct |
101 |
Correct |
69 ms |
4172 KB |
Output is correct |
102 |
Correct |
65 ms |
4172 KB |
Output is correct |
103 |
Correct |
69 ms |
4172 KB |
Output is correct |
104 |
Correct |
66 ms |
4136 KB |
Output is correct |
105 |
Correct |
65 ms |
4168 KB |
Output is correct |
106 |
Correct |
66 ms |
4556 KB |
Output is correct |
107 |
Correct |
67 ms |
4516 KB |
Output is correct |
108 |
Correct |
71 ms |
4636 KB |
Output is correct |
109 |
Correct |
67 ms |
4524 KB |
Output is correct |
110 |
Correct |
66 ms |
4520 KB |
Output is correct |
111 |
Correct |
76 ms |
4556 KB |
Output is correct |
112 |
Correct |
66 ms |
4556 KB |
Output is correct |
113 |
Correct |
66 ms |
4532 KB |
Output is correct |
114 |
Correct |
67 ms |
4512 KB |
Output is correct |
115 |
Correct |
73 ms |
4548 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
1 ms |
212 KB |
Output is correct |
10 |
Correct |
0 ms |
340 KB |
Output is correct |
11 |
Correct |
0 ms |
212 KB |
Output is correct |
12 |
Correct |
1 ms |
340 KB |
Output is correct |
13 |
Correct |
2 ms |
340 KB |
Output is correct |
14 |
Correct |
18 ms |
1208 KB |
Output is correct |
15 |
Correct |
36 ms |
2432 KB |
Output is correct |
16 |
Correct |
57 ms |
3100 KB |
Output is correct |
17 |
Correct |
53 ms |
3904 KB |
Output is correct |
18 |
Correct |
56 ms |
2988 KB |
Output is correct |
19 |
Correct |
56 ms |
3020 KB |
Output is correct |
20 |
Correct |
56 ms |
3364 KB |
Output is correct |
21 |
Correct |
56 ms |
3148 KB |
Output is correct |
22 |
Correct |
57 ms |
3028 KB |
Output is correct |
23 |
Correct |
56 ms |
3004 KB |
Output is correct |
24 |
Correct |
55 ms |
3148 KB |
Output is correct |
25 |
Correct |
57 ms |
3124 KB |
Output is correct |
26 |
Correct |
1 ms |
212 KB |
Output is correct |
27 |
Correct |
1 ms |
212 KB |
Output is correct |
28 |
Correct |
2 ms |
340 KB |
Output is correct |
29 |
Correct |
21 ms |
1200 KB |
Output is correct |
30 |
Correct |
42 ms |
2068 KB |
Output is correct |
31 |
Correct |
62 ms |
3040 KB |
Output is correct |
32 |
Correct |
63 ms |
2936 KB |
Output is correct |
33 |
Correct |
62 ms |
3012 KB |
Output is correct |
34 |
Correct |
64 ms |
3148 KB |
Output is correct |
35 |
Correct |
76 ms |
2936 KB |
Output is correct |
36 |
Correct |
63 ms |
2944 KB |
Output is correct |
37 |
Correct |
63 ms |
2980 KB |
Output is correct |
38 |
Correct |
61 ms |
3260 KB |
Output is correct |
39 |
Correct |
61 ms |
2912 KB |
Output is correct |
40 |
Correct |
64 ms |
2892 KB |
Output is correct |
41 |
Correct |
1 ms |
212 KB |
Output is correct |
42 |
Correct |
1 ms |
300 KB |
Output is correct |
43 |
Correct |
1 ms |
212 KB |
Output is correct |
44 |
Correct |
2 ms |
340 KB |
Output is correct |
45 |
Correct |
2 ms |
340 KB |
Output is correct |
46 |
Correct |
2 ms |
340 KB |
Output is correct |
47 |
Correct |
12 ms |
724 KB |
Output is correct |
48 |
Correct |
9 ms |
680 KB |
Output is correct |
49 |
Correct |
18 ms |
1108 KB |
Output is correct |
50 |
Correct |
38 ms |
1888 KB |
Output is correct |
51 |
Correct |
60 ms |
2688 KB |
Output is correct |
52 |
Correct |
61 ms |
2636 KB |
Output is correct |
53 |
Correct |
60 ms |
2584 KB |
Output is correct |
54 |
Correct |
61 ms |
2676 KB |
Output is correct |
55 |
Correct |
60 ms |
2636 KB |
Output is correct |
56 |
Correct |
60 ms |
2676 KB |
Output is correct |
57 |
Correct |
60 ms |
2696 KB |
Output is correct |
58 |
Correct |
61 ms |
2592 KB |
Output is correct |
59 |
Correct |
60 ms |
2632 KB |
Output is correct |
60 |
Correct |
66 ms |
2688 KB |
Output is correct |
61 |
Correct |
59 ms |
2688 KB |
Output is correct |
62 |
Correct |
59 ms |
2636 KB |
Output is correct |
63 |
Correct |
60 ms |
2636 KB |
Output is correct |
64 |
Correct |
61 ms |
2600 KB |
Output is correct |
65 |
Correct |
60 ms |
2628 KB |
Output is correct |
66 |
Correct |
60 ms |
2688 KB |
Output is correct |
67 |
Correct |
68 ms |
2636 KB |
Output is correct |
68 |
Correct |
60 ms |
2692 KB |
Output is correct |
69 |
Correct |
61 ms |
2668 KB |
Output is correct |
70 |
Correct |
60 ms |
2684 KB |
Output is correct |
71 |
Correct |
9 ms |
724 KB |
Output is correct |
72 |
Correct |
9 ms |
652 KB |
Output is correct |
73 |
Correct |
9 ms |
712 KB |
Output is correct |
74 |
Correct |
11 ms |
724 KB |
Output is correct |
75 |
Correct |
9 ms |
724 KB |
Output is correct |
76 |
Correct |
19 ms |
1108 KB |
Output is correct |
77 |
Correct |
23 ms |
1036 KB |
Output is correct |
78 |
Correct |
18 ms |
1144 KB |
Output is correct |
79 |
Correct |
18 ms |
1108 KB |
Output is correct |
80 |
Correct |
18 ms |
1052 KB |
Output is correct |
81 |
Correct |
36 ms |
1892 KB |
Output is correct |
82 |
Correct |
37 ms |
1844 KB |
Output is correct |
83 |
Correct |
37 ms |
1876 KB |
Output is correct |
84 |
Correct |
36 ms |
1888 KB |
Output is correct |
85 |
Correct |
40 ms |
1856 KB |
Output is correct |
86 |
Correct |
39 ms |
1968 KB |
Output is correct |
87 |
Correct |
38 ms |
2036 KB |
Output is correct |
88 |
Correct |
39 ms |
1992 KB |
Output is correct |
89 |
Correct |
39 ms |
1952 KB |
Output is correct |
90 |
Correct |
42 ms |
1928 KB |
Output is correct |
91 |
Correct |
61 ms |
3400 KB |
Output is correct |
92 |
Correct |
62 ms |
3404 KB |
Output is correct |
93 |
Correct |
62 ms |
3424 KB |
Output is correct |
94 |
Correct |
61 ms |
3380 KB |
Output is correct |
95 |
Correct |
61 ms |
3408 KB |
Output is correct |
96 |
Correct |
65 ms |
4212 KB |
Output is correct |
97 |
Correct |
66 ms |
4100 KB |
Output is correct |
98 |
Correct |
66 ms |
4132 KB |
Output is correct |
99 |
Correct |
69 ms |
4192 KB |
Output is correct |
100 |
Correct |
65 ms |
4164 KB |
Output is correct |
101 |
Correct |
69 ms |
4172 KB |
Output is correct |
102 |
Correct |
65 ms |
4172 KB |
Output is correct |
103 |
Correct |
69 ms |
4172 KB |
Output is correct |
104 |
Correct |
66 ms |
4136 KB |
Output is correct |
105 |
Correct |
65 ms |
4168 KB |
Output is correct |
106 |
Correct |
66 ms |
4556 KB |
Output is correct |
107 |
Correct |
67 ms |
4516 KB |
Output is correct |
108 |
Correct |
71 ms |
4636 KB |
Output is correct |
109 |
Correct |
67 ms |
4524 KB |
Output is correct |
110 |
Correct |
66 ms |
4520 KB |
Output is correct |
111 |
Correct |
76 ms |
4556 KB |
Output is correct |
112 |
Correct |
66 ms |
4556 KB |
Output is correct |
113 |
Correct |
66 ms |
4532 KB |
Output is correct |
114 |
Correct |
67 ms |
4512 KB |
Output is correct |
115 |
Correct |
73 ms |
4548 KB |
Output is correct |
116 |
Correct |
1303 ms |
2472 KB |
Output is correct |
117 |
Correct |
970 ms |
2980 KB |
Output is correct |
118 |
Correct |
1672 ms |
3612 KB |
Output is correct |
119 |
Correct |
673 ms |
3668 KB |
Output is correct |
120 |
Correct |
363 ms |
3680 KB |
Output is correct |
121 |
Correct |
662 ms |
4316 KB |
Output is correct |
122 |
Correct |
388 ms |
4332 KB |
Output is correct |
123 |
Correct |
1584 ms |
5496 KB |
Output is correct |
124 |
Correct |
448 ms |
5812 KB |
Output is correct |
125 |
Correct |
340 ms |
5812 KB |
Output is correct |
126 |
Correct |
5907 ms |
6636 KB |
Output is correct |
127 |
Correct |
5846 ms |
6628 KB |
Output is correct |
128 |
Correct |
5823 ms |
6640 KB |
Output is correct |
129 |
Correct |
5757 ms |
6628 KB |
Output is correct |
130 |
Correct |
5701 ms |
6624 KB |
Output is correct |
131 |
Correct |
4852 ms |
6776 KB |
Output is correct |
132 |
Correct |
4847 ms |
6720 KB |
Output is correct |
133 |
Correct |
5110 ms |
6776 KB |
Output is correct |
134 |
Correct |
4898 ms |
6772 KB |
Output is correct |
135 |
Correct |
4948 ms |
6792 KB |
Output is correct |
136 |
Correct |
4686 ms |
6808 KB |
Output is correct |
137 |
Correct |
4962 ms |
6796 KB |
Output is correct |
138 |
Correct |
4658 ms |
6796 KB |
Output is correct |
139 |
Correct |
4923 ms |
6776 KB |
Output is correct |
140 |
Correct |
4773 ms |
6672 KB |
Output is correct |
141 |
Correct |
2855 ms |
6804 KB |
Output is correct |
142 |
Correct |
3019 ms |
6792 KB |
Output is correct |
143 |
Correct |
2917 ms |
6792 KB |
Output is correct |
144 |
Correct |
2906 ms |
6812 KB |
Output is correct |
145 |
Correct |
2900 ms |
6872 KB |
Output is correct |
146 |
Correct |
746 ms |
7128 KB |
Output is correct |
147 |
Correct |
736 ms |
7080 KB |
Output is correct |
148 |
Correct |
791 ms |
7088 KB |
Output is correct |
149 |
Correct |
735 ms |
7096 KB |
Output is correct |
150 |
Correct |
755 ms |
7212 KB |
Output is correct |
151 |
Correct |
548 ms |
7156 KB |
Output is correct |
152 |
Correct |
561 ms |
7148 KB |
Output is correct |
153 |
Correct |
598 ms |
7232 KB |
Output is correct |
154 |
Correct |
560 ms |
7144 KB |
Output is correct |
155 |
Correct |
532 ms |
7108 KB |
Output is correct |
156 |
Correct |
2377 ms |
7968 KB |
Output is correct |
157 |
Correct |
2395 ms |
8016 KB |
Output is correct |
158 |
Correct |
2474 ms |
7872 KB |
Output is correct |
159 |
Correct |
2347 ms |
7880 KB |
Output is correct |
160 |
Correct |
2357 ms |
7920 KB |
Output is correct |
161 |
Correct |
2484 ms |
8076 KB |
Output is correct |
162 |
Correct |
2558 ms |
7948 KB |
Output is correct |
163 |
Correct |
2575 ms |
7892 KB |
Output is correct |
164 |
Correct |
2557 ms |
8036 KB |
Output is correct |
165 |
Correct |
2634 ms |
7876 KB |
Output is correct |
166 |
Correct |
4416 ms |
7396 KB |
Output is correct |
167 |
Correct |
4488 ms |
7328 KB |
Output is correct |
168 |
Correct |
4479 ms |
7344 KB |
Output is correct |
169 |
Correct |
4609 ms |
7416 KB |
Output is correct |
170 |
Correct |
4550 ms |
7364 KB |
Output is correct |
171 |
Correct |
5639 ms |
7284 KB |
Output is correct |
172 |
Correct |
5825 ms |
7304 KB |
Output is correct |
173 |
Correct |
5765 ms |
7300 KB |
Output is correct |
174 |
Correct |
5673 ms |
7308 KB |
Output is correct |
175 |
Correct |
5497 ms |
7364 KB |
Output is correct |