Submission #767906

# Submission time Handle Problem Language Result Execution time Memory
767906 2023-06-27T09:20:43 Z 79brue Two Dishes (JOI19_dishes) C++17
100 / 100
3080 ms 173752 KB
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
const ll INF = 1e18;

void input();
void solve();

int main(){
    input();
    solve();
}

struct Point{
    int x; ll v;
    Point(){}
    Point(int x, ll v): x(x), v(v){}
};

int n, m;
Point a[1000002], b[1000002];

void input(){
    scanf("%d %d", &n, &m);
    vector<ll> A (n+1), S (n+1), P(n+1);
    vector<ll> B (m+1), T (m+1), Q(m+1);
    vector<ll> Asum(n+1), Bsum(m+1);
    for(int i=1; i<=n; i++) scanf("%lld %lld %lld", &A[i], &S[i], &P[i]);
    for(int i=1; i<=m; i++) scanf("%lld %lld %lld", &B[i], &T[i], &Q[i]);
    for(int i=1; i<=n; i++) Asum[i] = Asum[i-1] + A[i];
    for(int i=1; i<=m; i++) Bsum[i] = Bsum[i-1] + B[i];

    for(int i=1; i<=n; i++) a[i] = Point(upper_bound(Bsum.begin(), Bsum.end(), S[i] - Asum[i]) - Bsum.begin() - 1, P[i]);
    for(int i=1; i<=m; i++) b[i] = Point(upper_bound(Asum.begin(), Asum.end(), T[i] - Bsum[i]) - Asum.begin() - 1, Q[i]);
}

struct segTree{
    struct Node{
        ll val, lazy; /// 구간 최대 val, 거기에 lazy
        ll extra, ans; /// extra: 구간 extra의 합, ans: 구간 적당한 점 val + 그 오른쪽 extra 합의 최댓값

        Node(){}
        Node(ll val, ll extra, ll ans): val(val), extra(extra), ans(ans){lazy = 0;}
        Node operator+(const Node &r)const{
            return Node(max(val, r.val), extra + r.extra, max(ans + r.extra, r.ans));
        }
    } tree[1<<21];

    void init(int i, int l, int r){
        tree[i].val = tree[i].lazy = tree[i].extra = tree[i].ans = 0;
        if(l==r) return;
        int m = (l+r)>>1;
        init(i*2, l, m);
        init(i*2+1, m+1, r);
    }

    void propagate(int i, int l, int r){
        tree[i].val += tree[i].lazy;
        tree[i].ans += tree[i].lazy;
        if(l!=r){
            tree[i*2].lazy += tree[i].lazy;
            tree[i*2+1].lazy += tree[i].lazy;
        }
        tree[i].lazy = 0;
    }

    Node query(int i, int l, int r, int s, int e){ /// 구간의 ans를 확인
        propagate(i, l, r);
        if(r<s || e<l) return Node(-INF, 0, -INF);
        if(s<=l && r<=e) return tree[i];
        int m = (l+r)>>1;
        return query(i*2, l, m, s, e) + query(i*2+1, m+1, r, s, e);
    }

    void updateVal(int i, int l, int r, int x, ll v){ /// 한 위치의 val을 수정
        propagate(i, l, r);
        if(x<l || r<x) return;
        if(l==r){
            tree[i].val = tree[i].ans = v;
            return;
        }
        int m = (l+r)>>1;
        updateVal(i*2, l, m, x, v);
        updateVal(i*2+1, m+1, r, x, v);
        tree[i] = tree[i*2] + tree[i*2+1];
    }

    void updateExtra(int i, int l, int r, int x, ll v){ /// 한 위치의 extra를 수정
        propagate(i, l, r);
        if(x<l || r<x) return;
        if(l==r){
            tree[i].extra += v;
            return;
        }
        int m = (l+r)>>1;
        updateExtra(i*2, l, m, x, v);
        updateExtra(i*2+1, m+1, r, x, v);
        tree[i] = tree[i*2] + tree[i*2+1];
    }

