Submission #165830

# Submission time Handle Problem Language Result Execution time Memory
165830 2019-11-29T09:28:54 Z choikiwon Two Dishes (JOI19_dishes) C++17
100 / 100
8355 ms 569776 KB
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int, int> pii;

const int maxn = 2000010;

int N, M;
ll A[maxn], B[maxn], S[maxn], T[maxn], P[maxn], Q[maxn];
int X[maxn], Y[maxn], inv[maxn], pnt[maxn];

vector<int> adj1[maxn], adj2[maxn];
ll dp[maxn];
ll offset;

struct BIT {
    vector<ll> tree, lazy;
    void init() {
        tree = vector<ll>(4 * N, -1e17);
        lazy = vector<ll>(4 * N, 0);
    }
    void prop(int l, int r, int n) {
        if(l != r) {
            tree[2*n] += lazy[n];
            lazy[2*n] += lazy[n];
            tree[2*n + 1] += lazy[n];
            lazy[2*n + 1] += lazy[n];
            lazy[n] = 0;
        }
    }
    void upd(int a, int b, ll d, int l, int r, int n) {
        if(b < l || r < a) return;
        if(a <= l && r <= b) {
            tree[n] += d;
            lazy[n] += d;
            return;
        }
        prop(l, r, n);
        int m = (l + r)>>1;
        upd(a, b, d, l, m, 2*n);
        upd(a, b, d, m + 1, r, 2*n + 1);
        tree[n] = max(tree[2*n], tree[2*n + 1]);
    }
    void upd2(int x, ll v, int l, int r, int n) {
        if(x < l || r < x) return;
        if(l == r) {
            tree[n] = v;
            return;
        }
        prop(l, r, n);
        int m = (l + r)>>1;
        upd2(x, v, l, m, 2*n);
        upd2(x, v, m + 1, r, 2*n + 1);
        tree[n] = max(tree[2*n], tree[2*n + 1]);
    }
    ll quer(int a, int b, int l, int r, int n) {
        if(b < l || r < a) return -1e18;
        if(a <= l && r <= b) return tree[n];
        prop(l, r, n);
        int m = (l + r)>>1;
        ll L = quer(a, b, l, m, 2*n);
        ll R = quer(a, b, m + 1, r, 2*n + 1);
        return max(L, R);
    }
} bit;

void proc() {
    for(int i = 0; i < N; i++) {
        if(A[i] > S[i]) P[i] = 0;

        int s = 0, e = M - 1, p = M;
        while(s <= e) {
            int m = (s + e)>>1;

            if(A[i] + B[m] > S[i]) {
                p = m;
                e = m - 1;
            }
            else s = m + 1;
        }
        X[i] = p;
    }
    for(int i = 0; i < M; i++) {
        if(B[i] > T[i]) Q[i] = 0;

        int s = 0, e = N - 1, p = N;
        while(s <= e) {
            int m = (s + e)>>1;

            if(B[i] + A[m] > T[i]) {
                p = m;
                e = m - 1;
            }
            else s = m + 1;
        }
        Y[i] = p;
    }

    for(int i = 0; i < M; i++) adj1[i].clear();
    for(int i = 0; i < N; i++) adj2[i].clear();
    for(int i = 0; i < N; i++) adj1[ X[i] ].push_back(i);
    for(int i = 0; i < M; i++) adj2[ Y[i] ].push_back(i);
}

