Submission #933496

# Submission time Handle Problem Language Result Execution time Memory
933496 2024-02-25T18:49:37 Z ksujay2 Fish 2 (JOI22_fish2) C++17
100 / 100
1544 ms 15192 KB
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MXN = 1e5 + 1;
const ll INF = 1e18;

// count min segtree
const int SEGTSZ = 2 << 17;
struct D {
    int cnt, mn, lz;
} segt[SEGTSZ];


void pull(int s) {
    segt[s].mn = min(segt[2 * s].mn, segt[2 * s + 1].mn);
    segt[s].cnt = (segt[2 * s].mn == segt[s].mn ? segt[2 * s].cnt : 0) + (segt[2 * s + 1].mn == segt[s].mn ? segt[2 * s + 1].cnt : 0);
    segt[s].mn += segt[s].lz;
}

void build(int s, int lb, int rb) {
    if(lb == rb) {
        segt[s].cnt = 1;
        return;
    }
    int m = (lb + rb) / 2;
    build(2 * s, lb, m);
    build(2 * s + 1, m + 1, rb);
    pull(s);
}

void upd(int u, int l, int r, int s, int lb, int rb) {
    l = max(lb, l), r = min(rb, r);    
    if(r < l) return;
    if(l == lb && r == rb) {
        segt[s].lz += u;
        segt[s].mn += u;
        return;
    }
    int m = (lb + rb) / 2;
    upd(u, l, r, 2 * s, lb, m);
    upd(u, l, r, 2 * s + 1, m + 1, rb);
    pull(s);
}

pair<int, int> query(int l, int r, int s, int lz, int lb, int rb) {
    l = max(lb, l), r = min(rb, r);    
    if(r < l) return {1e9, 0};
    if(l == lb && r == rb) {
        return {segt[s].mn + lz, segt[s].cnt};
    }
    int m = (lb + rb) / 2;
    lz += segt[s].lz;
    auto lres = query(l, r, 2 * s, lz, lb, m);
    auto rres = query(l, r, 2 * s + 1, lz, m + 1, rb);
    if(lres.first > rres.first) swap(rres, lres);
    lres.second += (lres.first == rres.first) ? rres.second : 0;
    return lres;
}

// go as left / right as possible
struct D2 {
    ll sm, mn;
} lsegt[SEGTSZ], rsegt[SEGTSZ];

void lupd(ll u, int k, int s, int lb, int rb) {
    if(k == lb && rb == k) {
        lsegt[s].sm += u;
        lsegt[s].mn += u;
        return;
    }
    int m = (lb + rb) / 2;
    if(k <= m) {
        lupd(u, k, 2 * s, lb, m);
    } else {
        lupd(u, k, 2 * s + 1, m + 1, rb);
    }
    lsegt[s].mn = min(lsegt[2 * s].mn, lsegt[2 * s].sm + lsegt[2 * s + 1].mn);
    lsegt[s].sm = lsegt[2 * s].sm + lsegt[2 * s + 1].sm;
}

void rupd(ll u, int k, int s, int lb, int rb) {
    if(k == lb && rb == k) {
        rsegt[s].sm += u;
        rsegt[s].mn += u;
        return;
    }
    int m = (lb + rb) / 2;
    if(k <= m) {
        rupd(u, k, 2 * s, lb, m);
    } else {
        rupd(u, k, 2 * s + 1, m + 1, rb);
    }
    rsegt[s].mn = min(rsegt[2 * s + 1].mn, rsegt[2 * s + 1].sm + rsegt[2 * s].mn);
    rsegt[s].sm = rsegt[2 * s].sm + rsegt[2 * s + 1].sm;
}

ll lquery(int l, int r, int s, int lb, int rb) {
    l = max(l, lb), r = min(r, rb);
    if(r < l) return 0;
    if(l == lb && r == rb) {
        return lsegt[s].sm;
    }
    int m = (lb + rb) / 2;
    return lquery(l, r, 2 * s, lb, m) + lquery(l, r, 2 * s + 1, m + 1, rb);
}
ll rquery(int l, int r, int s, int lb, int rb) {
    l = max(l, lb), r = min(r, rb);
    if(r < l) return 0;
    if(l == lb && r == rb) {
        return rsegt[s].sm;
    }
    int m = (lb + rb) / 2;
    return rquery(l, r, 2 * s, lb, m) + rquery(l, r, 2 * s + 1, m + 1, rb);
}

