#include<bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define in insert
#define all(x) x.begin(),x.end()
#define pb push_back
#define eb emplace_back
#define ff first
#define ss second
#define int long long
typedef long long ll;
typedef vector<int> vi;
typedef set<int> si;
typedef multiset<int> msi;
typedef pair<int, int> pii;
typedef vector<pii> vpii;
template<typename T, typename U>
ostream & operator << (ostream &out, const pair<T, U> &c) {
out << c.first << ' ' << c.second;
return out;
}
template<typename T>
ostream & operator << (ostream &out, vector<T> &v) {
const int sz = v.size();
for (int i = 0; i < sz; i++) {
if (i) out << ' ';
out << v[i];
}
return out;
}
template<typename T>
istream & operator >> (istream &in, vector<T> &v) {
for (T &x : v) in >> x;
return in;
}
template<typename T>
void mxx(T &a, T b){if(b > a) a = b;}
template<typename T>
void mnn(T &a, T b){if(b < a) a = b;}
const int mxn = 3e5 + 10, bl = 550, inf = 1e18 + 10, MX = 300000;
int a[mxn], cnt[mxn], le[mxn], ri[mxn], tot[mxn], ans[mxn];
void add(int x) {
int s = cnt[x];
//-+
// 2 1
// 2 0
// 1 0
// 1 1
if(tot[s] > 1 && tot[s + 1] == 0) {
if(ri[s] != inf) le[ri[s]] = s + 1;
ri[s + 1] = ri[s];
le[s + 1] = s;
ri[s] = s + 1;
} else if(tot[s] == 1 && tot[s + 1] == 0) {
ri[le[s]] = s + 1;
if(ri[s] != inf) le[ri[s]] = s + 1;
le[s + 1] = le[s];
ri[s + 1] = ri[s];
le[s] = 0;
ri[s] = inf;
} else if(tot[s] == 1 && tot[s + 1] >= 1) {
ri[le[s]] = s + 1;
le[s + 1] = le[s];
le[s] = 0;
ri[s] = inf;
}
tot[s]--;
tot[s + 1]++;
cnt[x]++;
}
void rem(int x) {
int s = cnt[x];
//+-
// 1 2
// 0 2
// 0 1
// 1 1
if(tot[s] > 1 && tot[s - 1] == 0) {
ri[le[s]] = s - 1;
le[s - 1] = le[s];
ri[s - 1] = s;
le[s] = s - 1;
} else if(tot[s] == 1 && tot[s - 1] == 0) {
if(ri[s] != inf) le[ri[s]] = s - 1;
ri[le[s]] = s - 1;
le[s - 1] = le[s];
ri[s - 1] = ri[s];
le[s] = 0;
ri[s] = inf;
} else if(tot[s] == 1 && tot[s - 1] >= 1) {
if(ri[s] != inf) le[ri[s]] = s - 1;
ri[s - 1] = ri[s];
le[s] = 0;
ri[s] = inf;
}
tot[s]--;
tot[s - 1]++;
cnt[x]--;
}
int solve(int n) {
// for(int i = 1; i <= m; i++) ret += (s - i * x) * (y + i * x);
auto get = [&](int s, int x, int y, int m) -> int {
if(m == 0) return 0;
int ret = s * y * m;
ret -= y * x * (m * (m + 1) / 2);
ret -= m * (m + 1) * (2 * m + 1) / 6 * x * x; // sus
ret += s * x * (m * (m + 1) / 2);
return ret;
};
int lsum = 0, rsum = 0, ret = 0, tp = 0;
for(int i = ri[0]; i < inf; i = ri[i]) {
int m = tot[i];
if(ri[i] == inf) m--;
int m1 = m / 2, m2 = m / 2;
if(m % 2 == 1) {
if(tp) m1++;
else m2++;
tp ^= 1;
}
ret += get(n - lsum, i, lsum, m1);
ret += get(n - rsum, i, rsum, m2);
lsum += m1 * i;
rsum += m2 * i;
}
return ret + n * (n + 1) / 2;
}
void go() {
int n, Q;
cin >> n >> Q;
for(int i = 1; i <= n; i++) {
cin >> a[i];
}
vector<pair<pair<int, int>, int>> q;
for(int i = 1; i <= Q; i++) {
int x, y; cin >> x >> y;
q.eb(make_pair(x, y), i);
}
sort(all(q), [&](const pair<pair<int, int>, int> &a, const pair<pair<int, int>, int> &b) {
if((a.ff.ff + bl - 1) / bl == (b.ff.ff + bl - 1) / bl) return a.ff.ss > b.ff.ss;
return (a.ff.ff + bl - 1) / bl < (b.ff.ff + bl - 1) / bl;
});
tot[0] = inf;
for(int i = 0; i <= MX; i++) {
le[i] = 0;
ri[i] = inf;
}
int l = 1, r = 1;
add(a[1]);
for(auto it : q) {
int L = it.ff.ff, R = it.ff.ss, id = it.ss;
while(r < R) add(a[++r]);
while(l > L) add(a[--l]);
while(r > R) rem(a[r--]);
while(l < L) rem(a[l++]);
assert(l == L && r == R);
ans[id] = solve(R - L + 1);
}
for(int i = 1; i <= Q; i++) {
cout << ans[i] << '\n';
}
}
signed main() {
// #ifndef ONO
// freopen("file.in", "r", stdin);
// freopen("file.out", "w", stdout);
// #endif
fast;
int t = 1;
// cin >> t;
while(t--) {
go();
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
4948 KB |
Output is correct |
2 |
Correct |
2 ms |
4948 KB |
Output is correct |
3 |
Correct |
2 ms |
4948 KB |
Output is correct |
4 |
Correct |
2 ms |
4948 KB |
Output is correct |
5 |
Correct |
2 ms |
4932 KB |
Output is correct |
6 |
Correct |
2 ms |
4948 KB |
Output is correct |
7 |
Correct |
2 ms |
4948 KB |
Output is correct |
8 |
Correct |
2 ms |
4948 KB |
Output is correct |
9 |
Correct |
2 ms |
4948 KB |
Output is correct |
10 |
Correct |
2 ms |
4948 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
4948 KB |
Output is correct |
2 |
Correct |
2 ms |
4948 KB |
Output is correct |
3 |
Correct |
3 ms |
5076 KB |
Output is correct |
4 |
Correct |
7 ms |
6100 KB |
Output is correct |
5 |
Correct |
17 ms |
7244 KB |
Output is correct |
6 |
Correct |
18 ms |
8204 KB |
Output is correct |
7 |
Correct |
18 ms |
8972 KB |
Output is correct |
8 |
Correct |
17 ms |
8084 KB |
Output is correct |
9 |
Correct |
17 ms |
8124 KB |
Output is correct |
10 |
Correct |
18 ms |
8508 KB |
Output is correct |
11 |
Correct |
18 ms |
8304 KB |
Output is correct |
12 |
Correct |
27 ms |
8156 KB |
Output is correct |
13 |
Correct |
21 ms |
8104 KB |
Output is correct |
14 |
Correct |
19 ms |
8292 KB |
Output is correct |
15 |
Correct |
20 ms |
8196 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
4948 KB |
Output is correct |
2 |
Correct |
2 ms |
4948 KB |
Output is correct |
3 |
Correct |
3 ms |
5076 KB |
Output is correct |
4 |
Correct |
7 ms |
6100 KB |
Output is correct |
5 |
Correct |
17 ms |
7244 KB |
Output is correct |
6 |
Correct |
18 ms |
8204 KB |
Output is correct |
7 |
Correct |
18 ms |
8972 KB |
Output is correct |
8 |
Correct |
17 ms |
8084 KB |
Output is correct |
9 |
Correct |
17 ms |
8124 KB |
Output is correct |
10 |
Correct |
18 ms |
8508 KB |
Output is correct |
11 |
Correct |
18 ms |
8304 KB |
Output is correct |
12 |
Correct |
27 ms |
8156 KB |
Output is correct |
13 |
Correct |
21 ms |
8104 KB |
Output is correct |
14 |
Correct |
19 ms |
8292 KB |
Output is correct |
15 |
Correct |
20 ms |
8196 KB |
Output is correct |
16 |
Correct |
2 ms |
4948 KB |
Output is correct |
17 |
Correct |
2 ms |
4948 KB |
Output is correct |
18 |
Correct |
3 ms |
5056 KB |
Output is correct |
19 |
Correct |
11 ms |
6228 KB |
Output is correct |
20 |
Correct |
19 ms |
7208 KB |
Output is correct |
21 |
Correct |
27 ms |
8216 KB |
Output is correct |
22 |
Correct |
18 ms |
8048 KB |
Output is correct |
23 |
Correct |
19 ms |
8140 KB |
Output is correct |
24 |
Correct |
24 ms |
8028 KB |
Output is correct |
25 |
Correct |
24 ms |
7992 KB |
Output is correct |
26 |
Correct |
27 ms |
8032 KB |
Output is correct |
27 |
Correct |
17 ms |
8092 KB |
Output is correct |
28 |
Correct |
18 ms |
8276 KB |
Output is correct |
29 |
Correct |
18 ms |
8000 KB |
Output is correct |
30 |
Correct |
18 ms |
8108 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
4948 KB |
Output is correct |
2 |
Correct |
2 ms |
4948 KB |
Output is correct |
3 |
Correct |
3 ms |
5076 KB |
Output is correct |
4 |
Correct |
7 ms |
6100 KB |
Output is correct |
5 |
Correct |
17 ms |
7244 KB |
Output is correct |
6 |
Correct |
18 ms |
8204 KB |
Output is correct |
7 |
Correct |
18 ms |
8972 KB |
Output is correct |
8 |
Correct |
17 ms |
8084 KB |
Output is correct |
9 |
Correct |
17 ms |
8124 KB |
Output is correct |
10 |
Correct |
18 ms |
8508 KB |
Output is correct |
11 |
Correct |
18 ms |
8304 KB |
Output is correct |
12 |
Correct |
27 ms |
8156 KB |
Output is correct |
13 |
Correct |
21 ms |
8104 KB |
Output is correct |
14 |
Correct |
19 ms |
8292 KB |
Output is correct |
15 |
Correct |
20 ms |
8196 KB |
Output is correct |
16 |
Correct |
2 ms |
4948 KB |
Output is correct |
17 |
Correct |
2 ms |
4948 KB |
Output is correct |
18 |
Correct |
3 ms |
5056 KB |
Output is correct |
19 |
Correct |
11 ms |
6228 KB |
Output is correct |
20 |
Correct |
19 ms |
7208 KB |
Output is correct |
21 |
Correct |
27 ms |
8216 KB |
Output is correct |
22 |
Correct |
18 ms |
8048 KB |
Output is correct |
23 |
Correct |
19 ms |
8140 KB |
Output is correct |
24 |
Correct |
24 ms |
8028 KB |
Output is correct |
25 |
Correct |
24 ms |
7992 KB |
Output is correct |
26 |
Correct |
27 ms |
8032 KB |
Output is correct |
27 |
Correct |
17 ms |
8092 KB |
Output is correct |
28 |
Correct |
18 ms |
8276 KB |
Output is correct |
29 |
Correct |
18 ms |
8000 KB |
Output is correct |
30 |
Correct |
18 ms |
8108 KB |
Output is correct |
31 |
Correct |
3 ms |
4948 KB |
Output is correct |
32 |
Correct |
2 ms |
4932 KB |
Output is correct |
33 |
Correct |
2 ms |
4948 KB |
Output is correct |
34 |
Correct |
3 ms |
5076 KB |
Output is correct |
35 |
Correct |
3 ms |
5076 KB |
Output is correct |
36 |
Correct |
3 ms |
5076 KB |
Output is correct |
37 |
Correct |
6 ms |
5600 KB |
Output is correct |
38 |
Correct |
5 ms |
5588 KB |
Output is correct |
39 |
Correct |
9 ms |
6212 KB |
Output is correct |
40 |
Correct |
15 ms |
6996 KB |
Output is correct |
41 |
Correct |
23 ms |
8124 KB |
Output is correct |
42 |
Correct |
21 ms |
8148 KB |
Output is correct |
43 |
Correct |
21 ms |
8064 KB |
Output is correct |
44 |
Correct |
22 ms |
8096 KB |
Output is correct |
45 |
Correct |
20 ms |
8148 KB |
Output is correct |
46 |
Correct |
19 ms |
8148 KB |
Output is correct |
47 |
Correct |
19 ms |
8040 KB |
Output is correct |
48 |
Correct |
21 ms |
8040 KB |
Output is correct |
49 |
Correct |
20 ms |
8128 KB |
Output is correct |
50 |
Correct |
24 ms |
8120 KB |
Output is correct |
51 |
Correct |
22 ms |
8156 KB |
Output is correct |
52 |
Correct |
27 ms |
8044 KB |
Output is correct |
53 |
Correct |
20 ms |
8040 KB |
Output is correct |
54 |
Correct |
23 ms |
8132 KB |
Output is correct |
55 |
Correct |
21 ms |
8064 KB |
Output is correct |
56 |
Correct |
20 ms |
8136 KB |
Output is correct |
57 |
Correct |
21 ms |
8040 KB |
Output is correct |
58 |
Correct |
20 ms |
8148 KB |
Output is correct |
59 |
Correct |
25 ms |
8272 KB |
Output is correct |
60 |
Correct |
32 ms |
8072 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
4948 KB |
Output is correct |
2 |
Correct |
2 ms |
4948 KB |
Output is correct |
3 |
Correct |
2 ms |
4948 KB |
Output is correct |
4 |
Correct |
2 ms |
4948 KB |
Output is correct |
5 |
Correct |
2 ms |
4932 KB |
Output is correct |
6 |
Correct |
2 ms |
4948 KB |
Output is correct |
7 |
Correct |
2 ms |
4948 KB |
Output is correct |
8 |
Correct |
2 ms |
4948 KB |
Output is correct |
9 |
Correct |
2 ms |
4948 KB |
Output is correct |
10 |
Correct |
2 ms |
4948 KB |
Output is correct |
11 |
Correct |
2 ms |
4948 KB |
Output is correct |
12 |
Correct |
2 ms |
4948 KB |
Output is correct |
13 |
Correct |
3 ms |
5076 KB |
Output is correct |
14 |
Correct |
7 ms |
6100 KB |
Output is correct |
15 |
Correct |
17 ms |
7244 KB |
Output is correct |
16 |
Correct |
18 ms |
8204 KB |
Output is correct |
17 |
Correct |
18 ms |
8972 KB |
Output is correct |
18 |
Correct |
17 ms |
8084 KB |
Output is correct |
19 |
Correct |
17 ms |
8124 KB |
Output is correct |
20 |
Correct |
18 ms |
8508 KB |
Output is correct |
21 |
Correct |
18 ms |
8304 KB |
Output is correct |
22 |
Correct |
27 ms |
8156 KB |
Output is correct |
23 |
Correct |
21 ms |
8104 KB |
Output is correct |
24 |
Correct |
19 ms |
8292 KB |
Output is correct |
25 |
Correct |
20 ms |
8196 KB |
Output is correct |
26 |
Correct |
2 ms |
4948 KB |
Output is correct |
27 |
Correct |
2 ms |
4948 KB |
Output is correct |
28 |
Correct |
3 ms |
5056 KB |
Output is correct |
29 |
Correct |
11 ms |
6228 KB |
Output is correct |
30 |
Correct |
19 ms |
7208 KB |
Output is correct |
31 |
Correct |
27 ms |
8216 KB |
Output is correct |
32 |
Correct |
18 ms |
8048 KB |
Output is correct |
33 |
Correct |
19 ms |
8140 KB |
Output is correct |
34 |
Correct |
24 ms |
8028 KB |
Output is correct |
35 |
Correct |
24 ms |
7992 KB |
Output is correct |
36 |
Correct |
27 ms |
8032 KB |
Output is correct |
37 |
Correct |
17 ms |
8092 KB |
Output is correct |
38 |
Correct |
18 ms |
8276 KB |
Output is correct |
39 |
Correct |
18 ms |
8000 KB |
Output is correct |
40 |
Correct |
18 ms |
8108 KB |
Output is correct |
41 |
Correct |
3 ms |
4948 KB |
Output is correct |
42 |
Correct |
2 ms |
4932 KB |
Output is correct |
43 |
Correct |
2 ms |
4948 KB |
Output is correct |
44 |
Correct |
3 ms |
5076 KB |
Output is correct |
45 |
Correct |
3 ms |
5076 KB |
Output is correct |
46 |
Correct |
3 ms |
5076 KB |
Output is correct |
47 |
Correct |
6 ms |
5600 KB |
Output is correct |
48 |
Correct |
5 ms |
5588 KB |
Output is correct |
49 |
Correct |
9 ms |
6212 KB |
Output is correct |
50 |
Correct |
15 ms |
6996 KB |
Output is correct |
51 |
Correct |
23 ms |
8124 KB |
Output is correct |
52 |
Correct |
21 ms |
8148 KB |
Output is correct |
53 |
Correct |
21 ms |
8064 KB |
Output is correct |
54 |
Correct |
22 ms |
8096 KB |
Output is correct |
55 |
Correct |
20 ms |
8148 KB |
Output is correct |
56 |
Correct |
19 ms |
8148 KB |
Output is correct |
57 |
Correct |
19 ms |
8040 KB |
Output is correct |
58 |
Correct |
21 ms |
8040 KB |
Output is correct |
59 |
Correct |
20 ms |
8128 KB |
Output is correct |
60 |
Correct |
24 ms |
8120 KB |
Output is correct |
61 |
Correct |
22 ms |
8156 KB |
Output is correct |
62 |
Correct |
27 ms |
8044 KB |
Output is correct |
63 |
Correct |
20 ms |
8040 KB |
Output is correct |
64 |
Correct |
23 ms |
8132 KB |
Output is correct |
65 |
Correct |
21 ms |
8064 KB |
Output is correct |
66 |
Correct |
20 ms |
8136 KB |
Output is correct |
67 |
Correct |
21 ms |
8040 KB |
Output is correct |
68 |
Correct |
20 ms |
8148 KB |
Output is correct |
69 |
Correct |
25 ms |
8272 KB |
Output is correct |
70 |
Correct |
32 ms |
8072 KB |
Output is correct |
71 |
Correct |
7 ms |
5588 KB |
Output is correct |
72 |
Correct |
6 ms |
5588 KB |
Output is correct |
73 |
Correct |
5 ms |
5600 KB |
Output is correct |
74 |
Correct |
5 ms |
5584 KB |
Output is correct |
75 |
Correct |
5 ms |
5588 KB |
Output is correct |
76 |
Correct |
8 ms |
6212 KB |
Output is correct |
77 |
Correct |
8 ms |
6228 KB |
Output is correct |
78 |
Correct |
8 ms |
6228 KB |
Output is correct |
79 |
Correct |
12 ms |
6208 KB |
Output is correct |
80 |
Correct |
8 ms |
6144 KB |
Output is correct |
81 |
Correct |
14 ms |
7244 KB |
Output is correct |
82 |
Correct |
13 ms |
7152 KB |
Output is correct |
83 |
Correct |
14 ms |
7216 KB |
Output is correct |
84 |
Correct |
14 ms |
7232 KB |
Output is correct |
85 |
Correct |
13 ms |
7252 KB |
Output is correct |
86 |
Correct |
15 ms |
7372 KB |
Output is correct |
87 |
Correct |
15 ms |
7360 KB |
Output is correct |
88 |
Correct |
15 ms |
7364 KB |
Output is correct |
89 |
Correct |
16 ms |
7308 KB |
Output is correct |
90 |
Correct |
16 ms |
7412 KB |
Output is correct |
91 |
Correct |
21 ms |
8892 KB |
Output is correct |
92 |
Correct |
21 ms |
8848 KB |
Output is correct |
93 |
Correct |
21 ms |
8800 KB |
Output is correct |
94 |
Correct |
21 ms |
8804 KB |
Output is correct |
95 |
Correct |
22 ms |
8932 KB |
Output is correct |
96 |
Correct |
24 ms |
9616 KB |
Output is correct |
97 |
Correct |
24 ms |
9648 KB |
Output is correct |
98 |
Correct |
24 ms |
9684 KB |
Output is correct |
99 |
Correct |
25 ms |
9576 KB |
Output is correct |
100 |
Correct |
25 ms |
9696 KB |
Output is correct |
101 |
Correct |
26 ms |
9576 KB |
Output is correct |
102 |
Correct |
30 ms |
9836 KB |
Output is correct |
103 |
Correct |
24 ms |
9644 KB |
Output is correct |
104 |
Correct |
24 ms |
9592 KB |
Output is correct |
105 |
Correct |
24 ms |
9644 KB |
Output is correct |
106 |
Correct |
28 ms |
10028 KB |
Output is correct |
107 |
Correct |
23 ms |
10060 KB |
Output is correct |
108 |
Correct |
24 ms |
10088 KB |
Output is correct |
109 |
Correct |
24 ms |
10056 KB |
Output is correct |
110 |
Correct |
24 ms |
9976 KB |
Output is correct |
111 |
Correct |
24 ms |
10016 KB |
Output is correct |
112 |
Correct |
27 ms |
9988 KB |
Output is correct |
113 |
Correct |
24 ms |
10048 KB |
Output is correct |
114 |
Correct |
24 ms |
9980 KB |
Output is correct |
115 |
Correct |
23 ms |
10060 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
4948 KB |
Output is correct |
2 |
Correct |
2 ms |
4948 KB |
Output is correct |
3 |
Correct |
2 ms |
4948 KB |
Output is correct |
4 |
Correct |
2 ms |
4948 KB |
Output is correct |
5 |
Correct |
2 ms |
4932 KB |
Output is correct |
6 |
Correct |
2 ms |
4948 KB |
Output is correct |
7 |
Correct |
2 ms |
4948 KB |
Output is correct |
8 |
Correct |
2 ms |
4948 KB |
Output is correct |
9 |
Correct |
2 ms |
4948 KB |
Output is correct |
10 |
Correct |
2 ms |
4948 KB |
Output is correct |
11 |
Correct |
2 ms |
4948 KB |
Output is correct |
12 |
Correct |
2 ms |
4948 KB |
Output is correct |
13 |
Correct |
3 ms |
5076 KB |
Output is correct |
14 |
Correct |
7 ms |
6100 KB |
Output is correct |
15 |
Correct |
17 ms |
7244 KB |
Output is correct |
16 |
Correct |
18 ms |
8204 KB |
Output is correct |
17 |
Correct |
18 ms |
8972 KB |
Output is correct |
18 |
Correct |
17 ms |
8084 KB |
Output is correct |
19 |
Correct |
17 ms |
8124 KB |
Output is correct |
20 |
Correct |
18 ms |
8508 KB |
Output is correct |
21 |
Correct |
18 ms |
8304 KB |
Output is correct |
22 |
Correct |
27 ms |
8156 KB |
Output is correct |
23 |
Correct |
21 ms |
8104 KB |
Output is correct |
24 |
Correct |
19 ms |
8292 KB |
Output is correct |
25 |
Correct |
20 ms |
8196 KB |
Output is correct |
26 |
Correct |
2 ms |
4948 KB |
Output is correct |
27 |
Correct |
2 ms |
4948 KB |
Output is correct |
28 |
Correct |
3 ms |
5056 KB |
Output is correct |
29 |
Correct |
11 ms |
6228 KB |
Output is correct |
30 |
Correct |
19 ms |
7208 KB |
Output is correct |
31 |
Correct |
27 ms |
8216 KB |
Output is correct |
32 |
Correct |
18 ms |
8048 KB |
Output is correct |
33 |
Correct |
19 ms |
8140 KB |
Output is correct |
34 |
Correct |
24 ms |
8028 KB |
Output is correct |
35 |
Correct |
24 ms |
7992 KB |
Output is correct |
36 |
Correct |
27 ms |
8032 KB |
Output is correct |
37 |
Correct |
17 ms |
8092 KB |
Output is correct |
38 |
Correct |
18 ms |
8276 KB |
Output is correct |
39 |
Correct |
18 ms |
8000 KB |
Output is correct |
40 |
Correct |
18 ms |
8108 KB |
Output is correct |
41 |
Correct |
3 ms |
4948 KB |
Output is correct |
42 |
Correct |
2 ms |
4932 KB |
Output is correct |
43 |
Correct |
2 ms |
4948 KB |
Output is correct |
44 |
Correct |
3 ms |
5076 KB |
Output is correct |
45 |
Correct |
3 ms |
5076 KB |
Output is correct |
46 |
Correct |
3 ms |
5076 KB |
Output is correct |
47 |
Correct |
6 ms |
5600 KB |
Output is correct |
48 |
Correct |
5 ms |
5588 KB |
Output is correct |
49 |
Correct |
9 ms |
6212 KB |
Output is correct |
50 |
Correct |
15 ms |
6996 KB |
Output is correct |
51 |
Correct |
23 ms |
8124 KB |
Output is correct |
52 |
Correct |
21 ms |
8148 KB |
Output is correct |
53 |
Correct |
21 ms |
8064 KB |
Output is correct |
54 |
Correct |
22 ms |
8096 KB |
Output is correct |
55 |
Correct |
20 ms |
8148 KB |
Output is correct |
56 |
Correct |
19 ms |
8148 KB |
Output is correct |
57 |
Correct |
19 ms |
8040 KB |
Output is correct |
58 |
Correct |
21 ms |
8040 KB |
Output is correct |
59 |
Correct |
20 ms |
8128 KB |
Output is correct |
60 |
Correct |
24 ms |
8120 KB |
Output is correct |
61 |
Correct |
22 ms |
8156 KB |
Output is correct |
62 |
Correct |
27 ms |
8044 KB |
Output is correct |
63 |
Correct |
20 ms |
8040 KB |
Output is correct |
64 |
Correct |
23 ms |
8132 KB |
Output is correct |
65 |
Correct |
21 ms |
8064 KB |
Output is correct |
66 |
Correct |
20 ms |
8136 KB |
Output is correct |
67 |
Correct |
21 ms |
8040 KB |
Output is correct |
68 |
Correct |
20 ms |
8148 KB |
Output is correct |
69 |
Correct |
25 ms |
8272 KB |
Output is correct |
70 |
Correct |
32 ms |
8072 KB |
Output is correct |
71 |
Correct |
7 ms |
5588 KB |
Output is correct |
72 |
Correct |
6 ms |
5588 KB |
Output is correct |
73 |
Correct |
5 ms |
5600 KB |
Output is correct |
74 |
Correct |
5 ms |
5584 KB |
Output is correct |
75 |
Correct |
5 ms |
5588 KB |
Output is correct |
76 |
Correct |
8 ms |
6212 KB |
Output is correct |
77 |
Correct |
8 ms |
6228 KB |
Output is correct |
78 |
Correct |
8 ms |
6228 KB |
Output is correct |
79 |
Correct |
12 ms |
6208 KB |
Output is correct |
80 |
Correct |
8 ms |
6144 KB |
Output is correct |
81 |
Correct |
14 ms |
7244 KB |
Output is correct |
82 |
Correct |
13 ms |
7152 KB |
Output is correct |
83 |
Correct |
14 ms |
7216 KB |
Output is correct |
84 |
Correct |
14 ms |
7232 KB |
Output is correct |
85 |
Correct |
13 ms |
7252 KB |
Output is correct |
86 |
Correct |
15 ms |
7372 KB |
Output is correct |
87 |
Correct |
15 ms |
7360 KB |
Output is correct |
88 |
Correct |
15 ms |
7364 KB |
Output is correct |
89 |
Correct |
16 ms |
7308 KB |
Output is correct |
90 |
Correct |
16 ms |
7412 KB |
Output is correct |
91 |
Correct |
21 ms |
8892 KB |
Output is correct |
92 |
Correct |
21 ms |
8848 KB |
Output is correct |
93 |
Correct |
21 ms |
8800 KB |
Output is correct |
94 |
Correct |
21 ms |
8804 KB |
Output is correct |
95 |
Correct |
22 ms |
8932 KB |
Output is correct |
96 |
Correct |
24 ms |
9616 KB |
Output is correct |
97 |
Correct |
24 ms |
9648 KB |
Output is correct |
98 |
Correct |
24 ms |
9684 KB |
Output is correct |
99 |
Correct |
25 ms |
9576 KB |
Output is correct |
100 |
Correct |
25 ms |
9696 KB |
Output is correct |
101 |
Correct |
26 ms |
9576 KB |
Output is correct |
102 |
Correct |
30 ms |
9836 KB |
Output is correct |
103 |
Correct |
24 ms |
9644 KB |
Output is correct |
104 |
Correct |
24 ms |
9592 KB |
Output is correct |
105 |
Correct |
24 ms |
9644 KB |
Output is correct |
106 |
Correct |
28 ms |
10028 KB |
Output is correct |
107 |
Correct |
23 ms |
10060 KB |
Output is correct |
108 |
Correct |
24 ms |
10088 KB |
Output is correct |
109 |
Correct |
24 ms |
10056 KB |
Output is correct |
110 |
Correct |
24 ms |
9976 KB |
Output is correct |
111 |
Correct |
24 ms |
10016 KB |
Output is correct |
112 |
Correct |
27 ms |
9988 KB |
Output is correct |
113 |
Correct |
24 ms |
10048 KB |
Output is correct |
114 |
Correct |
24 ms |
9980 KB |
Output is correct |
115 |
Correct |
23 ms |
10060 KB |
Output is correct |
116 |
Correct |
105 ms |
7560 KB |
Output is correct |
117 |
Correct |
122 ms |
7584 KB |
Output is correct |
118 |
Correct |
155 ms |
8036 KB |
Output is correct |
119 |
Correct |
159 ms |
8028 KB |
Output is correct |
120 |
Correct |
112 ms |
7996 KB |
Output is correct |
121 |
Correct |
227 ms |
8628 KB |
Output is correct |
122 |
Correct |
166 ms |
9064 KB |
Output is correct |
123 |
Correct |
650 ms |
10236 KB |
Output is correct |
124 |
Correct |
298 ms |
10596 KB |
Output is correct |
125 |
Correct |
257 ms |
10612 KB |
Output is correct |
126 |
Correct |
1493 ms |
11368 KB |
Output is correct |
127 |
Correct |
1535 ms |
11364 KB |
Output is correct |
128 |
Correct |
1549 ms |
11448 KB |
Output is correct |
129 |
Correct |
1580 ms |
11356 KB |
Output is correct |
130 |
Correct |
1570 ms |
11348 KB |
Output is correct |
131 |
Correct |
1764 ms |
11512 KB |
Output is correct |
132 |
Correct |
1758 ms |
11516 KB |
Output is correct |
133 |
Correct |
1736 ms |
11504 KB |
Output is correct |
134 |
Correct |
1729 ms |
11512 KB |
Output is correct |
135 |
Correct |
1753 ms |
11520 KB |
Output is correct |
136 |
Correct |
1786 ms |
11536 KB |
Output is correct |
137 |
Correct |
1763 ms |
11532 KB |
Output is correct |
138 |
Correct |
1756 ms |
11524 KB |
Output is correct |
139 |
Correct |
1743 ms |
11508 KB |
Output is correct |
140 |
Correct |
1780 ms |
11516 KB |
Output is correct |
141 |
Correct |
1394 ms |
11512 KB |
Output is correct |
142 |
Correct |
1478 ms |
11528 KB |
Output is correct |
143 |
Correct |
1412 ms |
11656 KB |
Output is correct |
144 |
Correct |
1395 ms |
11496 KB |
Output is correct |
145 |
Correct |
1452 ms |
11536 KB |
Output is correct |
146 |
Correct |
593 ms |
11816 KB |
Output is correct |
147 |
Correct |
574 ms |
11816 KB |
Output is correct |
148 |
Correct |
603 ms |
11816 KB |
Output is correct |
149 |
Correct |
595 ms |
11816 KB |
Output is correct |
150 |
Correct |
582 ms |
11808 KB |
Output is correct |
151 |
Correct |
546 ms |
11884 KB |
Output is correct |
152 |
Correct |
534 ms |
11964 KB |
Output is correct |
153 |
Correct |
509 ms |
11880 KB |
Output is correct |
154 |
Correct |
539 ms |
11888 KB |
Output is correct |
155 |
Correct |
517 ms |
11884 KB |
Output is correct |
156 |
Correct |
1457 ms |
12692 KB |
Output is correct |
157 |
Correct |
1479 ms |
12728 KB |
Output is correct |
158 |
Correct |
1432 ms |
12608 KB |
Output is correct |
159 |
Correct |
1449 ms |
12616 KB |
Output is correct |
160 |
Correct |
1362 ms |
12616 KB |
Output is correct |
161 |
Correct |
1650 ms |
12800 KB |
Output is correct |
162 |
Correct |
1577 ms |
12676 KB |
Output is correct |
163 |
Correct |
1538 ms |
12616 KB |
Output is correct |
164 |
Correct |
1604 ms |
12656 KB |
Output is correct |
165 |
Correct |
1523 ms |
12604 KB |
Output is correct |
166 |
Correct |
1735 ms |
12124 KB |
Output is correct |
167 |
Correct |
1696 ms |
12092 KB |
Output is correct |
168 |
Correct |
1687 ms |
12076 KB |
Output is correct |
169 |
Correct |
1707 ms |
12184 KB |
Output is correct |
170 |
Correct |
1713 ms |
12092 KB |
Output is correct |
171 |
Correct |
1553 ms |
12032 KB |
Output is correct |
172 |
Correct |
1491 ms |
12028 KB |
Output is correct |
173 |
Correct |
1501 ms |
12152 KB |
Output is correct |
174 |
Correct |
1510 ms |
12032 KB |
Output is correct |
175 |
Correct |
1566 ms |
12092 KB |
Output is correct |