    void add(int i, int l, int r, int s, int e, ll v){ /// 구간의 val을 수정
        propagate(i, l, r);
        if(r<s || e<l) return;
        if(s<=l && r<=e){
            tree[i].lazy = v;
            propagate(i, l, r);
            return;
        }
        int m = (l+r)>>1;
        add(i*2, l, m, s, e, v);
        add(i*2+1, m+1, r, s, e, v);
        tree[i] = tree[i*2] + tree[i*2+1];
    }
} tree;

struct Event{
    int type; /// 0: 가로, 1: 세로
    int time; /// 시간
    int x; /// 추가 인자
    ll v; /// 막대 길이

    Event(int type, int time, int x, ll v): type(type), time(time), x(x), v(v){}
    bool operator<(const Event &r)const{
        if(time != r.time) return time < r.time;
        if(type != r.type) return type < r.type;
        return x < r.x;
    }
};

ll added = 0;

void solve(){
    vector<Event> vec;
    tree.init(1, 0, n);
    for(int i=1; i<=n; i++){
        if(a[i].x < 0) continue;
        if(a[i].x >= m){
            added += a[i].v;
            continue;
        }
        if(a[i].v > 0){
            vec.push_back(Event(1, a[i].x, i, a[i].v)); /// 세로 막대
            tree.updateExtra(1, 0, n, i, a[i].v);
        }
        if(a[i].v < 0){
            added += a[i].v;
            vec.push_back(Event(0, a[i].x+1, i-1, -a[i].v));
        }
    }
    for(int i=1; i<=m; i++){
        if(b[i].x < 0) continue;
        if(b[i].x >= n){
            added += b[i].v;
            continue;
        }
        if(b[i].v > 0) vec.push_back(Event(0, i, b[i].x, b[i].v));
        if(b[i].v < 0){
            added += b[i].v;
            vec.push_back(Event(1, i-1, b[i].x+1, -b[i].v));
            tree.updateExtra(1, 0, n, b[i].x+1, -b[i].v);
        }
    }
    sort(vec.begin(), vec.end());

    for(int i=1; i<=n; i++){
        if(a[i].x < 0) continue;
    }
    for(Event &p: vec){
//        printf("Event %d %d %d %lld\n", p.type, p.time, p.x, p.v);
        if(p.type == 0){ /// 가로 막대
            tree.add(1, 0, n, 0, p.x, p.v);
        }
        else{ /// 세로 막대
            ll v = tree.query(1, 0, n, 0, p.x).ans;
//            printf("Query %d %lld: value %lld\n", p.x, p.v, v);
            tree.updateExtra(1, 0, n, p.x, -p.v);
            tree.updateVal(1, 0, n, p.x, v);
        }
//        for(int j=0; j<=n; j++) printf("%2lld ", tree.query(1, 0, j, 0, j).ans);
//        puts("");
    }

    printf("%lld", tree.query(1, 0, n, 0, n).ans + added);
}

Compilation message

dishes.cpp: In function 'void input()':
dishes.cpp:26:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   26 |     scanf("%d %d", &n, &m);
      |     ~~~~~^~~~~~~~~~~~~~~~~
dishes.cpp:30:34: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   30 |     for(int i=1; i<=n; i++) scanf("%lld %lld %lld", &A[i], &S[i], &P[i]);
      |                             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dishes.cpp:31:34: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   31 |     for(int i=1; i<=m; i++) scanf("%lld %lld %lld", &B[i], &T[i], &Q[i]);
      |                             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 370 ms 38428 KB Output is correct