ll lfind(ll v, int l, int& r, int s, int lb, int rb) {
    if(rb < l) return v;
    if(lb == rb && v + lsegt[s].sm < 0) {
        r = lb;
        return v + lsegt[s].sm;
    }
    if(l <= lb && v + lsegt[s].mn >= 0) {
        return v + lsegt[s].sm;
    }
    int m = (lb + rb) / 2;
    v = lfind(v, l, r, 2 * s, lb, m);
    if(r == -1) {
        v = lfind(v, l, r, 2 * s + 1, m + 1, rb);
    }
    return v;
}

ll rfind(ll v, int r, int& l, int s, int lb, int rb) {
    if(r < lb) return v;
    if(lb == rb && v + rsegt[s].sm < 0) {
        l = lb;
        return v + rsegt[s].sm;
    }
    if(rb <= r && v + rsegt[s].mn >= 0) {
        return v + rsegt[s].sm;
    }
    int m = (lb + rb) / 2;
    v = rfind(v, r, l, 2 * s + 1, m + 1, rb);
    if(l == -1) {
        v = rfind(v, r, l, 2 * s, lb, m);
    }
    return v;
}

int N; 
int A[MXN];

void comp(int k, int u) {
    int l = k, r = k;
    if((l == 1 || (A[l - 1] > A[l])) && (r == N || (A[r + 1] > A[r]))) {
        // cout << l << " " << r << " " << u << endl;
        upd(u, l, r, 1, 1, N);
    }
    while(1 < l || r < N) {
        if(l == 1 || (r != N && A[r + 1] < A[l - 1])) {
            int nr = -1;
            lfind(lquery(l, r, 1, 1, N) - A[l], r + 1, nr, 1, 1, N);
            r = nr;
        } else {
            int nl = -1;
            rfind(rquery(l, r, 1, 1, N) - A[r], l - 1, nl, 1, 1, N);
            l = nl;
        }
        if(rquery(l, r, 1, 1, N) - A[r] < 0 && lquery(l, r, 1, 1, N) - A[l] < 0) {
            // cout << l << " " << r << " " << u << endl;
            upd(u, l, r, 1, 1, N);
        }
    }
    r = k;
    while(true) {
        int nr = -1;
        lfind(lquery(k + 1, r, 1, 1, N) - A[k + 1], r + 1, nr, 1, 1, N);
        r = nr;
        if(rquery(k + 1, r, 1, 1, N) - A[r] >= 0) break;
        upd(u, k + 1, r, 1, 1, N);
        if(r >= N) break;
    }
    l = k;
    while(true) {
        int nl = -1;
        rfind(rquery(l, k - 1, 1, 1, N) - A[k - 1], l - 1, nl, 1, 1, N);
        l = nl;
        if(lquery(l, k - 1, 1, 1, N) - A[l] >= 0) break;
        upd(u, l, k - 1, 1, 1, N);
        if(l <= 1) break;
    }
}