int main() {
    //freopen("in.txt", "r", stdin);

    scanf("%d %d", &N, &M);

    for(int i = 0; i < N; i++) {
        scanf("%lld %lld %lld", &A[i], &S[i], &P[i]);
    }
    for(int i = 0; i < M; i++) {
        scanf("%lld %lld %lld", &B[i], &T[i], &Q[i]);
    }

    for(int i = 1; i < N; i++) A[i] += A[i - 1];
    for(int i = 1; i < M; i++) B[i] += B[i - 1];

    proc();

    for(int i = 0; i < N; i++) if(P[i] < 0) offset += P[i];
    for(int i = 0; i < M; i++) if(Q[i] < 0) offset += Q[i];

    //*
    vector<ll> nA, nB, nS, nT, nP, nQ;
    for(int i = 0; i < N; i++) {
        if(P[i] >= 0) {
            nA.push_back(A[i]);
            nS.push_back(S[i]);
            nP.push_back(P[i]);
        }
        else {
            nA.push_back(A[i]);
            nS.push_back(S[i]);
            nP.push_back(0);
        }

        for(int j = 0; j < adj2[i].size(); j++) {
            int k = adj2[i][j];

            if(Q[k] < 0) {
                nA.push_back(A[i]);
                nS.push_back(A[i] + B[k] - 1);
                nP.push_back(-Q[k]);
            }
        }
    }
    for(int i = 0; i < M; i++) {
        if(Q[i] >= 0) {
            nB.push_back(B[i]);
            nT.push_back(T[i]);
            nQ.push_back(Q[i]);
        }
        else {
            nB.push_back(B[i]);
            nT.push_back(T[i]);
            nQ.push_back(0);
        }

        for(int j = 0; j < adj1[i].size(); j++) {
            int k = adj1[i][j];

            if(P[k] < 0) {
                nB.push_back(B[i]);
                nT.push_back(B[i] + A[k] - 1);
                nQ.push_back(-P[k]);
            }
        }
    }

    N = nA.size();
    M = nB.size();
    for(int i = 0; i < N; i++) {
        A[i] = nA[i];
        S[i] = nS[i];
        P[i] = nP[i];
    }
    for(int i = 0; i < M; i++) {
        B[i] = nB[i];
        T[i] = nT[i];
        Q[i] = nQ[i];
    }

    proc();

    //*/

    vector<pii> ord;
    for(int i = 0; i < N; i++) ord.push_back(pii(X[i], -i));
    sort(ord.begin(), ord.end());
    for(int i = 0; i < N; i++) inv[ -ord[i].second ] = i;
    int pos = 0;
    for(int i = 0; i < M; i++) {
        while(pos < N && ord[pos].first <= i) pos++;
        pnt[i] = pos - 1;
    }

    for(int i = 0; i < M; i++) offset += Q[i];

    bit.init();
    for(int i = N - 1; i >= 0; i--) {

        dp[i] = bit.quer(inv[i] + 1, N - 1, 0, N - 1, 1);
        dp[i] = max(0LL, dp[i]);

        //cout << dp[i] << endl;

        bit.upd2(inv[i], dp[i], 0, N - 1, 1);
        bit.upd(0, inv[i], P[i], 0, N - 1, 1);

        for(int j = 0; j < adj2[i].size(); j++) {
            int k = adj2[i][j];

            bit.upd(0, pnt[k], -Q[k], 0, N - 1, 1);
        }
    }

    ll ans = bit.quer(0, N - 1, 0, N - 1, 1);
    ans = max(0LL, ans);

    cout << ans + offset;
}

Compilation message

dishes.cpp:1:0: warning: ignoring #pragma comment  [-Wunknown-pragmas]
 #pragma comment(linker, "/stack:200000000")
 