2 Correct 346 ms 40660 KB Output is correct
3 Correct 131 ms 28396 KB Output is correct
4 Correct 278 ms 34688 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 305 ms 41932 KB Output is correct
7 Correct 59 ms 13376 KB Output is correct
8 Correct 67 ms 23652 KB Output is correct
9 Correct 135 ms 28248 KB Output is correct
10 Correct 355 ms 39268 KB Output is correct
11 Correct 106 ms 26576 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 316 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 316 KB Output is correct
10 Correct 1 ms 312 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 304 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 316 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 316 KB Output is correct
10 Correct 1 ms 312 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 304 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 3 ms 724 KB Output is correct
18 Correct 2 ms 724 KB Output is correct
19 Correct 4 ms 784 KB Output is correct
20 Correct 4 ms 708 KB Output is correct
21 Correct 4 ms 756 KB Output is correct
22 Correct 3 ms 732 KB Output is correct
23 Correct 3 ms 724 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 316 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 316 KB Output is correct
10 Correct 1 ms 312 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 304 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 3 ms 724 KB Output is correct
18 Correct 2 ms 724 KB Output is correct
19 Correct 4 ms 784 KB Output is correct
20 Correct 4 ms 708 KB Output is correct
21 Correct 4 ms 756 KB Output is correct
22 Correct 3 ms 732 KB Output is correct
23 Correct 3 ms 724 KB Output is correct
24 Correct 265 ms 33060 KB Output is correct
25 Correct 182 ms 33056 KB Output is correct
26 Correct 282 ms 32996 KB Output is correct
27 Correct 208 ms 33012 KB Output is correct
28 Correct 228 ms 31324 KB Output is correct
29 Correct 129 ms 26772 KB Output is correct
30 Correct 483 ms 39036 KB Output is correct
31 Correct 60 ms 13372 KB Output is correct
32 Correct 137 ms 28120 KB Output is correct
33 Correct 294 ms 32996 KB Output is correct
34 Correct 386 ms 39076 KB Output is correct
35 Correct 440 ms 39148 KB Output is correct
36 Correct 472 ms 39100 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 316 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 316 KB Output is correct
10 Correct 1 ms 312 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 304 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 3 ms 724 KB Output is correct
18 Correct 2 ms 724 KB Output is correct
19 Correct 4 ms 784 KB Output is correct
20 Correct 4 ms 708 KB Output is correct
21 Correct 4 ms 756 KB Output is correct
22 Correct 3 ms 732 KB Output is correct
23 Correct 3 ms 724 KB Output is correct
24 Correct 265 ms 33060 KB Output is correct
25 Correct 182 ms 33056 KB Output is correct
26 Correct 282 ms 32996 KB Output is correct
27 Correct 208 ms 33012 KB Output is correct
28 Correct 228 ms 31324 KB Output is correct
29 Correct 129 ms 26772 KB Output is correct
30 Correct 483 ms 39036 KB Output is correct
31 Correct 60 ms 13372 KB Output is correct
32 Correct 137 ms 28120 KB Output is correct
33 Correct 294 ms 32996 KB Output is correct
34 Correct 386 ms 39076 KB Output is correct
35 Correct 440 ms 39148 KB Output is correct
36 Correct 472 ms 39100 KB Output is correct
37 Correct 282 ms 34772 KB Output is correct
38 Correct 191 ms 34596 KB Output is correct
39 Correct 365 ms 39208 KB Output is correct
40 Correct 361 ms 39056 KB Output is correct
41 Correct 1 ms 312 KB Output is correct
42 Correct 520 ms 40784 KB Output is correct
43 Correct 310 ms 34460 KB Output is correct
44 Correct 384 ms 40852 KB Output is correct
45 Correct 453 ms 39116 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 316 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 316 KB Output is correct
10 Correct 1 ms 312 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 304 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 3 ms 724 KB Output is correct
18 Correct 2 ms 724 KB Output is correct
19 Correct 4 ms 784 KB Output is correct
20 Correct 4 ms 708 KB Output is correct
21 Correct 4 ms 756 KB Output is correct
22 Correct 3 ms 732 KB Output is correct
23 Correct 3 ms 724 KB Output is correct
24 Correct 265 ms 33060 KB Output is correct
25 Correct 182 ms 33056 KB Output is correct
26 Correct 282 ms 32996 KB Output is correct
27 Correct 208 ms 33012 KB Output is correct
28 Correct 228 ms 31324 KB Output is correct
29 Correct 129 ms 26772 KB Output is correct
30 Correct 483 ms 39036 KB Output is correct
31 Correct 60 ms 13372 KB Output is correct
32 Correct 137 ms 28120 KB Output is correct
33 Correct 294 ms 32996 KB Output is correct
34 Correct 386 ms 39076 KB Output is correct
35 Correct 440 ms 39148 KB Output is correct
36 Correct 472 ms 39100 KB Output is correct
37 Correct 282 ms 34772 KB Output is correct
38 Correct 191 ms 34596 KB Output is correct
39 Correct 365 ms 39208 KB Output is correct
40 Correct 361 ms 39056 KB Output is correct
41 Correct 1 ms 312 KB Output is correct
42 Correct 520 ms 40784 KB Output is correct
43 Correct 310 ms 34460 KB Output is correct
44 Correct 384 ms 40852 KB Output is correct
45 Correct 453 ms 39116 KB Output is correct
46 Correct 1483 ms 136584 KB Output is correct
47 Correct 954 ms 136536 KB Output is correct
48 Correct 1971 ms 160680 KB Output is correct
49 Correct 1999 ms 160680 KB Output is correct
50 Correct 3080 ms 160852 KB Output is correct
51 Correct 1863 ms 135016 KB Output is correct
52 Correct 2183 ms 158728 KB Output is correct
53 Correct 2961 ms 159604 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 370 ms 38428 KB Output is correct
2 Correct 346 ms 40660 KB Output is correct
3 Correct 131 ms 28396 KB Output is correct
4 Correct 278 ms 34688 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 305 ms 41932 KB Output is correct
7 Correct 59 ms 13376 KB Output is correct
8 Correct 67 ms 23652 KB Output is correct
9 Correct 135 ms 28248 KB Output is correct
10 Correct 355 ms 39268 KB Output is correct
11 Correct 106 ms 26576 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 316 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Correct 1 ms 316 KB Output is correct
21 Correct 1 ms 312 KB Output is correct
22 Correct 1 ms 340 KB Output is correct
23 Correct 0 ms 212 KB Output is correct
24 Correct 1 ms 212 KB Output is correct
25 Correct 1 ms 304 KB Output is correct
26 Correct 1 ms 212 KB Output is correct
27 Correct 1 ms 212 KB Output is correct
28 Correct 3 ms 724 KB Output is correct
29 Correct 2 ms 724 KB Output is correct
30 Correct 4 ms 784 KB Output is correct
31 Correct 4 ms 708 KB Output is correct
32 Correct 4 ms 756 KB Output is correct
33 Correct 3 ms 732 KB Output is correct
34 Correct 3 ms 724 KB Output is correct
35 Correct 265 ms 33060 KB Output is correct
36 Correct 182 ms 33056 KB Output is correct
37 Correct 282 ms 32996 KB Output is correct
38 Correct 208 ms 33012 KB Output is correct
39 Correct 228 ms 31324 KB Output is correct
40 Correct 129 ms 26772 KB Output is correct
41 Correct 483 ms 39036 KB Output is correct
42 Correct 60 ms 13372 KB Output is correct
43 Correct 137 ms 28120 KB Output is correct
44 Correct 294 ms 32996 KB Output is correct
45 Correct 386 ms 39076 KB Output is correct
46 Correct 440 ms 39148 KB Output is correct
47 Correct 472 ms 39100 KB Output is correct
48 Correct 282 ms 34772 KB Output is correct
49 Correct 191 ms 34596 KB Output is correct
50 Correct 365 ms 39208 KB Output is correct
51 Correct 361 ms 39056 KB Output is correct
52 Correct 1 ms 312 KB Output is correct
53 Correct 520 ms 40784 KB Output is correct
54 Correct 310 ms 34460 KB Output is correct
55 Correct 384 ms 40852 KB Output is correct
56 Correct 453 ms 39116 KB Output is correct
57 Correct 201 ms 32304 KB Output is correct
58 Correct 300 ms 31112 KB Output is correct
59 Correct 466 ms 37308 KB Output is correct
60 Correct 285 ms 37388 KB Output is correct
61 Correct 190 ms 24940 KB Output is correct
62 Correct 1 ms 212 KB Output is correct
63 Correct 502 ms 37464 KB Output is correct
64 Correct 306 ms 42556 KB Output is correct
65 Correct 400 ms 48904 KB Output is correct
66 Correct 460 ms 42888 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 370 ms 38428 KB Output is correct
2 Correct 346 ms 40660 KB Output is correct
3 Correct 131 ms 28396 KB Output is correct
4 Correct 278 ms 34688 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 305 ms 41932 KB Output is correct
7 Correct 59 ms 13376 KB Output is correct
8 Correct 67 ms 23652 KB Output is correct
9 Correct 135 ms 28248 KB Output is correct
10 Correct 355 ms 39268 KB Output is correct
11 Correct 106 ms 26576 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 316 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Correct 1 ms 316 KB Output is correct
21 Correct 1 ms 312 KB Output is correct
22 Correct 1 ms 340 KB Output is correct
23 Correct 0 ms 212 KB Output is correct
24 Correct 1 ms 212 KB Output is correct
25 Correct 1 ms 304 KB Output is correct
26 Correct 1 ms 212 KB Output is correct
27 Correct 1 ms 212 KB Output is correct
28 Correct 3 ms 724 KB Output is correct
29 Correct 2 ms 724 KB Output is correct
30 Correct 4 ms 784 KB Output is correct
31 Correct 4 ms 708 KB Output is correct
32 Correct 4 ms 756 KB Output is correct
33 Correct 3 ms 732 KB Output is correct
34 Correct 3 ms 724 KB Output is correct
35 Correct 265 ms 33060 KB Output is correct
36 Correct 182 ms 33056 KB Output is correct
37 Correct 282 ms 32996 KB Output is correct
38 Correct 208 ms 33012 KB Output is correct
39 Correct 228 ms 31324 KB Output is correct
40 Correct 129 ms 26772 KB Output is correct
41 Correct 483 ms 39036 KB Output is correct
42 Correct 60 ms 13372 KB Output is correct
43 Correct 137 ms 28120 KB Output is correct
44 Correct 294 ms 32996 KB Output is correct
45 Correct 386 ms 39076 KB Output is correct
46 Correct 440 ms 39148 KB Output is correct
47 Correct 472 ms 39100 KB Output is correct
48 Correct 282 ms 34772 KB Output is correct
49 Correct 191 ms 34596 KB Output is correct
50 Correct 365 ms 39208 KB Output is correct
51 Correct 361 ms 39056 KB Output is correct
52 Correct 1 ms 312 KB Output is correct
53 Correct 520 ms 40784 KB Output is correct
54 Correct 310 ms 34460 KB Output is correct
55 Correct 384 ms 40852 KB Output is correct
56 Correct 453 ms 39116 KB Output is correct
57 Correct 1483 ms 136584 KB Output is correct
58 Correct 954 ms 136536 KB Output is correct
59 Correct 1971 ms 160680 KB Output is correct
60 Correct 1999 ms 160680 KB Output is correct
61 Correct 3080 ms 160852 KB Output is correct
62 Correct 1863 ms 135016 KB Output is correct
63 Correct 2183 ms 158728 KB Output is correct
64 Correct 2961 ms 159604 KB Output is correct
65 Correct 201 ms 32304 KB Output is correct
66 Correct 300 ms 31112 KB Output is correct
67 Correct 466 ms 37308 KB Output is correct
68 Correct 285 ms 37388 KB Output is correct
69 Correct 190 ms 24940 KB Output is correct
70 Correct 1 ms 212 KB Output is correct
71 Correct 502 ms 37464 KB Output is correct
72 Correct 306 ms 42556 KB Output is correct
73 Correct 400 ms 48904 KB Output is correct
74 Correct 460 ms 42888 KB Output is correct
75 Correct 1045 ms 149804 KB Output is correct
76 Correct 1557 ms 149804 KB Output is correct
77 Correct 2495 ms 171468 KB Output is correct
78 Correct 1447 ms 171460 KB Output is correct
79 Correct 3071 ms 173752 KB Output is correct
80 Correct 1854 ms 144744 KB Output is correct
81 Correct 2281 ms 168124 KB Output is correct
82 Correct 2889 ms 164704 KB Output is correct
83 Correct 2891 ms 167500 KB Output is correct