#include <bits/stdc++.h>
#define IO_OP std::ios::sync_with_stdio(0); std::cin.tie(0);
#define F first
#define S second
#define V vector
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define SZ(v) int((v).size())
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
typedef V<int> vi;
string _reset = "\u001b[0m", _yellow = "\u001b[33m", _bold = "\u001b[1m";
void DBG() { cerr << "]" << _reset << endl; }
template<class H, class...T> void DBG(H h, T ...t) {
cerr << to_string(h);
if(sizeof ...(t)) cerr << ", ";
DBG(t...);
}
#ifdef CHEISSMART
#define debug(...) cerr << _yellow << _bold << "Line(" << __LINE__ << ") -> [" << #__VA_ARGS__ << "]: [", DBG(__VA_ARGS__)
#else
#define debug(...)
#endif
const int INF = 1e9 + 7, K = 500, N = 3e5 + 7;
namespace ds {
int cnt[N];
bool inhebe[N];
vi hebe;
void add(int x) {
if(x == 0) return;
cnt[x]++;
if(!inhebe[x]) {
inhebe[x] = true;
hebe.PB(x);
}
}
void del(int x) {
if(x == 0) return;
cnt[x]--;
}
ll qry() {
vi alive;
V<pi> aux;
for(int x:hebe) {
if(cnt[x] == 0) {
inhebe[x] = false;
} else {
alive.PB(x);
debug(x, cnt[x]);
aux.EB(x, cnt[x]);
}
}
hebe = alive;
sort(ALL(aux));
V<pi> even, odd;
bool f = 0;
for(auto[x, y]:aux) {
if(!f) {
even.EB(x, (y + 1) / 2);
if(y / 2) odd.EB(x, y / 2);
} else {
odd.EB(x, (y + 1) / 2);
if(y / 2) even.EB(x, y / 2);
}
f ^= y & 1;
}
reverse(ALL(odd));
even.insert(even.end(), ALL(odd));
ll ans = 0, ct = 0, sx = 0, ss = 0;
for(auto[x, y]:even) {
ans += 1LL * x * (x + 1) * y;
ll a = (x * (ct + 1) * sx - x * ss) * 2;
ll b = (x * sx + 1LL * x * x * (ct + 1)) * 2 - 1LL * x * x * (2 * ct - 1);
ll c = 1LL * x * x;
ans += a * y;
ans += b * y * (y - 1) / 2;
ans += c * (y - 1) * y * (2 * y - 1) / 6;
ss += x * (2 * ct + y - 1) * y / 2;
sx += x * y;
ct += y;
}
return ans / 2;
}
}
signed main()
{
IO_OP;
int n, q;
cin >> n >> q;
vi a(n);
for(int i = 0; i < n; i++)
cin >> a[i];
vi l(q), r(q);
for(int i = 0; i < q; i++) {
cin >> l[i] >> r[i];
l[i]--, r[i]--;
}
vi order(q); iota(ALL(order), 0);
sort(ALL(order), [&] (int i, int j) {
return MP(l[i] / K, r[i]) < MP(l[j] / K, r[j]);
});
V<ll> ans(q);
int cnt[N] = {};
auto add = [&] (int x) {
ds::del(cnt[x]);
cnt[x]++;
ds::add(cnt[x]);
};
auto del = [&] (int x) {
ds::del(cnt[x]);
cnt[x]--;
ds::add(cnt[x]);
};
int L = 0, R = 0;
add(a[0]);
for(int qi:order) {
while(R < r[qi]) add(a[++R]);
while(L > l[qi]) add(a[--L]);
while(R > r[qi]) del(a[R--]);
while(L < l[qi]) del(a[L++]);
ans[qi] = ds::qry();
}
for(int i = 0; i < q; i++)
cout << ans[i] << '\n';
}
Compilation message
diversity.cpp: In function 'll ds::qry()':
diversity.cpp:66:11: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
66 | for(auto[x, y]:aux) {
| ^
diversity.cpp:81:11: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
81 | for(auto[x, y]:even) {
| ^
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
1492 KB |
Output is correct |
2 |
Correct |
1 ms |
1492 KB |
Output is correct |
3 |
Correct |
1 ms |
1500 KB |
Output is correct |
4 |
Correct |
1 ms |
1492 KB |
Output is correct |
5 |
Correct |
1 ms |
1492 KB |
Output is correct |
6 |
Correct |
2 ms |
1492 KB |
Output is correct |
7 |
Correct |
2 ms |
1500 KB |
Output is correct |
8 |
Correct |
1 ms |
1492 KB |
Output is correct |
9 |
Correct |
1 ms |
1492 KB |
Output is correct |
10 |
Correct |
1 ms |
1496 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
1492 KB |
Output is correct |
2 |
Correct |
1 ms |
1492 KB |
Output is correct |
3 |
Correct |
2 ms |
1512 KB |
Output is correct |
4 |
Correct |
7 ms |
2408 KB |
Output is correct |
5 |
Correct |
14 ms |
3560 KB |
Output is correct |
6 |
Correct |
23 ms |
3928 KB |
Output is correct |
7 |
Correct |
20 ms |
5076 KB |
Output is correct |
8 |
Correct |
18 ms |
3792 KB |
Output is correct |
9 |
Correct |
20 ms |
3876 KB |
Output is correct |
10 |
Correct |
23 ms |
4312 KB |
Output is correct |
11 |
Correct |
25 ms |
4192 KB |
Output is correct |
12 |
Correct |
19 ms |
3944 KB |
Output is correct |
13 |
Correct |
19 ms |
3800 KB |
Output is correct |
14 |
Correct |
24 ms |
4312 KB |
Output is correct |
15 |
Correct |
22 ms |
4304 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
1492 KB |
Output is correct |
2 |
Correct |
1 ms |
1492 KB |
Output is correct |
3 |
Correct |
2 ms |
1512 KB |
Output is correct |
4 |
Correct |
7 ms |
2408 KB |
Output is correct |
5 |
Correct |
14 ms |
3560 KB |
Output is correct |
6 |
Correct |
23 ms |
3928 KB |
Output is correct |
7 |
Correct |
20 ms |
5076 KB |
Output is correct |
8 |
Correct |
18 ms |
3792 KB |
Output is correct |
9 |
Correct |
20 ms |
3876 KB |
Output is correct |
10 |
Correct |
23 ms |
4312 KB |
Output is correct |
11 |
Correct |
25 ms |
4192 KB |
Output is correct |
12 |
Correct |
19 ms |
3944 KB |
Output is correct |
13 |
Correct |
19 ms |
3800 KB |
Output is correct |
14 |
Correct |
24 ms |
4312 KB |
Output is correct |
15 |
Correct |
22 ms |
4304 KB |
Output is correct |
16 |
Correct |
1 ms |
1492 KB |
Output is correct |
17 |
Correct |
1 ms |
1492 KB |
Output is correct |
18 |
Correct |
2 ms |
1492 KB |
Output is correct |
19 |
Correct |
9 ms |
2388 KB |
Output is correct |
20 |
Correct |
16 ms |
3180 KB |
Output is correct |
21 |
Correct |
20 ms |
4072 KB |
Output is correct |
22 |
Correct |
21 ms |
3928 KB |
Output is correct |
23 |
Correct |
20 ms |
3944 KB |
Output is correct |
24 |
Correct |
20 ms |
3912 KB |
Output is correct |
25 |
Correct |
20 ms |
3944 KB |
Output is correct |
26 |
Correct |
21 ms |
3948 KB |
Output is correct |
27 |
Correct |
22 ms |
3948 KB |
Output is correct |
28 |
Correct |
22 ms |
4312 KB |
Output is correct |
29 |
Correct |
30 ms |
3936 KB |
Output is correct |
30 |
Correct |
22 ms |
3948 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
1492 KB |
Output is correct |
2 |
Correct |
1 ms |
1492 KB |
Output is correct |
3 |
Correct |
2 ms |
1512 KB |
Output is correct |
4 |
Correct |
7 ms |
2408 KB |
Output is correct |
5 |
Correct |
14 ms |
3560 KB |
Output is correct |
6 |
Correct |
23 ms |
3928 KB |
Output is correct |
7 |
Correct |
20 ms |
5076 KB |
Output is correct |
8 |
Correct |
18 ms |
3792 KB |
Output is correct |
9 |
Correct |
20 ms |
3876 KB |
Output is correct |
10 |
Correct |
23 ms |
4312 KB |
Output is correct |
11 |
Correct |
25 ms |
4192 KB |
Output is correct |
12 |
Correct |
19 ms |
3944 KB |
Output is correct |
13 |
Correct |
19 ms |
3800 KB |
Output is correct |
14 |
Correct |
24 ms |
4312 KB |
Output is correct |
15 |
Correct |
22 ms |
4304 KB |
Output is correct |
16 |
Correct |
1 ms |
1492 KB |
Output is correct |
17 |
Correct |
1 ms |
1492 KB |
Output is correct |
18 |
Correct |
2 ms |
1492 KB |
Output is correct |
19 |
Correct |
9 ms |
2388 KB |
Output is correct |
20 |
Correct |
16 ms |
3180 KB |
Output is correct |
21 |
Correct |
20 ms |
4072 KB |
Output is correct |
22 |
Correct |
21 ms |
3928 KB |
Output is correct |
23 |
Correct |
20 ms |
3944 KB |
Output is correct |
24 |
Correct |
20 ms |
3912 KB |
Output is correct |
25 |
Correct |
20 ms |
3944 KB |
Output is correct |
26 |
Correct |
21 ms |
3948 KB |
Output is correct |
27 |
Correct |
22 ms |
3948 KB |
Output is correct |
28 |
Correct |
22 ms |
4312 KB |
Output is correct |
29 |
Correct |
30 ms |
3936 KB |
Output is correct |
30 |
Correct |
22 ms |
3948 KB |
Output is correct |
31 |
Correct |
2 ms |
1492 KB |
Output is correct |
32 |
Correct |
1 ms |
1492 KB |
Output is correct |
33 |
Correct |
1 ms |
1492 KB |
Output is correct |
34 |
Correct |
2 ms |
1508 KB |
Output is correct |
35 |
Correct |
2 ms |
1556 KB |
Output is correct |
36 |
Correct |
2 ms |
1508 KB |
Output is correct |
37 |
Correct |
5 ms |
1820 KB |
Output is correct |
38 |
Correct |
5 ms |
1824 KB |
Output is correct |
39 |
Correct |
8 ms |
2388 KB |
Output is correct |
40 |
Correct |
18 ms |
3048 KB |
Output is correct |
41 |
Correct |
21 ms |
3796 KB |
Output is correct |
42 |
Correct |
23 ms |
3796 KB |
Output is correct |
43 |
Correct |
26 ms |
3816 KB |
Output is correct |
44 |
Correct |
21 ms |
3824 KB |
Output is correct |
45 |
Correct |
21 ms |
3820 KB |
Output is correct |
46 |
Correct |
21 ms |
3824 KB |
Output is correct |
47 |
Correct |
24 ms |
3812 KB |
Output is correct |
48 |
Correct |
29 ms |
3816 KB |
Output is correct |
49 |
Correct |
21 ms |
3816 KB |
Output is correct |
50 |
Correct |
21 ms |
3804 KB |
Output is correct |
51 |
Correct |
20 ms |
3816 KB |
Output is correct |
52 |
Correct |
20 ms |
3796 KB |
Output is correct |
53 |
Correct |
23 ms |
3816 KB |
Output is correct |
54 |
Correct |
25 ms |
3824 KB |
Output is correct |
55 |
Correct |
25 ms |
3812 KB |
Output is correct |
56 |
Correct |
21 ms |
3800 KB |
Output is correct |
57 |
Correct |
22 ms |
3844 KB |
Output is correct |
58 |
Correct |
21 ms |
3824 KB |
Output is correct |
59 |
Correct |
20 ms |
3796 KB |
Output is correct |
60 |
Correct |
21 ms |
3796 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
1492 KB |
Output is correct |
2 |
Correct |
1 ms |
1492 KB |
Output is correct |
3 |
Correct |
1 ms |
1500 KB |
Output is correct |
4 |
Correct |
1 ms |
1492 KB |
Output is correct |
5 |
Correct |
1 ms |
1492 KB |
Output is correct |
6 |
Correct |
2 ms |
1492 KB |
Output is correct |
7 |
Correct |
2 ms |
1500 KB |
Output is correct |
8 |
Correct |
1 ms |
1492 KB |
Output is correct |
9 |
Correct |
1 ms |
1492 KB |
Output is correct |
10 |
Correct |
1 ms |
1496 KB |
Output is correct |
11 |
Correct |
1 ms |
1492 KB |
Output is correct |
12 |
Correct |
1 ms |
1492 KB |
Output is correct |
13 |
Correct |
2 ms |
1512 KB |
Output is correct |
14 |
Correct |
7 ms |
2408 KB |
Output is correct |
15 |
Correct |
14 ms |
3560 KB |
Output is correct |
16 |
Correct |
23 ms |
3928 KB |
Output is correct |
17 |
Correct |
20 ms |
5076 KB |
Output is correct |
18 |
Correct |
18 ms |
3792 KB |
Output is correct |
19 |
Correct |
20 ms |
3876 KB |
Output is correct |
20 |
Correct |
23 ms |
4312 KB |
Output is correct |
21 |
Correct |
25 ms |
4192 KB |
Output is correct |
22 |
Correct |
19 ms |
3944 KB |
Output is correct |
23 |
Correct |
19 ms |
3800 KB |
Output is correct |
24 |
Correct |
24 ms |
4312 KB |
Output is correct |
25 |
Correct |
22 ms |
4304 KB |
Output is correct |
26 |
Correct |
1 ms |
1492 KB |
Output is correct |
27 |
Correct |
1 ms |
1492 KB |
Output is correct |
28 |
Correct |
2 ms |
1492 KB |
Output is correct |
29 |
Correct |
9 ms |
2388 KB |
Output is correct |
30 |
Correct |
16 ms |
3180 KB |
Output is correct |
31 |
Correct |
20 ms |
4072 KB |
Output is correct |
32 |
Correct |
21 ms |
3928 KB |
Output is correct |
33 |
Correct |
20 ms |
3944 KB |
Output is correct |
34 |
Correct |
20 ms |
3912 KB |
Output is correct |
35 |
Correct |
20 ms |
3944 KB |
Output is correct |
36 |
Correct |
21 ms |
3948 KB |
Output is correct |
37 |
Correct |
22 ms |
3948 KB |
Output is correct |
38 |
Correct |
22 ms |
4312 KB |
Output is correct |
39 |
Correct |
30 ms |
3936 KB |
Output is correct |
40 |
Correct |
22 ms |
3948 KB |
Output is correct |
41 |
Correct |
2 ms |
1492 KB |
Output is correct |
42 |
Correct |
1 ms |
1492 KB |
Output is correct |
43 |
Correct |
1 ms |
1492 KB |
Output is correct |
44 |
Correct |
2 ms |
1508 KB |
Output is correct |
45 |
Correct |
2 ms |
1556 KB |
Output is correct |
46 |
Correct |
2 ms |
1508 KB |
Output is correct |
47 |
Correct |
5 ms |
1820 KB |
Output is correct |
48 |
Correct |
5 ms |
1824 KB |
Output is correct |
49 |
Correct |
8 ms |
2388 KB |
Output is correct |
50 |
Correct |
18 ms |
3048 KB |
Output is correct |
51 |
Correct |
21 ms |
3796 KB |
Output is correct |
52 |
Correct |
23 ms |
3796 KB |
Output is correct |
53 |
Correct |
26 ms |
3816 KB |
Output is correct |
54 |
Correct |
21 ms |
3824 KB |
Output is correct |
55 |
Correct |
21 ms |
3820 KB |
Output is correct |
56 |
Correct |
21 ms |
3824 KB |
Output is correct |
57 |
Correct |
24 ms |
3812 KB |
Output is correct |
58 |
Correct |
29 ms |
3816 KB |
Output is correct |
59 |
Correct |
21 ms |
3816 KB |
Output is correct |
60 |
Correct |
21 ms |
3804 KB |
Output is correct |
61 |
Correct |
20 ms |
3816 KB |
Output is correct |
62 |
Correct |
20 ms |
3796 KB |
Output is correct |
63 |
Correct |
23 ms |
3816 KB |
Output is correct |
64 |
Correct |
25 ms |
3824 KB |
Output is correct |
65 |
Correct |
25 ms |
3812 KB |
Output is correct |
66 |
Correct |
21 ms |
3800 KB |
Output is correct |
67 |
Correct |
22 ms |
3844 KB |
Output is correct |
68 |
Correct |
21 ms |
3824 KB |
Output is correct |
69 |
Correct |
20 ms |
3796 KB |
Output is correct |
70 |
Correct |
21 ms |
3796 KB |
Output is correct |
71 |
Correct |
5 ms |
1876 KB |
Output is correct |
72 |
Correct |
5 ms |
1892 KB |
Output is correct |
73 |
Correct |
5 ms |
1896 KB |
Output is correct |
74 |
Correct |
5 ms |
1816 KB |
Output is correct |
75 |
Correct |
5 ms |
1876 KB |
Output is correct |
76 |
Correct |
9 ms |
2276 KB |
Output is correct |
77 |
Correct |
8 ms |
2260 KB |
Output is correct |
78 |
Correct |
8 ms |
2272 KB |
Output is correct |
79 |
Correct |
8 ms |
2260 KB |
Output is correct |
80 |
Correct |
9 ms |
2372 KB |
Output is correct |
81 |
Correct |
16 ms |
3176 KB |
Output is correct |
82 |
Correct |
18 ms |
3172 KB |
Output is correct |
83 |
Correct |
17 ms |
3156 KB |
Output is correct |
84 |
Correct |
20 ms |
3156 KB |
Output is correct |
85 |
Correct |
20 ms |
3312 KB |
Output is correct |
86 |
Correct |
17 ms |
3284 KB |
Output is correct |
87 |
Correct |
17 ms |
3284 KB |
Output is correct |
88 |
Correct |
18 ms |
3296 KB |
Output is correct |
89 |
Correct |
18 ms |
3348 KB |
Output is correct |
90 |
Correct |
17 ms |
3284 KB |
Output is correct |
91 |
Correct |
28 ms |
4308 KB |
Output is correct |
92 |
Correct |
29 ms |
4328 KB |
Output is correct |
93 |
Correct |
27 ms |
4300 KB |
Output is correct |
94 |
Correct |
34 ms |
4400 KB |
Output is correct |
95 |
Correct |
29 ms |
4452 KB |
Output is correct |
96 |
Correct |
35 ms |
4464 KB |
Output is correct |
97 |
Correct |
40 ms |
4448 KB |
Output is correct |
98 |
Correct |
31 ms |
4460 KB |
Output is correct |
99 |
Correct |
31 ms |
4452 KB |
Output is correct |
100 |
Correct |
32 ms |
4456 KB |
Output is correct |
101 |
Correct |
31 ms |
4440 KB |
Output is correct |
102 |
Correct |
31 ms |
4556 KB |
Output is correct |
103 |
Correct |
30 ms |
4440 KB |
Output is correct |
104 |
Correct |
33 ms |
4452 KB |
Output is correct |
105 |
Correct |
32 ms |
4432 KB |
Output is correct |
106 |
Correct |
36 ms |
4556 KB |
Output is correct |
107 |
Correct |
32 ms |
4564 KB |
Output is correct |
108 |
Correct |
31 ms |
4560 KB |
Output is correct |
109 |
Correct |
30 ms |
4580 KB |
Output is correct |
110 |
Correct |
31 ms |
4692 KB |
Output is correct |
111 |
Correct |
35 ms |
4580 KB |
Output is correct |
112 |
Correct |
32 ms |
4584 KB |
Output is correct |
113 |
Correct |
34 ms |
4576 KB |
Output is correct |
114 |
Correct |
33 ms |
4572 KB |
Output is correct |
115 |
Correct |
31 ms |
4572 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
1492 KB |
Output is correct |
2 |
Correct |
1 ms |
1492 KB |
Output is correct |
3 |
Correct |
1 ms |
1500 KB |
Output is correct |
4 |
Correct |
1 ms |
1492 KB |
Output is correct |
5 |
Correct |
1 ms |
1492 KB |
Output is correct |
6 |
Correct |
2 ms |
1492 KB |
Output is correct |
7 |
Correct |
2 ms |
1500 KB |
Output is correct |
8 |
Correct |
1 ms |
1492 KB |
Output is correct |
9 |
Correct |
1 ms |
1492 KB |
Output is correct |
10 |
Correct |
1 ms |
1496 KB |
Output is correct |
11 |
Correct |
1 ms |
1492 KB |
Output is correct |
12 |
Correct |
1 ms |
1492 KB |
Output is correct |
13 |
Correct |
2 ms |
1512 KB |
Output is correct |
14 |
Correct |
7 ms |
2408 KB |
Output is correct |
15 |
Correct |
14 ms |
3560 KB |
Output is correct |
16 |
Correct |
23 ms |
3928 KB |
Output is correct |
17 |
Correct |
20 ms |
5076 KB |
Output is correct |
18 |
Correct |
18 ms |
3792 KB |
Output is correct |
19 |
Correct |
20 ms |
3876 KB |
Output is correct |
20 |
Correct |
23 ms |
4312 KB |
Output is correct |
21 |
Correct |
25 ms |
4192 KB |
Output is correct |
22 |
Correct |
19 ms |
3944 KB |
Output is correct |
23 |
Correct |
19 ms |
3800 KB |
Output is correct |
24 |
Correct |
24 ms |
4312 KB |
Output is correct |
25 |
Correct |
22 ms |
4304 KB |
Output is correct |
26 |
Correct |
1 ms |
1492 KB |
Output is correct |
27 |
Correct |
1 ms |
1492 KB |
Output is correct |
28 |
Correct |
2 ms |
1492 KB |
Output is correct |
29 |
Correct |
9 ms |
2388 KB |
Output is correct |
30 |
Correct |
16 ms |
3180 KB |
Output is correct |
31 |
Correct |
20 ms |
4072 KB |
Output is correct |
32 |
Correct |
21 ms |
3928 KB |
Output is correct |
33 |
Correct |
20 ms |
3944 KB |
Output is correct |
34 |
Correct |
20 ms |
3912 KB |
Output is correct |
35 |
Correct |
20 ms |
3944 KB |
Output is correct |
36 |
Correct |
21 ms |
3948 KB |
Output is correct |
37 |
Correct |
22 ms |
3948 KB |
Output is correct |
38 |
Correct |
22 ms |
4312 KB |
Output is correct |
39 |
Correct |
30 ms |
3936 KB |
Output is correct |
40 |
Correct |
22 ms |
3948 KB |
Output is correct |
41 |
Correct |
2 ms |
1492 KB |
Output is correct |
42 |
Correct |
1 ms |
1492 KB |
Output is correct |
43 |
Correct |
1 ms |
1492 KB |
Output is correct |
44 |
Correct |
2 ms |
1508 KB |
Output is correct |
45 |
Correct |
2 ms |
1556 KB |
Output is correct |
46 |
Correct |
2 ms |
1508 KB |
Output is correct |
47 |
Correct |
5 ms |
1820 KB |
Output is correct |
48 |
Correct |
5 ms |
1824 KB |
Output is correct |
49 |
Correct |
8 ms |
2388 KB |
Output is correct |
50 |
Correct |
18 ms |
3048 KB |
Output is correct |
51 |
Correct |
21 ms |
3796 KB |
Output is correct |
52 |
Correct |
23 ms |
3796 KB |
Output is correct |
53 |
Correct |
26 ms |
3816 KB |
Output is correct |
54 |
Correct |
21 ms |
3824 KB |
Output is correct |
55 |
Correct |
21 ms |
3820 KB |
Output is correct |
56 |
Correct |
21 ms |
3824 KB |
Output is correct |
57 |
Correct |
24 ms |
3812 KB |
Output is correct |
58 |
Correct |
29 ms |
3816 KB |
Output is correct |
59 |
Correct |
21 ms |
3816 KB |
Output is correct |
60 |
Correct |
21 ms |
3804 KB |
Output is correct |
61 |
Correct |
20 ms |
3816 KB |
Output is correct |
62 |
Correct |
20 ms |
3796 KB |
Output is correct |
63 |
Correct |
23 ms |
3816 KB |
Output is correct |
64 |
Correct |
25 ms |
3824 KB |
Output is correct |
65 |
Correct |
25 ms |
3812 KB |
Output is correct |
66 |
Correct |
21 ms |
3800 KB |
Output is correct |
67 |
Correct |
22 ms |
3844 KB |
Output is correct |
68 |
Correct |
21 ms |
3824 KB |
Output is correct |
69 |
Correct |
20 ms |
3796 KB |
Output is correct |
70 |
Correct |
21 ms |
3796 KB |
Output is correct |
71 |
Correct |
5 ms |
1876 KB |
Output is correct |
72 |
Correct |
5 ms |
1892 KB |
Output is correct |
73 |
Correct |
5 ms |
1896 KB |
Output is correct |
74 |
Correct |
5 ms |
1816 KB |
Output is correct |
75 |
Correct |
5 ms |
1876 KB |
Output is correct |
76 |
Correct |
9 ms |
2276 KB |
Output is correct |
77 |
Correct |
8 ms |
2260 KB |
Output is correct |
78 |
Correct |
8 ms |
2272 KB |
Output is correct |
79 |
Correct |
8 ms |
2260 KB |
Output is correct |
80 |
Correct |
9 ms |
2372 KB |
Output is correct |
81 |
Correct |
16 ms |
3176 KB |
Output is correct |
82 |
Correct |
18 ms |
3172 KB |
Output is correct |
83 |
Correct |
17 ms |
3156 KB |
Output is correct |
84 |
Correct |
20 ms |
3156 KB |
Output is correct |
85 |
Correct |
20 ms |
3312 KB |
Output is correct |
86 |
Correct |
17 ms |
3284 KB |
Output is correct |
87 |
Correct |
17 ms |
3284 KB |
Output is correct |
88 |
Correct |
18 ms |
3296 KB |
Output is correct |
89 |
Correct |
18 ms |
3348 KB |
Output is correct |
90 |
Correct |
17 ms |
3284 KB |
Output is correct |
91 |
Correct |
28 ms |
4308 KB |
Output is correct |
92 |
Correct |
29 ms |
4328 KB |
Output is correct |
93 |
Correct |
27 ms |
4300 KB |
Output is correct |
94 |
Correct |
34 ms |
4400 KB |
Output is correct |
95 |
Correct |
29 ms |
4452 KB |
Output is correct |
96 |
Correct |
35 ms |
4464 KB |
Output is correct |
97 |
Correct |
40 ms |
4448 KB |
Output is correct |
98 |
Correct |
31 ms |
4460 KB |
Output is correct |
99 |
Correct |
31 ms |
4452 KB |
Output is correct |
100 |
Correct |
32 ms |
4456 KB |
Output is correct |
101 |
Correct |
31 ms |
4440 KB |
Output is correct |
102 |
Correct |
31 ms |
4556 KB |
Output is correct |
103 |
Correct |
30 ms |
4440 KB |
Output is correct |
104 |
Correct |
33 ms |
4452 KB |
Output is correct |
105 |
Correct |
32 ms |
4432 KB |
Output is correct |
106 |
Correct |
36 ms |
4556 KB |
Output is correct |
107 |
Correct |
32 ms |
4564 KB |
Output is correct |
108 |
Correct |
31 ms |
4560 KB |
Output is correct |
109 |
Correct |
30 ms |
4580 KB |
Output is correct |
110 |
Correct |
31 ms |
4692 KB |
Output is correct |
111 |
Correct |
35 ms |
4580 KB |
Output is correct |
112 |
Correct |
32 ms |
4584 KB |
Output is correct |
113 |
Correct |
34 ms |
4576 KB |
Output is correct |
114 |
Correct |
33 ms |
4572 KB |
Output is correct |
115 |
Correct |
31 ms |
4572 KB |
Output is correct |
116 |
Correct |
259 ms |
3432 KB |
Output is correct |
117 |
Correct |
335 ms |
3400 KB |
Output is correct |
118 |
Correct |
474 ms |
3952 KB |
Output is correct |
119 |
Correct |
468 ms |
4116 KB |
Output is correct |
120 |
Correct |
370 ms |
3992 KB |
Output is correct |
121 |
Correct |
671 ms |
4444 KB |
Output is correct |
122 |
Correct |
544 ms |
4556 KB |
Output is correct |
123 |
Correct |
1458 ms |
5376 KB |
Output is correct |
124 |
Correct |
1014 ms |
5544 KB |
Output is correct |
125 |
Correct |
949 ms |
5532 KB |
Output is correct |
126 |
Correct |
2570 ms |
6012 KB |
Output is correct |
127 |
Correct |
2558 ms |
5992 KB |
Output is correct |
128 |
Correct |
2592 ms |
6028 KB |
Output is correct |
129 |
Correct |
2533 ms |
5992 KB |
Output is correct |
130 |
Correct |
2556 ms |
5992 KB |
Output is correct |
131 |
Correct |
2615 ms |
6108 KB |
Output is correct |
132 |
Correct |
2664 ms |
6144 KB |
Output is correct |
133 |
Correct |
2645 ms |
6136 KB |
Output is correct |
134 |
Correct |
2671 ms |
6136 KB |
Output is correct |
135 |
Correct |
2696 ms |
6148 KB |
Output is correct |
136 |
Correct |
2661 ms |
6172 KB |
Output is correct |
137 |
Correct |
2656 ms |
6272 KB |
Output is correct |
138 |
Correct |
2675 ms |
6164 KB |
Output is correct |
139 |
Correct |
2648 ms |
6232 KB |
Output is correct |
140 |
Correct |
2679 ms |
6148 KB |
Output is correct |
141 |
Correct |
2420 ms |
6172 KB |
Output is correct |
142 |
Correct |
2398 ms |
6252 KB |
Output is correct |
143 |
Correct |
2421 ms |
6168 KB |
Output is correct |
144 |
Correct |
2424 ms |
6188 KB |
Output is correct |
145 |
Correct |
2432 ms |
6172 KB |
Output is correct |
146 |
Correct |
1914 ms |
6424 KB |
Output is correct |
147 |
Correct |
1894 ms |
6412 KB |
Output is correct |
148 |
Correct |
1956 ms |
6420 KB |
Output is correct |
149 |
Correct |
1892 ms |
6420 KB |
Output is correct |
150 |
Correct |
1897 ms |
6412 KB |
Output is correct |
151 |
Correct |
1982 ms |
6436 KB |
Output is correct |
152 |
Correct |
1962 ms |
6428 KB |
Output is correct |
153 |
Correct |
1939 ms |
6440 KB |
Output is correct |
154 |
Correct |
1980 ms |
6428 KB |
Output is correct |
155 |
Correct |
1944 ms |
6432 KB |
Output is correct |
156 |
Correct |
3095 ms |
7044 KB |
Output is correct |
157 |
Correct |
3025 ms |
7100 KB |
Output is correct |
158 |
Correct |
2941 ms |
6884 KB |
Output is correct |
159 |
Correct |
2932 ms |
6956 KB |
Output is correct |
160 |
Correct |
2899 ms |
6948 KB |
Output is correct |
161 |
Correct |
2696 ms |
7356 KB |
Output is correct |
162 |
Correct |
2665 ms |
7180 KB |
Output is correct |
163 |
Correct |
2605 ms |
7120 KB |
Output is correct |
164 |
Correct |
2665 ms |
7168 KB |
Output is correct |
165 |
Correct |
2591 ms |
7112 KB |
Output is correct |
166 |
Correct |
2802 ms |
6848 KB |
Output is correct |
167 |
Correct |
2753 ms |
6708 KB |
Output is correct |
168 |
Correct |
2673 ms |
6728 KB |
Output is correct |
169 |
Correct |
2839 ms |
6832 KB |
Output is correct |
170 |
Correct |
2898 ms |
6744 KB |
Output is correct |
171 |
Correct |
2902 ms |
6684 KB |
Output is correct |
172 |
Correct |
2914 ms |
6680 KB |
Output is correct |
173 |
Correct |
2727 ms |
6692 KB |
Output is correct |
174 |
Correct |
2736 ms |
6700 KB |
Output is correct |
175 |
Correct |
2834 ms |
6820 KB |
Output is correct |