dishes.cpp: In function 'int main()':
dishes.cpp:144:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(int j = 0; j < adj2[i].size(); j++) {
                        ~~^~~~~~~~~~~~~~~~
dishes.cpp:166:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(int j = 0; j < adj1[i].size(); j++) {
                        ~~^~~~~~~~~~~~~~~~
dishes.cpp:217:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(int j = 0; j < adj2[i].size(); j++) {
                        ~~^~~~~~~~~~~~~~~~
dishes.cpp:113:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d %d", &N, &M);
     ~~~~~^~~~~~~~~~~~~~~~~
dishes.cpp:116:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%lld %lld %lld", &A[i], &S[i], &P[i]);
         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dishes.cpp:119:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%lld %lld %lld", &B[i], &T[i], &Q[i]);
         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 648 ms 155912 KB Output is correct
2 Correct 670 ms 154488 KB Output is correct
3 Correct 529 ms 148700 KB Output is correct
4 Correct 596 ms 152932 KB Output is correct
5 Correct 100 ms 94536 KB Output is correct
6 Correct 612 ms 150820 KB Output is correct
7 Correct 223 ms 113916 KB Output is correct
8 Correct 391 ms 129744 KB Output is correct
9 Correct 534 ms 149692 KB Output is correct
10 Correct 589 ms 152104 KB Output is correct
11 Correct 475 ms 143032 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 99 ms 94328 KB Output is correct
2 Correct 100 ms 94372 KB Output is correct
3 Correct 98 ms 94328 KB Output is correct
4 Correct 115 ms 94424 KB Output is correct
5 Correct 99 ms 94328 KB Output is correct
6 Correct 98 ms 94328 KB Output is correct
7 Correct 98 ms 94516 KB Output is correct
8 Correct 98 ms 94300 KB Output is correct
9 Correct 99 ms 94320 KB Output is correct
10 Correct 98 ms 94328 KB Output is correct
11 Correct 98 ms 94328 KB Output is correct
12 Correct 98 ms 94328 KB Output is correct
13 Correct 100 ms 94328 KB Output is correct
14 Correct 99 ms 94456 KB Output is correct
15 Correct 113 ms 94456 KB Output is correct
16 Correct 104 ms 94328 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 99 ms 94328 KB Output is correct
2 Correct 100 ms 94372 KB Output is correct
3 Correct 98 ms 94328 KB Output is correct
4 Correct 115 ms 94424 KB Output is correct
5 Correct 99 ms 94328 KB Output is correct
6 Correct 98 ms 94328 KB Output is correct
7 Correct 98 ms 94516 KB Output is correct
8 Correct 98 ms 94300 KB Output is correct
9 Correct 99 ms 94320 KB Output is correct
10 Correct 98 ms 94328 KB Output is correct
11 Correct 98 ms 94328 KB Output is correct
12 Correct 98 ms 94328 KB Output is correct
13 Correct 100 ms 94328 KB Output is correct
14 Correct 99 ms 94456 KB Output is correct
15 Correct 113 ms 94456 KB Output is correct
16 Correct 104 ms 94328 KB Output is correct
17 Correct 102 ms 94872 KB Output is correct
18 Correct 106 ms 94860 KB Output is correct
19 Correct 105 ms 94840 KB Output is correct
20 Correct 104 ms 94904 KB Output is correct
21 Correct 104 ms 94884 KB Output is correct
22 Correct 104 ms 94840 KB Output is correct
23 Correct 102 ms 94872 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 99 ms 94328 KB Output is correct
2 Correct 100 ms 94372 KB Output is correct
3 Correct 98 ms 94328 KB Output is correct
4 Correct 115 ms 94424 KB Output is correct
5 Correct 99 ms 94328 KB Output is correct
6 Correct 98 ms 94328 KB Output is correct
7 Correct 98 ms 94516 KB Output is correct
8 Correct 98 ms 94300 KB Output is correct
9 Correct 99 ms 94320 KB Output is correct
10 Correct 98 ms 94328 KB Output is correct
11 Correct 98 ms 94328 KB Output is correct
12 Correct 98 ms 94328 KB Output is correct
13 Correct 100 ms 94328 KB Output is correct
14 Correct 99 ms 94456 KB Output is correct
15 Correct 113 ms 94456 KB Output is correct
16 Correct 104 ms 94328 KB Output is correct
17 Correct 102 ms 94872 KB Output is correct
18 Correct 106 ms 94860 KB Output is correct
19 Correct 105 ms 94840 KB Output is correct
20 Correct 104 ms 94904 KB Output is correct
21 Correct 104 ms 94884 KB Output is correct
22 Correct 104 ms 94840 KB Output is correct
23 Correct 102 ms 94872 KB Output is correct
24 Correct 512 ms 147164 KB Output is correct
25 Correct 608 ms 144684 KB Output is correct
26 Correct 571 ms 150132 KB Output is correct
27 Correct 644 ms 150284 KB Output is correct
28 Correct 693 ms 147744 KB Output is correct
29 Correct 496 ms 146636 KB Output is correct
30 Correct 981 ms 150728 KB Output is correct
31 Correct 216 ms 111888 KB Output is correct
32 Correct 445 ms 127732 KB Output is correct
33 Correct 810 ms 147488 KB Output is correct
34 Correct 803 ms 149556 KB Output is correct
35 Correct 916 ms 144376 KB Output is correct
36 Correct 911 ms 144548 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 99 ms 94328 KB Output is correct
2 Correct 100 ms 94372 KB Output is correct
3 Correct 98 ms 94328 KB Output is correct
4 Correct 115 ms 94424 KB Output is correct
5 Correct 99 ms 94328 KB Output is correct
6 Correct 98 ms 94328 KB Output is correct
7 Correct 98 ms 94516 KB Output is correct
8 Correct 98 ms 94300 KB Output is correct
9 Correct 99 ms 94320 KB Output is correct
10 Correct 98 ms 94328 KB Output is correct
11 Correct 98 ms 94328 KB Output is correct
12 Correct 98 ms 94328 KB Output is correct
13 Correct 100 ms 94328 KB Output is correct
14 Correct 99 ms 94456 KB Output is correct
15 Correct 113 ms 94456 KB Output is correct
16 Correct 104 ms 94328 KB Output is correct
17 Correct 102 ms 94872 KB Output is correct
18 Correct 106 ms 94860 KB Output is correct
19 Correct 105 ms 94840 KB Output is correct
20 Correct 104 ms 94904 KB Output is correct
21 Correct 104 ms 94884 KB Output is correct
22 Correct 104 ms 94840 KB Output is correct
23 Correct 102 ms 94872 KB Output is correct
24 Correct 512 ms 147164 KB Output is correct
25 Correct 608 ms 144684 KB Output is correct
26 Correct 571 ms 150132 KB Output is correct
27 Correct 644 ms 150284 KB Output is correct
28 Correct 693 ms 147744 KB Output is correct
29 Correct 496 ms 146636 KB Output is correct
30 Correct 981 ms 150728 KB Output is correct
31 Correct 216 ms 111888 KB Output is correct
32 Correct 445 ms 127732 KB Output is correct
33 Correct 810 ms 147488 KB Output is correct
34 Correct 803 ms 149556 KB Output is correct
35 Correct 916 ms 144376 KB Output is correct
36 Correct 911 ms 144548 KB Output is correct
37 Correct 617 ms 153320 KB Output is correct
38 Correct 676 ms 153152 KB Output is correct
39 Correct 635 ms 155620 KB Output is correct
40 Correct 651 ms 155616 KB Output is correct
41 Correct 100 ms 94328 KB Output is correct
42 Correct 1065 ms 153824 KB Output is correct
43 Correct 852 ms 150444 KB Output is correct
44 Correct 855 ms 152300 KB Output is correct
45 Correct 960 ms 147408 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 99 ms 94328 KB Output is correct
2 Correct 100 ms 94372 KB Output is correct
3 Correct 98 ms 94328 KB Output is correct
4 Correct 115 ms 94424 KB Output is correct
5 Correct 99 ms 94328 KB Output is correct
6 Correct 98 ms 94328 KB Output is correct
7 Correct 98 ms 94516 KB Output is correct
8 Correct 98 ms 94300 KB Output is correct
9 Correct 99 ms 94320 KB Output is correct
10 Correct 98 ms 94328 KB Output is correct
11 Correct 98 ms 94328 KB Output is correct
12 Correct 98 ms 94328 KB Output is correct
13 Correct 100 ms 94328 KB Output is correct
14 Correct 99 ms 94456 KB Output is correct
15 Correct 113 ms 94456 KB Output is correct
16 Correct 104 ms 94328 KB Output is correct
17 Correct 102 ms 94872 KB Output is correct
18 Correct 106 ms 94860 KB Output is correct
19 Correct 105 ms 94840 KB Output is correct
20 Correct 104 ms 94904 KB Output is correct
21 Correct 104 ms 94884 KB Output is correct
22 Correct 104 ms 94840 KB Output is correct
23 Correct 102 ms 94872 KB Output is correct
24 Correct 512 ms 147164 KB Output is correct
25 Correct 608 ms 144684 KB Output is correct
26 Correct 571 ms 150132 KB Output is correct
27 Correct 644 ms 150284 KB Output is correct
28 Correct 693 ms 147744 KB Output is correct
29 Correct 496 ms 146636 KB Output is correct
30 Correct 981 ms 150728 KB Output is correct
31 Correct 216 ms 111888 KB Output is correct
32 Correct 445 ms 127732 KB Output is correct
33 Correct 810 ms 147488 KB Output is correct
34 Correct 803 ms 149556 KB Output is correct
35 Correct 916 ms 144376 KB Output is correct
36 Correct 911 ms 144548 KB Output is correct
37 Correct 617 ms 153320 KB Output is correct
38 Correct 676 ms 153152 KB Output is correct
39 Correct 635 ms 155620 KB Output is correct
40 Correct 651 ms 155616 KB Output is correct
41 Correct 100 ms 94328 KB Output is correct
42 Correct 1065 ms 153824 KB Output is correct
43 Correct 852 ms 150444 KB Output is correct
44 Correct 855 ms 152300 KB Output is correct
45 Correct 960 ms 147408 KB Output is correct
46 Correct 3198 ms 386620 KB Output is correct
47 Correct 3218 ms 389272 KB Output is correct
48 Correct 2947 ms 399564 KB Output is correct
49 Correct 3050 ms 400932 KB Output is correct
50 Correct 6345 ms 399716 KB Output is correct
51 Correct 4441 ms 375888 KB Output is correct
52 Correct 4492 ms 374148 KB Output is correct
53 Correct 5677 ms 359976 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 648 ms 155912 KB Output is correct
2 Correct 670 ms 154488 KB Output is correct
3 Correct 529 ms 148700 KB Output is correct
4 Correct 596 ms 152932 KB Output is correct
5 Correct 100 ms 94536 KB Output is correct
6 Correct 612 ms 150820 KB Output is correct
7 Correct 223 ms 113916 KB Output is correct
8 Correct 391 ms 129744 KB Output is correct
9 Correct 534 ms 149692 KB Output is correct
10 Correct 589 ms 152104 KB Output is correct
11 Correct 475 ms 143032 KB Output is correct
12 Correct 99 ms 94328 KB Output is correct
13 Correct 100 ms 94372 KB Output is correct
14 Correct 98 ms 94328 KB Output is correct
15 Correct 115 ms 94424 KB Output is correct
16 Correct 99 ms 94328 KB Output is correct
17 Correct 98 ms 94328 KB Output is correct
18 Correct 98 ms 94516 KB Output is correct
19 Correct 98 ms 94300 KB Output is correct
20 Correct 99 ms 94320 KB Output is correct
21 Correct 98 ms 94328 KB Output is correct
22 Correct 98 ms 94328 KB Output is correct
23 Correct 98 ms 94328 KB Output is correct
24 Correct 100 ms 94328 KB Output is correct
25 Correct 99 ms 94456 KB Output is correct
26 Correct 113 ms 94456 KB Output is correct
27 Correct 104 ms 94328 KB Output is correct
28 Correct 102 ms 94872 KB Output is correct
29 Correct 106 ms 94860 KB Output is correct
30 Correct 105 ms 94840 KB Output is correct
31 Correct 104 ms 94904 KB Output is correct
32 Correct 104 ms 94884 KB Output is correct
33 Correct 104 ms 94840 KB Output is correct
34 Correct 102 ms 94872 KB Output is correct
35 Correct 512 ms 147164 KB Output is correct
36 Correct 608 ms 144684 KB Output is correct
37 Correct 571 ms 150132 KB Output is correct
38 Correct 644 ms 150284 KB Output is correct
39 Correct 693 ms 147744 KB Output is correct
40 Correct 496 ms 146636 KB Output is correct
41 Correct 981 ms 150728 KB Output is correct
42 Correct 216 ms 111888 KB Output is correct
43 Correct 445 ms 127732 KB Output is correct
44 Correct 810 ms 147488 KB Output is correct
45 Correct 803 ms 149556 KB Output is correct
46 Correct 916 ms 144376 KB Output is correct
47 Correct 911 ms 144548 KB Output is correct
48 Correct 617 ms 153320 KB Output is correct
49 Correct 676 ms 153152 KB Output is correct
50 Correct 635 ms 155620 KB Output is correct
51 Correct 651 ms 155616 KB Output is correct
52 Correct 100 ms 94328 KB Output is correct
53 Correct 1065 ms 153824 KB Output is correct
54 Correct 852 ms 150444 KB Output is correct
55 Correct 855 ms 152300 KB Output is correct
56 Correct 960 ms 147408 KB Output is correct
57 Correct 752 ms 176092 KB Output is correct
58 Correct 968 ms 190220 KB Output is correct
59 Correct 902 ms 186924 KB Output is correct
60 Correct 757 ms 172660 KB Output is correct
61 Correct 1012 ms 150804 KB Output is correct
62 Correct 101 ms 94328 KB Output is correct
63 Correct 1271 ms 169628 KB Output is correct
64 Correct 927 ms 157892 KB Output is correct
65 Correct 1161 ms 167952 KB Output is correct
66 Correct 1292 ms 164932 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 648 ms 155912 KB Output is correct
2 Correct 670 ms 154488 KB Output is correct
3 Correct 529 ms 148700 KB Output is correct
4 Correct 596 ms 152932 KB Output is correct
5 Correct 100 ms 94536 KB Output is correct
6 Correct 612 ms 150820 KB Output is correct
7 Correct 223 ms 113916 KB Output is correct
8 Correct 391 ms 129744 KB Output is correct
9 Correct 534 ms 149692 KB Output is correct
10 Correct 589 ms 152104 KB Output is correct
11 Correct 475 ms 143032 KB Output is correct
12 Correct 99 ms 94328 KB Output is correct
13 Correct 100 ms 94372 KB Output is correct
14 Correct 98 ms 94328 KB Output is correct
15 Correct 115 ms 94424 KB Output is correct
16 Correct 99 ms 94328 KB Output is correct
17 Correct 98 ms 94328 KB Output is correct
18 Correct 98 ms 94516 KB Output is correct
19 Correct 98 ms 94300 KB Output is correct
20 Correct 99 ms 94320 KB Output is correct
21 Correct 98 ms 94328 KB Output is correct
22 Correct 98 ms 94328 KB Output is correct
23 Correct 98 ms 94328 KB Output is correct
24 Correct 100 ms 94328 KB Output is correct
25 Correct 99 ms 94456 KB Output is correct
26 Correct 113 ms 94456 KB Output is correct
27 Correct 104 ms 94328 KB Output is correct
28 Correct 102 ms 94872 KB Output is correct
29 Correct 106 ms 94860 KB Output is correct
30 Correct 105 ms 94840 KB Output is correct
31 Correct 104 ms 94904 KB Output is correct
32 Correct 104 ms 94884 KB Output is correct
33 Correct 104 ms 94840 KB Output is correct
34 Correct 102 ms 94872 KB Output is correct
35 Correct 512 ms 147164 KB Output is correct
36 Correct 608 ms 144684 KB Output is correct
37 Correct 571 ms 150132 KB Output is correct
38 Correct 644 ms 150284 KB Output is correct
39 Correct 693 ms 147744 KB Output is correct
40 Correct 496 ms 146636 KB Output is correct
41 Correct 981 ms 150728 KB Output is correct
42 Correct 216 ms 111888 KB Output is correct
43 Correct 445 ms 127732 KB Output is correct
44 Correct 810 ms 147488 KB Output is correct
45 Correct 803 ms 149556 KB Output is correct
46 Correct 916 ms 144376 KB Output is correct
47 Correct 911 ms 144548 KB Output is correct
48 Correct 617 ms 153320 KB Output is correct
49 Correct 676 ms 153152 KB Output is correct
50 Correct 635 ms 155620 KB Output is correct
51 Correct 651 ms 155616 KB Output is correct
52 Correct 100 ms 94328 KB Output is correct
53 Correct 1065 ms 153824 KB Output is correct
54 Correct 852 ms 150444 KB Output is correct
55 Correct 855 ms 152300 KB Output is correct
56 Correct 960 ms 147408 KB Output is correct
57 Correct 3198 ms 386620 KB Output is correct
58 Correct 3218 ms 389272 KB Output is correct
59 Correct 2947 ms 399564 KB Output is correct
60 Correct 3050 ms 400932 KB Output is correct
61 Correct 6345 ms 399716 KB Output is correct
62 Correct 4441 ms 375888 KB Output is correct
63 Correct 4492 ms 374148 KB Output is correct
64 Correct 5677 ms 359976 KB Output is correct
65 Correct 752 ms 176092 KB Output is correct
66 Correct 968 ms 190220 KB Output is correct
67 Correct 902 ms 186924 KB Output is correct
68 Correct 757 ms 172660 KB Output is correct
69 Correct 1012 ms 150804 KB Output is correct
70 Correct 101 ms 94328 KB Output is correct
71 Correct 1271 ms 169628 KB Output is correct
72 Correct 927 ms 157892 KB Output is correct
73 Correct 1161 ms 167952 KB Output is correct
74 Correct 1292 ms 164932 KB Output is correct
75 Correct 4067 ms 495224 KB Output is correct
76 Correct 5026 ms 569776 KB Output is correct
77 Correct 4490 ms 552976 KB Output is correct
78 Correct 3579 ms 482268 KB Output is correct
79 Correct 8355 ms 468972 KB Output is correct
80 Correct 5609 ms 413656 KB Output is correct
81 Correct 5897 ms 425576 KB Output is correct
82 Correct 7528 ms 427752 KB Output is correct
83 Correct 7548 ms 453460 KB Output is correct