// [+]
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 1e6 + 5;
int n, m, a[N], b[N], p[N], q[N];
ll s[N], t[N];
ll sum_a[N], sum_b[N];
vector<pair<int, ll>> node[N];
int M;
const ll INF = 1e18;
struct Node {
ll mx, pls, val;
Node() {
mx = val = -INF;
pls = 0;
}
};
struct LazySegmentTree {
Node IT[N << 2];
inline void apply_add(int id, ll w) {
IT[id].mx += w;
IT[id].val += w;
IT[id].pls += w;
}
inline void apply_max(int id, ll w) {
IT[id].mx = max(IT[id].mx, w);
IT[id].val = max(IT[id].val, w);
}
void push(int id) {
if (ll &lz = IT[id].pls) {
apply_add(id << 1, lz);
apply_add(id << 1 | 1, lz);
lz = 0;
}
ll &lz = IT[id].mx;
if (lz != -INF) {
apply_max(id << 1, lz);
apply_max(id << 1 | 1, lz);
lz = -INF;
}
}
void update_add(int x, int y, ll w, int id, int l, int r) {
if (l > y || r < x) return;
if (x <= l && r <= y)
return apply_add(id, w);
push(id);
int mid = (l + r) / 2;
update_add(x, y, w, id << 1, l, mid);
update_add(x, y, w, id << 1 | 1, mid + 1, r);
}
inline void update_add(int x, int y, ll w) {
// cerr << "update_add(" << x << ", " << y << ", " << w << ")\n";
update_add(x, y, w, 1, 1, M);
}
void update_max(int x, int y, ll w, int id, int l, int r) {
if (l > y || r < x) return;
if (x <= l && r <= y)
return apply_max(id, w);
push(id);
int mid = (l + r) / 2;
update_max(x, y, w, id << 1, l, mid);
update_max(x, y, w, id << 1 | 1, mid + 1, r);
}
inline void update_max(int x, int y, ll w) {
// cerr << "update_max(" << x << ", " << y << ", " << w << ")\n";
update_max(x, y, w, 1, 1, M);
}
ll get(int x, int id, int l, int r) {
if (l == r) return IT[id].val;
push(id);
int mid = (l + r) / 2;
if (x <= mid) return get(x, id << 1, l, mid);
else return get(x, id << 1 | 1, mid + 1, r);
}
inline ll get(int x) {
// cerr << "get(" << x << ") = " << get(x, 1, 1, M) << '\n';
return get(x, 1, 1, M);
}
} seg;
ll debug[1000][1000];
int32_t main() {
// cin.tie(0)->sync_with_stdio(0);
cin >> n >> m;
for (int i = 1; i <= n; i++)
cin >> a[i] >> s[i] >> p[i];
for (int i = 1; i <= m; i++)
cin >> b[i] >> t[i] >> q[i];
for (int i = 1; i <= n; i++)
sum_a[i] = sum_a[i - 1] + a[i];
for (int i = 1; i <= m; i++)
sum_b[i] = sum_b[i - 1] + b[i];
for (int i = 1; i <= n; i++) {
if (sum_a[i] > s[i]) continue;
int pos = ([&] () -> int {
int l = 1, r = m, ans = 0;
while (l <= r) {
int mid = (l + r) / 2;
if (sum_a[i] + sum_b[mid] <= s[i]) {
ans = mid;
l = mid + 1;
} else r = mid - 1;
}
return ans;
}());
node[i].emplace_back(pos, p[i]);
}
ll siu = 0;
for (int i = 1; i <= m; i++) {
if (sum_b[i] > t[i]) continue;
int pos = ([&] () -> int {
int l = 1, r = n, ans = 0;
while (l <= r) {
int mid = (l + r) / 2;
if (sum_b[i] + sum_a[mid] <= t[i]) {
ans = mid;
l = mid + 1;
} else r = mid - 1;
}
return ans;
}());
if (pos != n) node[pos + 1].emplace_back(i - 1, -q[i]);
siu += q[i];
// cerr << "hihi " << i << ' ' << pos << '\n';
}
// cerr << "siu " << siu << '\n';
M = m + 1;
seg.update_max(1, M, 0);
for (int i = 1; i <= n; i++) {
auto &cur = node[i];
sort(cur.begin(), cur.end());
cur.emplace_back(m, 0);
vector<pair<int, ll>> tmp;
for (const auto &elem: cur) {
if (tmp.empty() || tmp.back().first != elem.first)
tmp.emplace_back(elem);
else tmp.back().second += elem.second;
}
// for (auto [j, val]: tmp)
// debug[i][j] = val,
// cerr << string(10, ' ') << "[" << i << ", " << j << "] = " << val << '\n';
ll sum = 0;
for (auto &elem: tmp) {
elem.first++;
sum += elem.second;
}
// cerr << "i = " << i << ", sum = " << sum << '\n';
ll pre_max = -INF;
for (int i = 0; i < (int)tmp.size(); i++) {
int L = 1, R = tmp[i].first;
if (i - 1 >= 0) L = tmp[i - 1].first + 1;
// cerr << L << ' ' << R << '\n';
seg.update_add(L, R, sum);
if (L - 1 > 0) pre_max = max(pre_max, seg.get(L - 1));
seg.update_max(L, R, pre_max);
sum -= tmp[i].second;
}
// ll pre_max = LLONG_MIN;
// for (const auto &elem: tmp) {
// int pos = upper_bound(arr.begin(), arr.end(), elem.first) - arr.begin();
//
// dp[pos] = max(dp[pos] + sum, pre_max);
//
// pre_max = max(pre_max, dp[pos]);
// sum -= elem.second;
// }
// cerr << "at i = " << i << '\n';
// for (const auto &elem: tmp)
// cerr << elem.first << ' ' << elem.second << '\n';
//
// for (int j = 1; j <= M; j++)
// fprintf(stderr, "dp[%d][%d] = %lld\n", i, j - 1, seg.get(j));
// cerr << '\n';
}
// cerr << "siu = " << siu << '\n';
cout << seg.get(M) + siu;
// for (int i = m; i >= 0; i--)
// for (int j = 1; j <= n; j++)
// cerr << debug[j][i] << "\t\n"[j == n];
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
566 ms |
156244 KB |
Output is correct |
2 |
Correct |
551 ms |
156500 KB |
Output is correct |
3 |
Correct |
472 ms |
151888 KB |
Output is correct |
4 |
Correct |
498 ms |
154192 KB |
Output is correct |
5 |
Correct |
20 ms |
131672 KB |
Output is correct |
6 |
Correct |
519 ms |
162560 KB |
Output is correct |
7 |
Correct |
204 ms |
139604 KB |
Output is correct |
8 |
Correct |
230 ms |
151636 KB |
Output is correct |
9 |
Correct |
434 ms |
159148 KB |
Output is correct |
10 |
Correct |
437 ms |
161872 KB |
Output is correct |
11 |
Correct |
309 ms |
155820 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
21 ms |
131672 KB |
Output is correct |
2 |
Correct |
20 ms |
131676 KB |
Output is correct |
3 |
Correct |
20 ms |
131668 KB |
Output is correct |
4 |
Correct |
20 ms |
131676 KB |
Output is correct |
5 |
Correct |
19 ms |
131676 KB |
Output is correct |
6 |
Correct |
19 ms |
131676 KB |
Output is correct |
7 |
Correct |
21 ms |
131676 KB |
Output is correct |
8 |
Correct |
20 ms |
131780 KB |
Output is correct |
9 |
Correct |
20 ms |
131640 KB |
Output is correct |
10 |
Correct |
21 ms |
131692 KB |
Output is correct |
11 |
Correct |
22 ms |
131612 KB |
Output is correct |
12 |
Correct |
20 ms |
131748 KB |
Output is correct |
13 |
Correct |
22 ms |
131676 KB |
Output is correct |
14 |
Correct |
21 ms |
131776 KB |
Output is correct |
15 |
Correct |
20 ms |
131676 KB |
Output is correct |
16 |
Correct |
20 ms |
131700 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
21 ms |
131672 KB |
Output is correct |
2 |
Correct |
20 ms |
131676 KB |
Output is correct |
3 |
Correct |
20 ms |
131668 KB |
Output is correct |
4 |
Correct |
20 ms |
131676 KB |
Output is correct |
5 |
Correct |
19 ms |
131676 KB |
Output is correct |
6 |
Correct |
19 ms |
131676 KB |
Output is correct |
7 |
Correct |
21 ms |
131676 KB |
Output is correct |
8 |
Correct |
20 ms |
131780 KB |
Output is correct |
9 |
Correct |
20 ms |
131640 KB |
Output is correct |
10 |
Correct |
21 ms |
131692 KB |
Output is correct |
11 |
Correct |
22 ms |
131612 KB |
Output is correct |
12 |
Correct |
20 ms |
131748 KB |
Output is correct |
13 |
Correct |
22 ms |
131676 KB |
Output is correct |
14 |
Correct |
21 ms |
131776 KB |
Output is correct |
15 |
Correct |
20 ms |
131676 KB |
Output is correct |
16 |
Correct |
20 ms |
131700 KB |
Output is correct |
17 |
Correct |
24 ms |
131932 KB |
Output is correct |
18 |
Correct |
25 ms |
131804 KB |
Output is correct |
19 |
Correct |
26 ms |
131880 KB |
Output is correct |
20 |
Correct |
26 ms |
131752 KB |
Output is correct |
21 |
Correct |
27 ms |
131932 KB |
Output is correct |
22 |
Correct |
24 ms |
131932 KB |
Output is correct |
23 |
Correct |
25 ms |
131932 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
21 ms |
131672 KB |
Output is correct |
2 |
Correct |
20 ms |
131676 KB |
Output is correct |
3 |
Correct |
20 ms |
131668 KB |
Output is correct |
4 |
Correct |
20 ms |
131676 KB |
Output is correct |
5 |
Correct |
19 ms |
131676 KB |
Output is correct |
6 |
Correct |
19 ms |
131676 KB |
Output is correct |
7 |
Correct |
21 ms |
131676 KB |
Output is correct |
8 |
Correct |
20 ms |
131780 KB |
Output is correct |
9 |
Correct |
20 ms |
131640 KB |
Output is correct |
10 |
Correct |
21 ms |
131692 KB |
Output is correct |
11 |
Correct |
22 ms |
131612 KB |
Output is correct |
12 |
Correct |
20 ms |
131748 KB |
Output is correct |
13 |
Correct |
22 ms |
131676 KB |
Output is correct |
14 |
Correct |
21 ms |
131776 KB |
Output is correct |
15 |
Correct |
20 ms |
131676 KB |
Output is correct |
16 |
Correct |
20 ms |
131700 KB |
Output is correct |
17 |
Correct |
24 ms |
131932 KB |
Output is correct |
18 |
Correct |
25 ms |
131804 KB |
Output is correct |
19 |
Correct |
26 ms |
131880 KB |
Output is correct |
20 |
Correct |
26 ms |
131752 KB |
Output is correct |
21 |
Correct |
27 ms |
131932 KB |
Output is correct |
22 |
Correct |
24 ms |
131932 KB |
Output is correct |
23 |
Correct |
25 ms |
131932 KB |
Output is correct |
24 |
Correct |
457 ms |
162832 KB |
Output is correct |
25 |
Correct |
450 ms |
167668 KB |
Output is correct |
26 |
Correct |
491 ms |
162436 KB |
Output is correct |
27 |
Correct |
491 ms |
165528 KB |
Output is correct |
28 |
Correct |
496 ms |
163920 KB |
Output is correct |
29 |
Correct |
382 ms |
163224 KB |
Output is correct |
30 |
Correct |
846 ms |
168340 KB |
Output is correct |
31 |
Correct |
213 ms |
145664 KB |
Output is correct |
32 |
Correct |
205 ms |
152916 KB |
Output is correct |
33 |
Correct |
595 ms |
163104 KB |
Output is correct |
34 |
Correct |
725 ms |
167188 KB |
Output is correct |
35 |
Correct |
737 ms |
161972 KB |
Output is correct |
36 |
Correct |
706 ms |
161872 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
21 ms |
131672 KB |
Output is correct |
2 |
Correct |
20 ms |
131676 KB |
Output is correct |
3 |
Correct |
20 ms |
131668 KB |
Output is correct |
4 |
Correct |
20 ms |
131676 KB |
Output is correct |
5 |
Correct |
19 ms |
131676 KB |
Output is correct |
6 |
Correct |
19 ms |
131676 KB |
Output is correct |
7 |
Correct |
21 ms |
131676 KB |
Output is correct |
8 |
Correct |
20 ms |
131780 KB |
Output is correct |
9 |
Correct |
20 ms |
131640 KB |
Output is correct |
10 |
Correct |
21 ms |
131692 KB |
Output is correct |
11 |
Correct |
22 ms |
131612 KB |
Output is correct |
12 |
Correct |
20 ms |
131748 KB |
Output is correct |
13 |
Correct |
22 ms |
131676 KB |
Output is correct |
14 |
Correct |
21 ms |
131776 KB |
Output is correct |
15 |
Correct |
20 ms |
131676 KB |
Output is correct |
16 |
Correct |
20 ms |
131700 KB |
Output is correct |
17 |
Correct |
24 ms |
131932 KB |
Output is correct |
18 |
Correct |
25 ms |
131804 KB |
Output is correct |
19 |
Correct |
26 ms |
131880 KB |
Output is correct |
20 |
Correct |
26 ms |
131752 KB |
Output is correct |
21 |
Correct |
27 ms |
131932 KB |
Output is correct |
22 |
Correct |
24 ms |
131932 KB |
Output is correct |
23 |
Correct |
25 ms |
131932 KB |
Output is correct |
24 |
Correct |
457 ms |
162832 KB |
Output is correct |
25 |
Correct |
450 ms |
167668 KB |
Output is correct |
26 |
Correct |
491 ms |
162436 KB |
Output is correct |
27 |
Correct |
491 ms |
165528 KB |
Output is correct |
28 |
Correct |
496 ms |
163920 KB |
Output is correct |
29 |
Correct |
382 ms |
163224 KB |
Output is correct |
30 |
Correct |
846 ms |
168340 KB |
Output is correct |
31 |
Correct |
213 ms |
145664 KB |
Output is correct |
32 |
Correct |
205 ms |
152916 KB |
Output is correct |
33 |
Correct |
595 ms |
163104 KB |
Output is correct |
34 |
Correct |
725 ms |
167188 KB |
Output is correct |
35 |
Correct |
737 ms |
161972 KB |
Output is correct |
36 |
Correct |
706 ms |
161872 KB |
Output is correct |
37 |
Correct |
537 ms |
165532 KB |
Output is correct |
38 |
Correct |
549 ms |
168596 KB |
Output is correct |
39 |
Correct |
512 ms |
169124 KB |
Output is correct |
40 |
Correct |
512 ms |
169104 KB |
Output is correct |
41 |
Correct |
20 ms |
131668 KB |
Output is correct |
42 |
Correct |
893 ms |
171348 KB |
Output is correct |
43 |
Correct |
643 ms |
166160 KB |
Output is correct |
44 |
Correct |
768 ms |
170064 KB |
Output is correct |
45 |
Correct |
789 ms |
165008 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
21 ms |
131672 KB |
Output is correct |
2 |
Correct |
20 ms |
131676 KB |
Output is correct |
3 |
Correct |
20 ms |
131668 KB |
Output is correct |
4 |
Correct |
20 ms |
131676 KB |
Output is correct |
5 |
Correct |
19 ms |
131676 KB |
Output is correct |
6 |
Correct |
19 ms |
131676 KB |
Output is correct |
7 |
Correct |
21 ms |
131676 KB |
Output is correct |
8 |
Correct |
20 ms |
131780 KB |
Output is correct |
9 |
Correct |
20 ms |
131640 KB |
Output is correct |
10 |
Correct |
21 ms |
131692 KB |
Output is correct |
11 |
Correct |
22 ms |
131612 KB |
Output is correct |
12 |
Correct |
20 ms |
131748 KB |
Output is correct |
13 |
Correct |
22 ms |
131676 KB |
Output is correct |
14 |
Correct |
21 ms |
131776 KB |
Output is correct |
15 |
Correct |
20 ms |
131676 KB |
Output is correct |
16 |
Correct |
20 ms |
131700 KB |
Output is correct |
17 |
Correct |
24 ms |
131932 KB |
Output is correct |
18 |
Correct |
25 ms |
131804 KB |
Output is correct |
19 |
Correct |
26 ms |
131880 KB |
Output is correct |
20 |
Correct |
26 ms |
131752 KB |
Output is correct |
21 |
Correct |
27 ms |
131932 KB |
Output is correct |
22 |
Correct |
24 ms |
131932 KB |
Output is correct |
23 |
Correct |
25 ms |
131932 KB |
Output is correct |
24 |
Correct |
457 ms |
162832 KB |
Output is correct |
25 |
Correct |
450 ms |
167668 KB |
Output is correct |
26 |
Correct |
491 ms |
162436 KB |
Output is correct |
27 |
Correct |
491 ms |
165528 KB |
Output is correct |
28 |
Correct |
496 ms |
163920 KB |
Output is correct |
29 |
Correct |
382 ms |
163224 KB |
Output is correct |
30 |
Correct |
846 ms |
168340 KB |
Output is correct |
31 |
Correct |
213 ms |
145664 KB |
Output is correct |
32 |
Correct |
205 ms |
152916 KB |
Output is correct |
33 |
Correct |
595 ms |
163104 KB |
Output is correct |
34 |
Correct |
725 ms |
167188 KB |
Output is correct |
35 |
Correct |
737 ms |
161972 KB |
Output is correct |
36 |
Correct |
706 ms |
161872 KB |
Output is correct |
37 |
Correct |
537 ms |
165532 KB |
Output is correct |
38 |
Correct |
549 ms |
168596 KB |
Output is correct |
39 |
Correct |
512 ms |
169124 KB |
Output is correct |
40 |
Correct |
512 ms |
169104 KB |
Output is correct |
41 |
Correct |
20 ms |
131668 KB |
Output is correct |
42 |
Correct |
893 ms |
171348 KB |
Output is correct |
43 |
Correct |
643 ms |
166160 KB |
Output is correct |
44 |
Correct |
768 ms |
170064 KB |
Output is correct |
45 |
Correct |
789 ms |
165008 KB |
Output is correct |
46 |
Correct |
2685 ms |
283108 KB |
Output is correct |
47 |
Correct |
2716 ms |
298940 KB |
Output is correct |
48 |
Correct |
2540 ms |
300776 KB |
Output is correct |
49 |
Correct |
2549 ms |
301476 KB |
Output is correct |
50 |
Correct |
5435 ms |
312144 KB |
Output is correct |
51 |
Correct |
3450 ms |
282364 KB |
Output is correct |
52 |
Correct |
4191 ms |
300028 KB |
Output is correct |
53 |
Correct |
4843 ms |
279764 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
566 ms |
156244 KB |
Output is correct |
2 |
Correct |
551 ms |
156500 KB |
Output is correct |
3 |
Correct |
472 ms |
151888 KB |
Output is correct |
4 |
Correct |
498 ms |
154192 KB |
Output is correct |
5 |
Correct |
20 ms |
131672 KB |
Output is correct |
6 |
Correct |
519 ms |
162560 KB |
Output is correct |
7 |
Correct |
204 ms |
139604 KB |
Output is correct |
8 |
Correct |
230 ms |
151636 KB |
Output is correct |
9 |
Correct |
434 ms |
159148 KB |
Output is correct |
10 |
Correct |
437 ms |
161872 KB |
Output is correct |
11 |
Correct |
309 ms |
155820 KB |
Output is correct |
12 |
Correct |
21 ms |
131672 KB |
Output is correct |
13 |
Correct |
20 ms |
131676 KB |
Output is correct |
14 |
Correct |
20 ms |
131668 KB |
Output is correct |
15 |
Correct |
20 ms |
131676 KB |
Output is correct |
16 |
Correct |
19 ms |
131676 KB |
Output is correct |
17 |
Correct |
19 ms |
131676 KB |
Output is correct |
18 |
Correct |
21 ms |
131676 KB |
Output is correct |
19 |
Correct |
20 ms |
131780 KB |
Output is correct |
20 |
Correct |
20 ms |
131640 KB |
Output is correct |
21 |
Correct |
21 ms |
131692 KB |
Output is correct |
22 |
Correct |
22 ms |
131612 KB |
Output is correct |
23 |
Correct |
20 ms |
131748 KB |
Output is correct |
24 |
Correct |
22 ms |
131676 KB |
Output is correct |
25 |
Correct |
21 ms |
131776 KB |
Output is correct |
26 |
Correct |
20 ms |
131676 KB |
Output is correct |
27 |
Correct |
20 ms |
131700 KB |
Output is correct |
28 |
Correct |
24 ms |
131932 KB |
Output is correct |
29 |
Correct |
25 ms |
131804 KB |
Output is correct |
30 |
Correct |
26 ms |
131880 KB |
Output is correct |
31 |
Correct |
26 ms |
131752 KB |
Output is correct |
32 |
Correct |
27 ms |
131932 KB |
Output is correct |
33 |
Correct |
24 ms |
131932 KB |
Output is correct |
34 |
Correct |
25 ms |
131932 KB |
Output is correct |
35 |
Correct |
457 ms |
162832 KB |
Output is correct |
36 |
Correct |
450 ms |
167668 KB |
Output is correct |
37 |
Correct |
491 ms |
162436 KB |
Output is correct |
38 |
Correct |
491 ms |
165528 KB |
Output is correct |
39 |
Correct |
496 ms |
163920 KB |
Output is correct |
40 |
Correct |
382 ms |
163224 KB |
Output is correct |
41 |
Correct |
846 ms |
168340 KB |
Output is correct |
42 |
Correct |
213 ms |
145664 KB |
Output is correct |
43 |
Correct |
205 ms |
152916 KB |
Output is correct |
44 |
Correct |
595 ms |
163104 KB |
Output is correct |
45 |
Correct |
725 ms |
167188 KB |
Output is correct |
46 |
Correct |
737 ms |
161972 KB |
Output is correct |
47 |
Correct |
706 ms |
161872 KB |
Output is correct |
48 |
Correct |
537 ms |
165532 KB |
Output is correct |
49 |
Correct |
549 ms |
168596 KB |
Output is correct |
50 |
Correct |
512 ms |
169124 KB |
Output is correct |
51 |
Correct |
512 ms |
169104 KB |
Output is correct |
52 |
Correct |
20 ms |
131668 KB |
Output is correct |
53 |
Correct |
893 ms |
171348 KB |
Output is correct |
54 |
Correct |
643 ms |
166160 KB |
Output is correct |
55 |
Correct |
768 ms |
170064 KB |
Output is correct |
56 |
Correct |
789 ms |
165008 KB |
Output is correct |
57 |
Correct |
556 ms |
165972 KB |
Output is correct |
58 |
Correct |
579 ms |
169244 KB |
Output is correct |
59 |
Correct |
533 ms |
170140 KB |
Output is correct |
60 |
Correct |
528 ms |
170144 KB |
Output is correct |
61 |
Correct |
843 ms |
168580 KB |
Output is correct |
62 |
Correct |
20 ms |
131740 KB |
Output is correct |
63 |
Correct |
916 ms |
171604 KB |
Output is correct |
64 |
Correct |
642 ms |
166460 KB |
Output is correct |
65 |
Correct |
770 ms |
169344 KB |
Output is correct |
66 |
Correct |
769 ms |
165004 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
566 ms |
156244 KB |
Output is correct |
2 |
Correct |
551 ms |
156500 KB |
Output is correct |
3 |
Correct |
472 ms |
151888 KB |
Output is correct |
4 |
Correct |
498 ms |
154192 KB |
Output is correct |
5 |
Correct |
20 ms |
131672 KB |
Output is correct |
6 |
Correct |
519 ms |
162560 KB |
Output is correct |
7 |
Correct |
204 ms |
139604 KB |
Output is correct |
8 |
Correct |
230 ms |
151636 KB |
Output is correct |
9 |
Correct |
434 ms |
159148 KB |
Output is correct |
10 |
Correct |
437 ms |
161872 KB |
Output is correct |
11 |
Correct |
309 ms |
155820 KB |
Output is correct |
12 |
Correct |
21 ms |
131672 KB |
Output is correct |
13 |
Correct |
20 ms |
131676 KB |
Output is correct |
14 |
Correct |
20 ms |
131668 KB |
Output is correct |
15 |
Correct |
20 ms |
131676 KB |
Output is correct |
16 |
Correct |
19 ms |
131676 KB |
Output is correct |
17 |
Correct |
19 ms |
131676 KB |
Output is correct |
18 |
Correct |
21 ms |
131676 KB |
Output is correct |
19 |
Correct |
20 ms |
131780 KB |
Output is correct |
20 |
Correct |
20 ms |
131640 KB |
Output is correct |
21 |
Correct |
21 ms |
131692 KB |
Output is correct |
22 |
Correct |
22 ms |
131612 KB |
Output is correct |
23 |
Correct |
20 ms |
131748 KB |
Output is correct |
24 |
Correct |
22 ms |
131676 KB |
Output is correct |
25 |
Correct |
21 ms |
131776 KB |
Output is correct |
26 |
Correct |
20 ms |
131676 KB |
Output is correct |
27 |
Correct |
20 ms |
131700 KB |
Output is correct |
28 |
Correct |
24 ms |
131932 KB |
Output is correct |
29 |
Correct |
25 ms |
131804 KB |
Output is correct |
30 |
Correct |
26 ms |
131880 KB |
Output is correct |
31 |
Correct |
26 ms |
131752 KB |
Output is correct |
32 |
Correct |
27 ms |
131932 KB |
Output is correct |
33 |
Correct |
24 ms |
131932 KB |
Output is correct |
34 |
Correct |
25 ms |
131932 KB |
Output is correct |
35 |
Correct |
457 ms |
162832 KB |
Output is correct |
36 |
Correct |
450 ms |
167668 KB |
Output is correct |
37 |
Correct |
491 ms |
162436 KB |
Output is correct |
38 |
Correct |
491 ms |
165528 KB |
Output is correct |
39 |
Correct |
496 ms |
163920 KB |
Output is correct |
40 |
Correct |
382 ms |
163224 KB |
Output is correct |
41 |
Correct |
846 ms |
168340 KB |
Output is correct |
42 |
Correct |
213 ms |
145664 KB |
Output is correct |
43 |
Correct |
205 ms |
152916 KB |
Output is correct |
44 |
Correct |
595 ms |
163104 KB |
Output is correct |
45 |
Correct |
725 ms |
167188 KB |
Output is correct |
46 |
Correct |
737 ms |
161972 KB |
Output is correct |
47 |
Correct |
706 ms |
161872 KB |
Output is correct |
48 |
Correct |
537 ms |
165532 KB |
Output is correct |
49 |
Correct |
549 ms |
168596 KB |
Output is correct |
50 |
Correct |
512 ms |
169124 KB |
Output is correct |
51 |
Correct |
512 ms |
169104 KB |
Output is correct |
52 |
Correct |
20 ms |
131668 KB |
Output is correct |
53 |
Correct |
893 ms |
171348 KB |
Output is correct |
54 |
Correct |
643 ms |
166160 KB |
Output is correct |
55 |
Correct |
768 ms |
170064 KB |
Output is correct |
56 |
Correct |
789 ms |
165008 KB |
Output is correct |
57 |
Correct |
2685 ms |
283108 KB |
Output is correct |
58 |
Correct |
2716 ms |
298940 KB |
Output is correct |
59 |
Correct |
2540 ms |
300776 KB |
Output is correct |
60 |
Correct |
2549 ms |
301476 KB |
Output is correct |
61 |
Correct |
5435 ms |
312144 KB |
Output is correct |
62 |
Correct |
3450 ms |
282364 KB |
Output is correct |
63 |
Correct |
4191 ms |
300028 KB |
Output is correct |
64 |
Correct |
4843 ms |
279764 KB |
Output is correct |
65 |
Correct |
556 ms |
165972 KB |
Output is correct |
66 |
Correct |
579 ms |
169244 KB |
Output is correct |
67 |
Correct |
533 ms |
170140 KB |
Output is correct |
68 |
Correct |
528 ms |
170144 KB |
Output is correct |
69 |
Correct |
843 ms |
168580 KB |
Output is correct |
70 |
Correct |
20 ms |
131740 KB |
Output is correct |
71 |
Correct |
916 ms |
171604 KB |
Output is correct |
72 |
Correct |
642 ms |
166460 KB |
Output is correct |
73 |
Correct |
770 ms |
169344 KB |
Output is correct |
74 |
Correct |
769 ms |
165004 KB |
Output is correct |
75 |
Correct |
2784 ms |
284992 KB |
Output is correct |
76 |
Correct |
2839 ms |
300752 KB |
Output is correct |
77 |
Correct |
2600 ms |
303584 KB |
Output is correct |
78 |
Correct |
2617 ms |
303784 KB |
Output is correct |
79 |
Correct |
5463 ms |
312736 KB |
Output is correct |
80 |
Correct |
3504 ms |
285468 KB |
Output is correct |
81 |
Correct |
4091 ms |
293888 KB |
Output is correct |
82 |
Correct |
4791 ms |
280572 KB |
Output is correct |
83 |
Correct |
4936 ms |
298420 KB |
Output is correct |