int main() {
    ios::sync_with_stdio(false), cin.tie(nullptr);
    cin >> N;
    for(int i = 1; i <= N; i++) cin >> A[i];
    for(int i = 1; i < N; i++) {
        lupd(2 * A[i] - A[i + 1], i, 1, 1, N);
    }
    lupd(-INF, N, 1, 1, N);
    for(int i = N; i >= 2; i--) {
        rupd(2 * A[i] - A[i - 1], i, 1, 1, N);
    }
    rupd(-INF, 1, 1, 1, N);
    for(int i = 1; i <= N; i++) {
        int r = i - 1;
        while(true) {
            int nr = -1;
            lfind(lquery(i, r, 1, 1, N) - A[i], r + 1, nr, 1, 1, N);
            r = nr;
            if(rquery(i, r, 1, 1, N) - A[r] >= 0) break;
            upd(1, i, r, 1, 1, N);
            if(r >= N) break;
        }
    }
    build(1, 1, N);
    int Q; cin >> Q;
    for(int i = 0; i < Q; i++) {
        int t; cin >> t;
        if(t == 1) {
            int x, y; cin >> x >> y;
            comp(x, -1);
            int del = y - A[x];
            A[x] = y;
            if(x < N) lupd(2 * del, x, 1, 1, N);
            if(x > 1) rupd(2 * del, x, 1, 1, N);
            if(x > 1) lupd(-del, x - 1, 1, 1, N);
            if(x < N) rupd(-del, x + 1, 1, 1, N);
            comp(x, 1);
        } else {
            int L, R; cin >> L >> R;
            int r = L - 1;
            while(true) {
                int nr = -1;
                lfind(lquery(L, r, 1, 1, N) - A[L], r + 1, nr, 1, 1, N);
                if(nr >= R) break;
                r = nr;
            }
            r++;
            int l = R + 1;
            while(true) {
                int nl = -1;
                rfind(rquery(l, R, 1, 1, N) - A[R], l - 1, nl, 1, 1, N);
                if(nl <= L) break;
                l = nl;
            }
            l--;
            // cout << r << " " << l << endl;
            cout << query(r, l, 1, 0, 1, N).second << '\n';
        }
    }
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 6488 KB Output is correct
2 Correct 1 ms 6492 KB Output is correct
3 Correct 1 ms 6608 KB Output is correct
4 Correct 1 ms 6488 KB Output is correct
5 Correct 5 ms 6492 KB Output is correct
6 Correct 3 ms 6492 KB Output is correct
7 Correct 4 ms 6488 KB Output is correct
8 Correct 5 ms 6488 KB Output is correct
9 Correct 3 ms 6488 KB Output is correct
10 Correct 3 ms 6492 KB Output is correct
11 Correct 2 ms 6492 KB Output is correct
12 Correct 4 ms 6492 KB Output is correct
13 Correct 3 ms 6492 KB Output is correct
14 Correct 2 ms 6744 KB Output is correct
15 Correct 4 ms 6740 KB Output is correct
16 Correct 2 ms 6488 KB Output is correct
17 Correct 4 ms 6492 KB Output is correct
18 Correct 2 ms 6488 KB Output is correct
19 Correct 3 ms 6488 KB Output is correct
20 Correct 2 ms 6492 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 6492 KB Output is correct
2 Correct 92 ms 12616 KB Output is correct
3 Correct 89 ms 12228 KB Output is correct
4 Correct 90 ms 12624 KB Output is correct
5 Correct 96 ms 12444 KB Output is correct
6 Correct 84 ms 13020 KB Output is correct
7 Correct 65 ms 12112 KB Output is correct
8 Correct 78 ms 12880 KB Output is correct
9 Correct 65 ms 12116 KB Output is correct
10 Correct 77 ms 12624 KB Output is correct
11 Correct 73 ms 12292 KB Output is correct
12 Correct 82 ms 12368 KB Output is correct
13 Correct 80 ms 12164 KB Output is correct
14 Correct 93 ms 12496 KB Output is correct
15 Correct 87 ms 12660 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 6488 KB Output is correct
2 Correct 1 ms 6492 KB Output is correct
3 Correct 1 ms 6608 KB Output is correct
4 Correct 1 ms 6488 KB Output is correct
5 Correct 5 ms 6492 KB Output is correct
6 Correct 3 ms 6492 KB Output is correct
7 Correct 4 ms 6488 KB Output is correct
8 Correct 5 ms 6488 KB Output is correct
9 Correct 3 ms 6488 KB Output is correct
10 Correct 3 ms 6492 KB Output is correct
11 Correct 2 ms 6492 KB Output is correct
12 Correct 4 ms 6492 KB Output is correct
13 Correct 3 ms 6492 KB Output is correct
14 Correct 2 ms 6744 KB Output is correct
15 Correct 4 ms 6740 KB Output is correct
16 Correct 2 ms 6488 KB Output is correct
17 Correct 4 ms 6492 KB Output is correct
18 Correct 2 ms 6488 KB Output is correct
19 Correct 3 ms 6488 KB Output is correct
20 Correct 2 ms 6492 KB Output is correct
21 Correct 1 ms 6492 KB Output is correct
22 Correct 92 ms 12616 KB Output is correct
23 Correct 89 ms 12228 KB Output is correct
24 Correct 90 ms 12624 KB Output is correct
25 Correct 96 ms 12444 KB Output is correct
26 Correct 84 ms 13020 KB Output is correct
27 Correct 65 ms 12112 KB Output is correct
28 Correct 78 ms 12880 KB Output is correct
29 Correct 65 ms 12116 KB Output is correct
30 Correct 77 ms 12624 KB Output is correct
31 Correct 73 ms 12292 KB Output is correct
32 Correct 82 ms 12368 KB Output is correct
33 Correct 80 ms 12164 KB Output is correct
34 Correct 93 ms 12496 KB Output is correct
35 Correct 87 ms 12660 KB Output is correct
36 Correct 110 ms 12628 KB Output is correct
37 Correct 98 ms 12384 KB Output is correct
38 Correct 91 ms 12372 KB Output is correct
39 Correct 113 ms 12628 KB Output is correct
40 Correct 91 ms 12372 KB Output is correct
41 Correct 81 ms 12896 KB Output is correct
42 Correct 80 ms 12880 KB Output is correct
43 Correct 72 ms 12116 KB Output is correct
44 Correct 73 ms 12132 KB Output is correct
45 Correct 97 ms 12500 KB Output is correct
46 Correct 82 ms 12628 KB Output is correct
47 Correct 71 ms 12204 KB Output is correct
48 Correct 89 ms 12368 KB Output is correct
49 Correct 82 ms 12368 KB Output is correct
50 Correct 96 ms 12664 KB Output is correct
51 Correct 89 ms 12512 KB Output is correct
52 Correct 88 ms 12624 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 6492 KB Output is correct
2 Correct 92 ms 12616 KB Output is correct
3 Correct 89 ms 12228 KB Output is correct
4 Correct 90 ms 12624 KB Output is correct
5 Correct 96 ms 12444 KB Output is correct
6 Correct 84 ms 13020 KB Output is correct
7 Correct 65 ms 12112 KB Output is correct
8 Correct 78 ms 12880 KB Output is correct
9 Correct 65 ms 12116 KB Output is correct
10 Correct 77 ms 12624 KB Output is correct
11 Correct 73 ms 12292 KB Output is correct
12 Correct 82 ms 12368 KB Output is correct
13 Correct 80 ms 12164 KB Output is correct
14 Correct 93 ms 12496 KB Output is correct
15 Correct 87 ms 12660 KB Output is correct
16 Correct 1 ms 6492 KB Output is correct
17 Correct 596 ms 14132 KB Output is correct
18 Correct 576 ms 14588 KB Output is correct
19 Correct 585 ms 14060 KB Output is correct
20 Correct 624 ms 14216 KB Output is correct
21 Correct 577 ms 14060 KB Output is correct
22 Correct 543 ms 14420 KB Output is correct
23 Correct 518 ms 13904 KB Output is correct
24 Correct 694 ms 14112 KB Output is correct
25 Correct 567 ms 14164 KB Output is correct
26 Correct 696 ms 14312 KB Output is correct
27 Correct 243 ms 14928 KB Output is correct
28 Correct 247 ms 14936 KB Output is correct
29 Correct 239 ms 14928 KB Output is correct
30 Correct 477 ms 13804 KB Output is correct
31 Correct 458 ms 13672 KB Output is correct
32 Correct 875 ms 13908 KB Output is correct
33 Correct 399 ms 14484 KB Output is correct
34 Correct 892 ms 14080 KB Output is correct
35 Correct 529 ms 13944 KB Output is correct
36 Correct 709 ms 14344 KB Output is correct
37 Correct 280 ms 13920 KB Output is correct
38 Correct 262 ms 13808 KB Output is correct
39 Correct 307 ms 14828 KB Output is correct
40 Correct 270 ms 14416 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 6492 KB Output is correct
2 Correct 92 ms 12616 KB Output is correct
3 Correct 89 ms 12228 KB Output is correct
4 Correct 90 ms 12624 KB Output is correct
5 Correct 96 ms 12444 KB Output is correct
6 Correct 84 ms 13020 KB Output is correct
7 Correct 65 ms 12112 KB Output is correct
8 Correct 78 ms 12880 KB Output is correct
9 Correct 65 ms 12116 KB Output is correct
10 Correct 77 ms 12624 KB Output is correct
11 Correct 73 ms 12292 KB Output is correct
12 Correct 82 ms 12368 KB Output is correct
13 Correct 80 ms 12164 KB Output is correct
14 Correct 93 ms 12496 KB Output is correct
15 Correct 87 ms 12660 KB Output is correct
16 Correct 1 ms 6492 KB Output is correct
17 Correct 1499 ms 13780 KB Output is correct
18 Correct 1035 ms 14196 KB Output is correct
19 Correct 1224 ms 13596 KB Output is correct
20 Correct 896 ms 14140 KB Output is correct
21 Correct 1524 ms 13944 KB Output is correct
22 Correct 1047 ms 13996 KB Output is correct
23 Correct 1357 ms 13452 KB Output is correct
24 Correct 957 ms 14364 KB Output is correct
25 Correct 1198 ms 13392 KB Output is correct
26 Correct 451 ms 15064 KB Output is correct
27 Correct 581 ms 14592 KB Output is correct
28 Correct 713 ms 14208 KB Output is correct
29 Correct 488 ms 15028 KB Output is correct
30 Correct 560 ms 14928 KB Output is correct
31 Correct 858 ms 14148 KB Output is correct
32 Correct 1111 ms 14052 KB Output is correct
33 Correct 812 ms 13684 KB Output is correct
34 Correct 1038 ms 14344 KB Output is correct
35 Correct 595 ms 14080 KB Output is correct
36 Correct 871 ms 14160 KB Output is correct
37 Correct 805 ms 13796 KB Output is correct
38 Correct 614 ms 13652 KB Output is correct
39 Correct 611 ms 14176 KB Output is correct
40 Correct 355 ms 14584 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 6488 KB Output is correct
2 Correct 1 ms 6492 KB Output is correct
3 Correct 1 ms 6608 KB Output is correct
4 Correct 1 ms 6488 KB Output is correct
5 Correct 5 ms 6492 KB Output is correct
6 Correct 3 ms 6492 KB Output is correct
7 Correct 4 ms 6488 KB Output is correct
8 Correct 5 ms 6488 KB Output is correct
9 Correct 3 ms 6488 KB Output is correct
10 Correct 3 ms 6492 KB Output is correct
11 Correct 2 ms 6492 KB Output is correct
12 Correct 4 ms 6492 KB Output is correct
13 Correct 3 ms 6492 KB Output is correct
14 Correct 2 ms 6744 KB Output is correct
15 Correct 4 ms 6740 KB Output is correct
16 Correct 2 ms 6488 KB Output is correct
17 Correct 4 ms 6492 KB Output is correct
18 Correct 2 ms 6488 KB Output is correct
19 Correct 3 ms 6488 KB Output is correct
20 Correct 2 ms 6492 KB Output is correct
21 Correct 1 ms 6492 KB Output is correct
22 Correct 92 ms 12616 KB Output is correct
23 Correct 89 ms 12228 KB Output is correct
24 Correct 90 ms 12624 KB Output is correct
25 Correct 96 ms 12444 KB Output is correct
26 Correct 84 ms 13020 KB Output is correct
27 Correct 65 ms 12112 KB Output is correct
28 Correct 78 ms 12880 KB Output is correct
29 Correct 65 ms 12116 KB Output is correct
30 Correct 77 ms 12624 KB Output is correct
31 Correct 73 ms 12292 KB Output is correct
32 Correct 82 ms 12368 KB Output is correct
33 Correct 80 ms 12164 KB Output is correct
34 Correct 93 ms 12496 KB Output is correct
35 Correct 87 ms 12660 KB Output is correct
36 Correct 110 ms 12628 KB Output is correct
37 Correct 98 ms 12384 KB Output is correct
38 Correct 91 ms 12372 KB Output is correct
39 Correct 113 ms 12628 KB Output is correct
40 Correct 91 ms 12372 KB Output is correct
41 Correct 81 ms 12896 KB Output is correct
42 Correct 80 ms 12880 KB Output is correct
43 Correct 72 ms 12116 KB Output is correct
44 Correct 73 ms 12132 KB Output is correct
45 Correct 97 ms 12500 KB Output is correct
46 Correct 82 ms 12628 KB Output is correct
47 Correct 71 ms 12204 KB Output is correct
48 Correct 89 ms 12368 KB Output is correct
49 Correct 82 ms 12368 KB Output is correct
50 Correct 96 ms 12664 KB Output is correct
51 Correct 89 ms 12512 KB Output is correct
52 Correct 88 ms 12624 KB Output is correct
53 Correct 1 ms 6492 KB Output is correct
54 Correct 596 ms 14132 KB Output is correct
55 Correct 576 ms 14588 KB Output is correct
56 Correct 585 ms 14060 KB Output is correct
57 Correct 624 ms 14216 KB Output is correct
58 Correct 577 ms 14060 KB Output is correct
59 Correct 543 ms 14420 KB Output is correct
60 Correct 518 ms 13904 KB Output is correct
61 Correct 694 ms 14112 KB Output is correct
62 Correct 567 ms 14164 KB Output is correct
63 Correct 696 ms 14312 KB Output is correct
64 Correct 243 ms 14928 KB Output is correct
65 Correct 247 ms 14936 KB Output is correct
66 Correct 239 ms 14928 KB Output is correct
67 Correct 477 ms 13804 KB Output is correct
68 Correct 458 ms 13672 KB Output is correct
69 Correct 875 ms 13908 KB Output is correct
70 Correct 399 ms 14484 KB Output is correct
71 Correct 892 ms 14080 KB Output is correct
72 Correct 529 ms 13944 KB Output is correct
73 Correct 709 ms 14344 KB Output is correct
74 Correct 280 ms 13920 KB Output is correct
75 Correct 262 ms 13808 KB Output is correct
76 Correct 307 ms 14828 KB Output is correct
77 Correct 270 ms 14416 KB Output is correct
78 Correct 1 ms 6492 KB Output is correct
79 Correct 1499 ms 13780 KB Output is correct
80 Correct 1035 ms 14196 KB Output is correct
81 Correct 1224 ms 13596 KB Output is correct
82 Correct 896 ms 14140 KB Output is correct
83 Correct 1524 ms 13944 KB Output is correct
84 Correct 1047 ms 13996 KB Output is correct
85 Correct 1357 ms 13452 KB Output is correct
86 Correct 957 ms 14364 KB Output is correct
87 Correct 1198 ms 13392 KB Output is correct
88 Correct 451 ms 15064 KB Output is correct
89 Correct 581 ms 14592 KB Output is correct
90 Correct 713 ms 14208 KB Output is correct
91 Correct 488 ms 15028 KB Output is correct
92 Correct 560 ms 14928 KB Output is correct
93 Correct 858 ms 14148 KB Output is correct
94 Correct 1111 ms 14052 KB Output is correct
95 Correct 812 ms 13684 KB Output is correct
96 Correct 1038 ms 14344 KB Output is correct
97 Correct 595 ms 14080 KB Output is correct
98 Correct 871 ms 14160 KB Output is correct
99 Correct 805 ms 13796 KB Output is correct
100 Correct 614 ms 13652 KB Output is correct
101 Correct 611 ms 14176 KB Output is correct
102 Correct 355 ms 14584 KB Output is correct
103 Correct 1544 ms 13436 KB Output is correct
104 Correct 1027 ms 14476 KB Output is correct
105 Correct 707 ms 14164 KB Output is correct
106 Correct 614 ms 14132 KB Output is correct
107 Correct 1386 ms 13680 KB Output is correct
108 Correct 1071 ms 14324 KB Output is correct
109 Correct 821 ms 14176 KB Output is correct
110 Correct 792 ms 14224 KB Output is correct
111 Correct 697 ms 14176 KB Output is correct
112 Correct 602 ms 14168 KB Output is correct
113 Correct 504 ms 14808 KB Output is correct
114 Correct 283 ms 14828 KB Output is correct
115 Correct 804 ms 13940 KB Output is correct
116 Correct 660 ms 14016 KB Output is correct
117 Correct 328 ms 15192 KB Output is correct
118 Correct 467 ms 13908 KB Output is correct
119 Correct 600 ms 14712 KB Output is correct
120 Correct 795 ms 14416 KB Output is correct
121 Correct 604 ms 13908 KB Output is correct
122 Correct 1025 ms 14184 KB Output is correct
123 Correct 652 ms 13776 KB Output is correct
124 Correct 654 ms 13932 KB Output is correct
125 Correct 562 ms 14204 KB Output is correct
126 Correct 610 ms 14044 KB Output is correct
127 Correct 789 ms 13856 KB Output is correct
128 Correct 397 ms 13908 KB Output is correct
129 Correct 573 ms 14416 KB Output is correct
130 Correct 390 ms 14500 KB Output is correct