#include <bits/stdc++.h>
using namespace std;
#define int long long
const int N = 1'000'000 + 10,
M = 1'000'003,
MAX = 1'000'000'001;
int n;
int h[N];
int prefMax[N], suffMax[N];
int goalH[N];
int f[N << 2];
void build(int s, int l, int r) {
if (l == r) {
f[s] = h[l];
return;
}
int mid = (l + r) >> 1;
build(s << 1, l, mid); build(s << 1 | 1, mid + 1, r);
f[s] = min(f[s << 1], f[s << 1 | 1]);
}
void update(int s, int l, int r, int p, int x) {
if (p < l || p > r) return;
if (l == r) {
f[s] = x;
return;
}
int mid = (l + r) >> 1;
update(s << 1, l, mid, p, x); update(s << 1 | 1, mid + 1, r, p, x);
f[s] = min(f[s << 1], f[s << 1 | 1]);
}
int query(int s, int l, int r, int u, int v) {
if (v < l || u > r) return MAX;
if (u <= l && r <= v) return f[s];
int mid = (l + r) >> 1;
return min(query(s << 1, l, mid, u, v), query(s << 1 | 1, mid + 1, r, u, v));
}
set<int> s[N];
vector<int> del[N];
int32_t main() {
cin.tie(0)->sync_with_stdio(0);
cin >> n;
for (int i = 1; i <= n; ++i) cin >> h[i];
build(1, 1, n);
vector<int> allValue(h + 1, h + n + 1);
sort(allValue.begin(), allValue.end());
allValue.erase(unique(allValue.begin(), allValue.end()), allValue.end());
for (int i = 1; i <= n; ++i)
h[i] = lower_bound(allValue.begin(), allValue.end(), h[i]) - allValue.begin();
for (int i = 1; i <= n; ++i) prefMax[i] = max(prefMax[i - 1], h[i]);
for (int i = n; i >= 1; --i) suffMax[i] = max(suffMax[i + 1], h[i]);
for (int i = 1; i <= n; ++i) goalH[i] = min(prefMax[i], suffMax[i]);
for (int i = 1; i <= n; ++i) {
s[h[i]].insert(i);
del[goalH[i]].push_back(i);
}
auto sum = [&](int l, int r) {
return (1ll * (r + l) * (r - l + 1) / 2) % M;
};
auto add = [&](auto& x, const auto& y) {
x += y;
if (x >= M) x -= M;
};
long long answer = 0;
set<int> vt;
for (int it = 0; it < (int)allValue.size() - 1; ++it) {
int height = allValue[it], nxtHeight = allValue[it + 1];
for (const auto& i : s[it]) {
vt.insert(i);
update(1, 1, n, i, MAX);
}
for (const auto& i : del[it]) vt.erase(i);
if (!vt.size()) continue;
int cnt = nxtHeight - height;
if (vt.size() == 1) {
int i = *vt.begin();
add(answer, 1ll * cnt * (query(1, 1, n, 1, i) + query(1, 1, n, i, n)) % M);
add(answer, sum(height, nxtHeight - 1));
} else {
int l = *vt.begin(), r = *vt.rbegin();
long long addLFirst = query(1, 1, n, 1, l) + query(1, 1, n, l, n) +
query(1, 1, n, r, n);
long long addRFirst = query(1, 1, n, 1, r) + query(1, 1, n, r, n) +
query(1, 1, n, 1, l);
add(answer, 1ll * min(addLFirst, addRFirst) % M * cnt % M);
add(answer, sum(height, nxtHeight - 1));
add(answer, sum(height, nxtHeight - 1));
add(answer, sum(height + 1, nxtHeight));
int total = 0;
add(total, sum(height, nxtHeight - 1));
add(total, sum(height + 1, nxtHeight));
add(total, sum(height + 1, nxtHeight));
add(answer, 1ll * (vt.size() - 2) % M * total % M);
}
}
cout << answer % M << "\n";
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
48 ms |
70728 KB |
Output is correct |
2 |
Correct |
49 ms |
70728 KB |
Output is correct |
3 |
Correct |
50 ms |
70692 KB |
Output is correct |
4 |
Correct |
52 ms |
71760 KB |
Output is correct |
5 |
Correct |
50 ms |
71552 KB |
Output is correct |
6 |
Correct |
49 ms |
71468 KB |
Output is correct |
7 |
Correct |
50 ms |
71496 KB |
Output is correct |
8 |
Correct |
52 ms |
71752 KB |
Output is correct |
9 |
Correct |
51 ms |
71480 KB |
Output is correct |
10 |
Correct |
53 ms |
71496 KB |
Output is correct |
11 |
Correct |
54 ms |
71644 KB |
Output is correct |
12 |
Correct |
57 ms |
71644 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
48 ms |
70728 KB |
Output is correct |
2 |
Correct |
49 ms |
70728 KB |
Output is correct |
3 |
Correct |
50 ms |
70692 KB |
Output is correct |
4 |
Correct |
52 ms |
71760 KB |
Output is correct |
5 |
Correct |
50 ms |
71552 KB |
Output is correct |
6 |
Correct |
49 ms |
71468 KB |
Output is correct |
7 |
Correct |
50 ms |
71496 KB |
Output is correct |
8 |
Correct |
52 ms |
71752 KB |
Output is correct |
9 |
Correct |
51 ms |
71480 KB |
Output is correct |
10 |
Correct |
53 ms |
71496 KB |
Output is correct |
11 |
Correct |
54 ms |
71644 KB |
Output is correct |
12 |
Correct |
57 ms |
71644 KB |
Output is correct |
13 |
Correct |
53 ms |
71752 KB |
Output is correct |
14 |
Correct |
50 ms |
70728 KB |
Output is correct |
15 |
Correct |
50 ms |
70728 KB |
Output is correct |
16 |
Correct |
54 ms |
71776 KB |
Output is correct |
17 |
Correct |
55 ms |
71600 KB |
Output is correct |
18 |
Correct |
52 ms |
71752 KB |
Output is correct |
19 |
Correct |
57 ms |
71720 KB |
Output is correct |
20 |
Correct |
52 ms |
71572 KB |
Output is correct |
21 |
Correct |
53 ms |
71752 KB |
Output is correct |
22 |
Correct |
50 ms |
71752 KB |
Output is correct |
23 |
Correct |
53 ms |
71752 KB |
Output is correct |
24 |
Correct |
60 ms |
71748 KB |
Output is correct |
25 |
Correct |
54 ms |
71752 KB |
Output is correct |
26 |
Correct |
57 ms |
71548 KB |
Output is correct |
27 |
Correct |
53 ms |
71708 KB |
Output is correct |
28 |
Correct |
52 ms |
71752 KB |
Output is correct |
29 |
Correct |
44 ms |
70728 KB |
Output is correct |
30 |
Correct |
44 ms |
70728 KB |
Output is correct |
31 |
Correct |
44 ms |
70908 KB |
Output is correct |
32 |
Correct |
45 ms |
70784 KB |
Output is correct |
33 |
Correct |
50 ms |
70728 KB |
Output is correct |
34 |
Correct |
44 ms |
70728 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
48 ms |
70728 KB |
Output is correct |
2 |
Correct |
49 ms |
70728 KB |
Output is correct |
3 |
Correct |
50 ms |
70692 KB |
Output is correct |
4 |
Correct |
52 ms |
71760 KB |
Output is correct |
5 |
Correct |
50 ms |
71552 KB |
Output is correct |
6 |
Correct |
49 ms |
71468 KB |
Output is correct |
7 |
Correct |
50 ms |
71496 KB |
Output is correct |
8 |
Correct |
52 ms |
71752 KB |
Output is correct |
9 |
Correct |
51 ms |
71480 KB |
Output is correct |
10 |
Correct |
53 ms |
71496 KB |
Output is correct |
11 |
Correct |
54 ms |
71644 KB |
Output is correct |
12 |
Correct |
57 ms |
71644 KB |
Output is correct |
13 |
Correct |
53 ms |
71752 KB |
Output is correct |
14 |
Correct |
50 ms |
70728 KB |
Output is correct |
15 |
Correct |
50 ms |
70728 KB |
Output is correct |
16 |
Correct |
54 ms |
71776 KB |
Output is correct |
17 |
Correct |
55 ms |
71600 KB |
Output is correct |
18 |
Correct |
52 ms |
71752 KB |
Output is correct |
19 |
Correct |
57 ms |
71720 KB |
Output is correct |
20 |
Correct |
52 ms |
71572 KB |
Output is correct |
21 |
Correct |
53 ms |
71752 KB |
Output is correct |
22 |
Correct |
50 ms |
71752 KB |
Output is correct |
23 |
Correct |
53 ms |
71752 KB |
Output is correct |
24 |
Correct |
60 ms |
71748 KB |
Output is correct |
25 |
Correct |
54 ms |
71752 KB |
Output is correct |
26 |
Correct |
57 ms |
71548 KB |
Output is correct |
27 |
Correct |
53 ms |
71708 KB |
Output is correct |
28 |
Correct |
52 ms |
71752 KB |
Output is correct |
29 |
Correct |
44 ms |
70728 KB |
Output is correct |
30 |
Correct |
44 ms |
70728 KB |
Output is correct |
31 |
Correct |
44 ms |
70908 KB |
Output is correct |
32 |
Correct |
45 ms |
70784 KB |
Output is correct |
33 |
Correct |
50 ms |
70728 KB |
Output is correct |
34 |
Correct |
44 ms |
70728 KB |
Output is correct |
35 |
Correct |
50 ms |
71632 KB |
Output is correct |
36 |
Correct |
51 ms |
71764 KB |
Output is correct |
37 |
Correct |
50 ms |
71752 KB |
Output is correct |
38 |
Correct |
55 ms |
71732 KB |
Output is correct |
39 |
Correct |
51 ms |
71688 KB |
Output is correct |
40 |
Correct |
51 ms |
71752 KB |
Output is correct |
41 |
Correct |
48 ms |
71576 KB |
Output is correct |
42 |
Correct |
47 ms |
71760 KB |
Output is correct |
43 |
Correct |
49 ms |
71752 KB |
Output is correct |
44 |
Correct |
49 ms |
71752 KB |
Output is correct |
45 |
Correct |
50 ms |
71680 KB |
Output is correct |
46 |
Correct |
48 ms |
71752 KB |
Output is correct |
47 |
Correct |
48 ms |
71752 KB |
Output is correct |
48 |
Correct |
58 ms |
71700 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
48 ms |
70728 KB |
Output is correct |
2 |
Correct |
49 ms |
70728 KB |
Output is correct |
3 |
Correct |
50 ms |
70692 KB |
Output is correct |
4 |
Correct |
52 ms |
71760 KB |
Output is correct |
5 |
Correct |
50 ms |
71552 KB |
Output is correct |
6 |
Correct |
49 ms |
71468 KB |
Output is correct |
7 |
Correct |
50 ms |
71496 KB |
Output is correct |
8 |
Correct |
52 ms |
71752 KB |
Output is correct |
9 |
Correct |
51 ms |
71480 KB |
Output is correct |
10 |
Correct |
53 ms |
71496 KB |
Output is correct |
11 |
Correct |
54 ms |
71644 KB |
Output is correct |
12 |
Correct |
57 ms |
71644 KB |
Output is correct |
13 |
Correct |
53 ms |
71752 KB |
Output is correct |
14 |
Correct |
50 ms |
70728 KB |
Output is correct |
15 |
Correct |
50 ms |
70728 KB |
Output is correct |
16 |
Correct |
54 ms |
71776 KB |
Output is correct |
17 |
Correct |
55 ms |
71600 KB |
Output is correct |
18 |
Correct |
52 ms |
71752 KB |
Output is correct |
19 |
Correct |
57 ms |
71720 KB |
Output is correct |
20 |
Correct |
52 ms |
71572 KB |
Output is correct |
21 |
Correct |
53 ms |
71752 KB |
Output is correct |
22 |
Correct |
50 ms |
71752 KB |
Output is correct |
23 |
Correct |
53 ms |
71752 KB |
Output is correct |
24 |
Correct |
60 ms |
71748 KB |
Output is correct |
25 |
Correct |
54 ms |
71752 KB |
Output is correct |
26 |
Correct |
57 ms |
71548 KB |
Output is correct |
27 |
Correct |
53 ms |
71708 KB |
Output is correct |
28 |
Correct |
52 ms |
71752 KB |
Output is correct |
29 |
Correct |
44 ms |
70728 KB |
Output is correct |
30 |
Correct |
44 ms |
70728 KB |
Output is correct |
31 |
Correct |
44 ms |
70908 KB |
Output is correct |
32 |
Correct |
45 ms |
70784 KB |
Output is correct |
33 |
Correct |
50 ms |
70728 KB |
Output is correct |
34 |
Correct |
44 ms |
70728 KB |
Output is correct |
35 |
Correct |
50 ms |
71632 KB |
Output is correct |
36 |
Correct |
51 ms |
71764 KB |
Output is correct |
37 |
Correct |
50 ms |
71752 KB |
Output is correct |
38 |
Correct |
55 ms |
71732 KB |
Output is correct |
39 |
Correct |
51 ms |
71688 KB |
Output is correct |
40 |
Correct |
51 ms |
71752 KB |
Output is correct |
41 |
Correct |
48 ms |
71576 KB |
Output is correct |
42 |
Correct |
47 ms |
71760 KB |
Output is correct |
43 |
Correct |
49 ms |
71752 KB |
Output is correct |
44 |
Correct |
49 ms |
71752 KB |
Output is correct |
45 |
Correct |
50 ms |
71680 KB |
Output is correct |
46 |
Correct |
48 ms |
71752 KB |
Output is correct |
47 |
Correct |
48 ms |
71752 KB |
Output is correct |
48 |
Correct |
58 ms |
71700 KB |
Output is correct |
49 |
Correct |
56 ms |
71764 KB |
Output is correct |
50 |
Correct |
53 ms |
71752 KB |
Output is correct |
51 |
Correct |
60 ms |
71752 KB |
Output is correct |
52 |
Correct |
54 ms |
71752 KB |
Output is correct |
53 |
Correct |
54 ms |
71600 KB |
Output is correct |
54 |
Correct |
53 ms |
71752 KB |
Output is correct |
55 |
Correct |
52 ms |
71752 KB |
Output is correct |
56 |
Correct |
49 ms |
71752 KB |
Output is correct |
57 |
Correct |
50 ms |
71772 KB |
Output is correct |
58 |
Correct |
48 ms |
71676 KB |
Output is correct |
59 |
Correct |
49 ms |
71752 KB |
Output is correct |
60 |
Correct |
56 ms |
71752 KB |
Output is correct |
61 |
Correct |
53 ms |
71752 KB |
Output is correct |
62 |
Correct |
48 ms |
71760 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
48 ms |
70728 KB |
Output is correct |
2 |
Correct |
49 ms |
70728 KB |
Output is correct |
3 |
Correct |
50 ms |
70692 KB |
Output is correct |
4 |
Correct |
52 ms |
71760 KB |
Output is correct |
5 |
Correct |
50 ms |
71552 KB |
Output is correct |
6 |
Correct |
49 ms |
71468 KB |
Output is correct |
7 |
Correct |
50 ms |
71496 KB |
Output is correct |
8 |
Correct |
52 ms |
71752 KB |
Output is correct |
9 |
Correct |
51 ms |
71480 KB |
Output is correct |
10 |
Correct |
53 ms |
71496 KB |
Output is correct |
11 |
Correct |
54 ms |
71644 KB |
Output is correct |
12 |
Correct |
57 ms |
71644 KB |
Output is correct |
13 |
Correct |
53 ms |
71752 KB |
Output is correct |
14 |
Correct |
50 ms |
70728 KB |
Output is correct |
15 |
Correct |
50 ms |
70728 KB |
Output is correct |
16 |
Correct |
54 ms |
71776 KB |
Output is correct |
17 |
Correct |
55 ms |
71600 KB |
Output is correct |
18 |
Correct |
52 ms |
71752 KB |
Output is correct |
19 |
Correct |
57 ms |
71720 KB |
Output is correct |
20 |
Correct |
52 ms |
71572 KB |
Output is correct |
21 |
Correct |
53 ms |
71752 KB |
Output is correct |
22 |
Correct |
50 ms |
71752 KB |
Output is correct |
23 |
Correct |
53 ms |
71752 KB |
Output is correct |
24 |
Correct |
60 ms |
71748 KB |
Output is correct |
25 |
Correct |
54 ms |
71752 KB |
Output is correct |
26 |
Correct |
57 ms |
71548 KB |
Output is correct |
27 |
Correct |
53 ms |
71708 KB |
Output is correct |
28 |
Correct |
52 ms |
71752 KB |
Output is correct |
29 |
Correct |
44 ms |
70728 KB |
Output is correct |
30 |
Correct |
44 ms |
70728 KB |
Output is correct |
31 |
Correct |
44 ms |
70908 KB |
Output is correct |
32 |
Correct |
45 ms |
70784 KB |
Output is correct |
33 |
Correct |
50 ms |
70728 KB |
Output is correct |
34 |
Correct |
44 ms |
70728 KB |
Output is correct |
35 |
Correct |
1639 ms |
229540 KB |
Output is correct |
36 |
Correct |
1619 ms |
230596 KB |
Output is correct |
37 |
Correct |
1717 ms |
227516 KB |
Output is correct |
38 |
Correct |
1460 ms |
227740 KB |
Output is correct |
39 |
Correct |
1420 ms |
227904 KB |
Output is correct |
40 |
Correct |
49 ms |
70820 KB |
Output is correct |
41 |
Correct |
49 ms |
70812 KB |
Output is correct |
42 |
Correct |
1035 ms |
228156 KB |
Output is correct |
43 |
Correct |
1093 ms |
229680 KB |
Output is correct |
44 |
Correct |
1051 ms |
229276 KB |
Output is correct |
45 |
Correct |
623 ms |
227944 KB |
Output is correct |
46 |
Correct |
651 ms |
227596 KB |
Output is correct |
47 |
Correct |
664 ms |
227572 KB |
Output is correct |
48 |
Correct |
870 ms |
227708 KB |
Output is correct |
49 |
Correct |
851 ms |
229660 KB |
Output is correct |
50 |
Correct |
829 ms |
229532 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
48 ms |
70728 KB |
Output is correct |
2 |
Correct |
49 ms |
70728 KB |
Output is correct |
3 |
Correct |
50 ms |
70692 KB |
Output is correct |
4 |
Correct |
52 ms |
71760 KB |
Output is correct |
5 |
Correct |
50 ms |
71552 KB |
Output is correct |
6 |
Correct |
49 ms |
71468 KB |
Output is correct |
7 |
Correct |
50 ms |
71496 KB |
Output is correct |
8 |
Correct |
52 ms |
71752 KB |
Output is correct |
9 |
Correct |
51 ms |
71480 KB |
Output is correct |
10 |
Correct |
53 ms |
71496 KB |
Output is correct |
11 |
Correct |
54 ms |
71644 KB |
Output is correct |
12 |
Correct |
57 ms |
71644 KB |
Output is correct |
13 |
Correct |
53 ms |
71752 KB |
Output is correct |
14 |
Correct |
50 ms |
70728 KB |
Output is correct |
15 |
Correct |
50 ms |
70728 KB |
Output is correct |
16 |
Correct |
54 ms |
71776 KB |
Output is correct |
17 |
Correct |
55 ms |
71600 KB |
Output is correct |
18 |
Correct |
52 ms |
71752 KB |
Output is correct |
19 |
Correct |
57 ms |
71720 KB |
Output is correct |
20 |
Correct |
52 ms |
71572 KB |
Output is correct |
21 |
Correct |
53 ms |
71752 KB |
Output is correct |
22 |
Correct |
50 ms |
71752 KB |
Output is correct |
23 |
Correct |
53 ms |
71752 KB |
Output is correct |
24 |
Correct |
60 ms |
71748 KB |
Output is correct |
25 |
Correct |
54 ms |
71752 KB |
Output is correct |
26 |
Correct |
57 ms |
71548 KB |
Output is correct |
27 |
Correct |
53 ms |
71708 KB |
Output is correct |
28 |
Correct |
52 ms |
71752 KB |
Output is correct |
29 |
Correct |
44 ms |
70728 KB |
Output is correct |
30 |
Correct |
44 ms |
70728 KB |
Output is correct |
31 |
Correct |
44 ms |
70908 KB |
Output is correct |
32 |
Correct |
45 ms |
70784 KB |
Output is correct |
33 |
Correct |
50 ms |
70728 KB |
Output is correct |
34 |
Correct |
44 ms |
70728 KB |
Output is correct |
35 |
Correct |
50 ms |
71632 KB |
Output is correct |
36 |
Correct |
51 ms |
71764 KB |
Output is correct |
37 |
Correct |
50 ms |
71752 KB |
Output is correct |
38 |
Correct |
55 ms |
71732 KB |
Output is correct |
39 |
Correct |
51 ms |
71688 KB |
Output is correct |
40 |
Correct |
51 ms |
71752 KB |
Output is correct |
41 |
Correct |
48 ms |
71576 KB |
Output is correct |
42 |
Correct |
47 ms |
71760 KB |
Output is correct |
43 |
Correct |
49 ms |
71752 KB |
Output is correct |
44 |
Correct |
49 ms |
71752 KB |
Output is correct |
45 |
Correct |
50 ms |
71680 KB |
Output is correct |
46 |
Correct |
48 ms |
71752 KB |
Output is correct |
47 |
Correct |
48 ms |
71752 KB |
Output is correct |
48 |
Correct |
58 ms |
71700 KB |
Output is correct |
49 |
Correct |
1639 ms |
229540 KB |
Output is correct |
50 |
Correct |
1619 ms |
230596 KB |
Output is correct |
51 |
Correct |
1717 ms |
227516 KB |
Output is correct |
52 |
Correct |
1460 ms |
227740 KB |
Output is correct |
53 |
Correct |
1420 ms |
227904 KB |
Output is correct |
54 |
Correct |
49 ms |
70820 KB |
Output is correct |
55 |
Correct |
49 ms |
70812 KB |
Output is correct |
56 |
Correct |
1035 ms |
228156 KB |
Output is correct |
57 |
Correct |
1093 ms |
229680 KB |
Output is correct |
58 |
Correct |
1051 ms |
229276 KB |
Output is correct |
59 |
Correct |
623 ms |
227944 KB |
Output is correct |
60 |
Correct |
651 ms |
227596 KB |
Output is correct |
61 |
Correct |
664 ms |
227572 KB |
Output is correct |
62 |
Correct |
870 ms |
227708 KB |
Output is correct |
63 |
Correct |
851 ms |
229660 KB |
Output is correct |
64 |
Correct |
829 ms |
229532 KB |
Output is correct |
65 |
Correct |
2362 ms |
231600 KB |
Output is correct |
66 |
Correct |
2545 ms |
228152 KB |
Output is correct |
67 |
Correct |
2734 ms |
228000 KB |
Output is correct |
68 |
Correct |
2839 ms |
231604 KB |
Output is correct |
69 |
Correct |
2351 ms |
231564 KB |
Output is correct |
70 |
Correct |
942 ms |
229408 KB |
Output is correct |
71 |
Correct |
1090 ms |
229304 KB |
Output is correct |
72 |
Correct |
1112 ms |
229364 KB |
Output is correct |
73 |
Correct |
1062 ms |
228508 KB |
Output is correct |
74 |
Correct |
1029 ms |
231792 KB |
Output is correct |
75 |
Correct |
984 ms |
231580 KB |
Output is correct |
76 |
Correct |
1411 ms |
231536 KB |
Output is correct |
77 |
Correct |
1450 ms |
227744 KB |
Output is correct |
78 |
Correct |
1396 ms |
231340 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
48 ms |
70728 KB |
Output is correct |
2 |
Correct |
49 ms |
70728 KB |
Output is correct |
3 |
Correct |
50 ms |
70692 KB |
Output is correct |
4 |
Correct |
52 ms |
71760 KB |
Output is correct |
5 |
Correct |
50 ms |
71552 KB |
Output is correct |
6 |
Correct |
49 ms |
71468 KB |
Output is correct |
7 |
Correct |
50 ms |
71496 KB |
Output is correct |
8 |
Correct |
52 ms |
71752 KB |
Output is correct |
9 |
Correct |
51 ms |
71480 KB |
Output is correct |
10 |
Correct |
53 ms |
71496 KB |
Output is correct |
11 |
Correct |
54 ms |
71644 KB |
Output is correct |
12 |
Correct |
57 ms |
71644 KB |
Output is correct |
13 |
Correct |
53 ms |
71752 KB |
Output is correct |
14 |
Correct |
50 ms |
70728 KB |
Output is correct |
15 |
Correct |
50 ms |
70728 KB |
Output is correct |
16 |
Correct |
54 ms |
71776 KB |
Output is correct |
17 |
Correct |
55 ms |
71600 KB |
Output is correct |
18 |
Correct |
52 ms |
71752 KB |
Output is correct |
19 |
Correct |
57 ms |
71720 KB |
Output is correct |
20 |
Correct |
52 ms |
71572 KB |
Output is correct |
21 |
Correct |
53 ms |
71752 KB |
Output is correct |
22 |
Correct |
50 ms |
71752 KB |
Output is correct |
23 |
Correct |
53 ms |
71752 KB |
Output is correct |
24 |
Correct |
60 ms |
71748 KB |
Output is correct |
25 |
Correct |
54 ms |
71752 KB |
Output is correct |
26 |
Correct |
57 ms |
71548 KB |
Output is correct |
27 |
Correct |
53 ms |
71708 KB |
Output is correct |
28 |
Correct |
52 ms |
71752 KB |
Output is correct |
29 |
Correct |
44 ms |
70728 KB |
Output is correct |
30 |
Correct |
44 ms |
70728 KB |
Output is correct |
31 |
Correct |
44 ms |
70908 KB |
Output is correct |
32 |
Correct |
45 ms |
70784 KB |
Output is correct |
33 |
Correct |
50 ms |
70728 KB |
Output is correct |
34 |
Correct |
44 ms |
70728 KB |
Output is correct |
35 |
Correct |
50 ms |
71632 KB |
Output is correct |
36 |
Correct |
51 ms |
71764 KB |
Output is correct |
37 |
Correct |
50 ms |
71752 KB |
Output is correct |
38 |
Correct |
55 ms |
71732 KB |
Output is correct |
39 |
Correct |
51 ms |
71688 KB |
Output is correct |
40 |
Correct |
51 ms |
71752 KB |
Output is correct |
41 |
Correct |
48 ms |
71576 KB |
Output is correct |
42 |
Correct |
47 ms |
71760 KB |
Output is correct |
43 |
Correct |
49 ms |
71752 KB |
Output is correct |
44 |
Correct |
49 ms |
71752 KB |
Output is correct |
45 |
Correct |
50 ms |
71680 KB |
Output is correct |
46 |
Correct |
48 ms |
71752 KB |
Output is correct |
47 |
Correct |
48 ms |
71752 KB |
Output is correct |
48 |
Correct |
58 ms |
71700 KB |
Output is correct |
49 |
Correct |
56 ms |
71764 KB |
Output is correct |
50 |
Correct |
53 ms |
71752 KB |
Output is correct |
51 |
Correct |
60 ms |
71752 KB |
Output is correct |
52 |
Correct |
54 ms |
71752 KB |
Output is correct |
53 |
Correct |
54 ms |
71600 KB |
Output is correct |
54 |
Correct |
53 ms |
71752 KB |
Output is correct |
55 |
Correct |
52 ms |
71752 KB |
Output is correct |
56 |
Correct |
49 ms |
71752 KB |
Output is correct |
57 |
Correct |
50 ms |
71772 KB |
Output is correct |
58 |
Correct |
48 ms |
71676 KB |
Output is correct |
59 |
Correct |
49 ms |
71752 KB |
Output is correct |
60 |
Correct |
56 ms |
71752 KB |
Output is correct |
61 |
Correct |
53 ms |
71752 KB |
Output is correct |
62 |
Correct |
48 ms |
71760 KB |
Output is correct |
63 |
Correct |
1639 ms |
229540 KB |
Output is correct |
64 |
Correct |
1619 ms |
230596 KB |
Output is correct |
65 |
Correct |
1717 ms |
227516 KB |
Output is correct |
66 |
Correct |
1460 ms |
227740 KB |
Output is correct |
67 |
Correct |
1420 ms |
227904 KB |
Output is correct |
68 |
Correct |
49 ms |
70820 KB |
Output is correct |
69 |
Correct |
49 ms |
70812 KB |
Output is correct |
70 |
Correct |
1035 ms |
228156 KB |
Output is correct |
71 |
Correct |
1093 ms |
229680 KB |
Output is correct |
72 |
Correct |
1051 ms |
229276 KB |
Output is correct |
73 |
Correct |
623 ms |
227944 KB |
Output is correct |
74 |
Correct |
651 ms |
227596 KB |
Output is correct |
75 |
Correct |
664 ms |
227572 KB |
Output is correct |
76 |
Correct |
870 ms |
227708 KB |
Output is correct |
77 |
Correct |
851 ms |
229660 KB |
Output is correct |
78 |
Correct |
829 ms |
229532 KB |
Output is correct |
79 |
Correct |
2362 ms |
231600 KB |
Output is correct |
80 |
Correct |
2545 ms |
228152 KB |
Output is correct |
81 |
Correct |
2734 ms |
228000 KB |
Output is correct |
82 |
Correct |
2839 ms |
231604 KB |
Output is correct |
83 |
Correct |
2351 ms |
231564 KB |
Output is correct |
84 |
Correct |
942 ms |
229408 KB |
Output is correct |
85 |
Correct |
1090 ms |
229304 KB |
Output is correct |
86 |
Correct |
1112 ms |
229364 KB |
Output is correct |
87 |
Correct |
1062 ms |
228508 KB |
Output is correct |
88 |
Correct |
1029 ms |
231792 KB |
Output is correct |
89 |
Correct |
984 ms |
231580 KB |
Output is correct |
90 |
Correct |
1411 ms |
231536 KB |
Output is correct |
91 |
Correct |
1450 ms |
227744 KB |
Output is correct |
92 |
Correct |
1396 ms |
231340 KB |
Output is correct |
93 |
Correct |
947 ms |
230064 KB |
Output is correct |
94 |
Correct |
1128 ms |
238204 KB |
Output is correct |
95 |
Correct |
1219 ms |
237832 KB |
Output is correct |
96 |
Correct |
1213 ms |
237724 KB |
Output is correct |
97 |
Correct |
1612 ms |
238100 KB |
Output is correct |
98 |
Correct |
1635 ms |
237744 KB |
Output is correct |
99 |
Correct |
1610 ms |
237572 KB |
Output is correct |
100 |
Correct |
2587 ms |
237836 KB |
Output is correct |
101 |
Correct |
2874 ms |
237684 KB |
Output is correct |
102 |
Correct |
2887 ms |
237728 KB |
Output is correct |
103 |
Correct |
2736 ms |
237780 KB |
Output is correct |
104 |
Correct |
2686 ms |
237684 KB |
Output is correct |
105 |
Correct |
899 ms |
230112 KB |
Output is correct |
106 |
Correct |
977 ms |
230232 KB |
Output is correct |