Submission #764494

# Submission time Handle Problem Language Result Execution time Memory
764494 2023-06-23T13:08:09 Z CDuong Food Court (JOI21_foodcourt) C++17
100 / 100
560 ms 77356 KB
#pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("avx2,fma,bmi,bmi2,sse4.2,popcnt,lzcnt")


#include <bits/stdc++.h>
#define taskname ""
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define int long long
#define ll long long
#define ld long double
#define pb push_back
#define ff first
#define ss second
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vii vector<pii>
using namespace std;

const int mxN = 250000 + 5;
const int mod = 1e9 + 7;
const ll oo = 1e18;

struct node {
    ll sum_plus, sum_minus, idx;
    pll pref_min;

    node() {
        sum_plus = sum_minus = idx = 0;
        pref_min = {0, mod};
    }

    node operator + (const node &o) {
        node res;
        res.sum_plus = sum_plus + o.sum_plus;
        res.sum_minus = sum_minus + o.sum_minus;
        res.pref_min = min(pref_min, {sum_plus - sum_minus + o.pref_min.ff, o.pref_min.ss});
        return res;
    }
} segtree[4 * mxN];

int n, m, q, ans[mxN];
vector<vector<ll>> query;
vi query_time[mxN], all_query;
vii actual_query[mxN];

void update(int l, int r, int idx, int pos, int val) {
    if(l == r) {
        if(val > 0) {
            if(query[pos][0] == 1) segtree[idx].sum_plus = query[pos][2];
            else if(query[pos][0] == 2) segtree[idx].sum_minus = query[pos][1];
            segtree[idx].pref_min = {min(segtree[idx].sum_plus, -segtree[idx].sum_minus), pos};
            segtree[idx].idx = pos;
        }
        else {
            segtree[idx] = node();
        }
        return;
    }

    int mid = (l + r) >> 1;
    if(pos <= mid) update(l, mid, idx << 1, pos, val);
    else update(mid + 1, r, idx << 1 | 1, pos, val);

    segtree[idx] = segtree[idx << 1] + segtree[idx << 1 | 1];
}

node get(int l, int r, int idx, int u, int v) {
    if(v < u) return node();
    if(u <= l && r <= v) {
        return segtree[idx];
    }
    int mid = (l + r) >> 1;
    if(v <= mid) return get(l, mid, idx << 1, u, v);
    else if(mid + 1 <= u) return get(mid + 1, r, idx << 1 | 1, u, v);
    else return get(l, mid, idx << 1, u, v) + get(mid + 1, r, idx << 1 | 1, u, v);
}

int huutuannguvailon(int cur_l, int cur_r, ll k) {
    int l = 1, r = q, idx = 1;
    while(l < r) {
        int mid = (l + r) >> 1;
        if(k > segtree[idx << 1].sum_plus) {
            k -= segtree[idx << 1].sum_plus;
            idx = idx << 1 | 1, l = mid + 1;
        }
        else {
            idx <<= 1, r = mid;
        }
    }
    return query[l][1];
}

void solve() {
    cin >> n >> m >> q;
    
    query.pb({});
    for(int i = 1; i <= q; ++i) {
        int type; cin >> type;
        vector<ll> tmp = {type};
        if(type == 1) {
            int l, r; cin >> l >> r;
            query_time[l].emplace_back(i);
            query_time[r + 1].emplace_back(-i);
            ll k, c; cin >> c >> k;
            tmp.emplace_back(c);
            tmp.emplace_back(k);
        }
        else if(type == 2) {
            int l, r; cin >> l >> r;
            query_time[l].emplace_back(i);
            query_time[r + 1].emplace_back(-i);
            ll k; cin >> k; tmp.emplace_back(k);
        }
        else {
            all_query.emplace_back(i);
            ll cur, k; cin >> cur >> k;
            actual_query[cur].emplace_back(i, k);
        }
        query.pb(tmp);
    }

    for(int i = 1; i <= n; ++i) {
        for(int &val : query_time[i]) {
            if(val > 0) update(1, q, 1, val, 1);
            else update(1, q, 1, -val, -1);
        }
        
        int cope = segtree[1].pref_min.ss;

        if(cope == mod) {
            for(auto &[idx, k] : actual_query[i])
                ans[idx] = 0;
            continue;
        }

        for(auto &[idx, k] : actual_query[i]) {
            auto cur = get(1, q, 1, 1, idx);
            cope = cur.pref_min.ss;

            if(cope == mod || cope == idx) {
                ans[idx] = 0;
                continue;
            }

            auto cur1 = get(1, q, 1, cope, idx);
            if(query[cope][0] == 2)
                cur1.sum_minus -= query[cope][1];

            ll actual_k = k + cur1.sum_minus;
            if(actual_k > cur1.sum_plus) {
                ans[idx] = 0;
                continue;
            }

            ans[idx] = huutuannguvailon(cope, idx, actual_k + cur.sum_plus - cur1.sum_plus);
        }
    }

    for(int &idx : all_query) cout << ans[idx] << endl;
}

signed main() {

#ifndef CDuongg
    if(fopen(taskname".inp", "r"))
        assert(freopen(taskname".inp", "r", stdin)), assert(freopen(taskname".out", "w", stdout));
#else
    freopen("bai3.inp", "r", stdin);
    freopen("bai3.out", "w", stdout);
    auto start = chrono::high_resolution_clock::now();
#endif

    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int t = 1; //cin >> t;
    while(t--) solve();

#ifdef CDuongg
    auto end = chrono::high_resolution_clock::now();
    // cout << "\n"; for(int i = 1; i <= 100; ++i) cout << '=';
    // cout << "\nExecution time: " << chrono::duration_cast<chrono::milliseconds> (end - start).count() << "[ms]" << endl;
#endif

}
# Verdict Execution time Memory Grader output
1 Correct 21 ms 51284 KB Output is correct
2 Correct 21 ms 51420 KB Output is correct
3 Correct 21 ms 51268 KB Output is correct
4 Correct 27 ms 51372 KB Output is correct
5 Correct 21 ms 51352 KB Output is correct
6 Correct 26 ms 51268 KB Output is correct
7 Correct 30 ms 51384 KB Output is correct
8 Correct 28 ms 51280 KB Output is correct
9 Correct 26 ms 51412 KB Output is correct
10 Correct 26 ms 51348 KB Output is correct
11 Correct 22 ms 51316 KB Output is correct
12 Correct 28 ms 51324 KB Output is correct
13 Correct 21 ms 51372 KB Output is correct
14 Correct 22 ms 51284 KB Output is correct
15 Correct 21 ms 51312 KB Output is correct
16 Correct 22 ms 51412 KB Output is correct
17 Correct 25 ms 51316 KB Output is correct
18 Correct 26 ms 51380 KB Output is correct
19 Correct 21 ms 51388 KB Output is correct
20 Correct 25 ms 51292 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 21 ms 51284 KB Output is correct
2 Correct 21 ms 51420 KB Output is correct
3 Correct 21 ms 51268 KB Output is correct
4 Correct 27 ms 51372 KB Output is correct
5 Correct 21 ms 51352 KB Output is correct
6 Correct 26 ms 51268 KB Output is correct
7 Correct 30 ms 51384 KB Output is correct
8 Correct 28 ms 51280 KB Output is correct
9 Correct 26 ms 51412 KB Output is correct
10 Correct 26 ms 51348 KB Output is correct
11 Correct 22 ms 51316 KB Output is correct
12 Correct 28 ms 51324 KB Output is correct
13 Correct 21 ms 51372 KB Output is correct
14 Correct 22 ms 51284 KB Output is correct
15 Correct 21 ms 51312 KB Output is correct
16 Correct 22 ms 51412 KB Output is correct
17 Correct 25 ms 51316 KB Output is correct
18 Correct 26 ms 51380 KB Output is correct
19 Correct 21 ms 51388 KB Output is correct
20 Correct 25 ms 51292 KB Output is correct
21 Correct 21 ms 51328 KB Output is correct
22 Correct 21 ms 51332 KB Output is correct
23 Correct 23 ms 51400 KB Output is correct
24 Correct 25 ms 51416 KB Output is correct
25 Correct 24 ms 51312 KB Output is correct
26 Correct 21 ms 51336 KB Output is correct
27 Correct 28 ms 51324 KB Output is correct
28 Correct 21 ms 51336 KB Output is correct
29 Correct 21 ms 51412 KB Output is correct
30 Correct 24 ms 51336 KB Output is correct
31 Correct 21 ms 51352 KB Output is correct
32 Correct 21 ms 51420 KB Output is correct
33 Correct 21 ms 51300 KB Output is correct
34 Correct 25 ms 51384 KB Output is correct
35 Correct 28 ms 51320 KB Output is correct
36 Correct 22 ms 51400 KB Output is correct
37 Correct 24 ms 51284 KB Output is correct
38 Correct 23 ms 51308 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 102 ms 57768 KB Output is correct
2 Correct 108 ms 57672 KB Output is correct
3 Correct 118 ms 57776 KB Output is correct
4 Correct 113 ms 57784 KB Output is correct
5 Correct 109 ms 57660 KB Output is correct
6 Correct 101 ms 57676 KB Output is correct
7 Correct 68 ms 56696 KB Output is correct
8 Correct 79 ms 56828 KB Output is correct
9 Correct 127 ms 57816 KB Output is correct
10 Correct 103 ms 57696 KB Output is correct
11 Correct 128 ms 57712 KB Output is correct
12 Correct 108 ms 57696 KB Output is correct
13 Correct 98 ms 56932 KB Output is correct
14 Correct 100 ms 57724 KB Output is correct
15 Correct 89 ms 57216 KB Output is correct
16 Correct 92 ms 57604 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 478 ms 74408 KB Output is correct
2 Correct 388 ms 69896 KB Output is correct
3 Correct 513 ms 76612 KB Output is correct
4 Correct 337 ms 69736 KB Output is correct
5 Correct 339 ms 69612 KB Output is correct
6 Correct 464 ms 76228 KB Output is correct
7 Correct 246 ms 72764 KB Output is correct
8 Correct 256 ms 71996 KB Output is correct
9 Correct 540 ms 76704 KB Output is correct
10 Correct 506 ms 76792 KB Output is correct
11 Correct 456 ms 76140 KB Output is correct
12 Correct 525 ms 76120 KB Output is correct
13 Correct 511 ms 76100 KB Output is correct
14 Correct 481 ms 76188 KB Output is correct
15 Correct 498 ms 76080 KB Output is correct
16 Correct 484 ms 76124 KB Output is correct
17 Correct 498 ms 76184 KB Output is correct
18 Correct 480 ms 76176 KB Output is correct
19 Correct 472 ms 76144 KB Output is correct
20 Correct 486 ms 76180 KB Output is correct
21 Correct 487 ms 76112 KB Output is correct
22 Correct 491 ms 76088 KB Output is correct
23 Correct 503 ms 76208 KB Output is correct
24 Correct 482 ms 76072 KB Output is correct
25 Correct 462 ms 73768 KB Output is correct
26 Correct 454 ms 74312 KB Output is correct
27 Correct 361 ms 74496 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 21 ms 51284 KB Output is correct
2 Correct 21 ms 51420 KB Output is correct
3 Correct 21 ms 51268 KB Output is correct
4 Correct 27 ms 51372 KB Output is correct
5 Correct 21 ms 51352 KB Output is correct
6 Correct 26 ms 51268 KB Output is correct
7 Correct 30 ms 51384 KB Output is correct
8 Correct 28 ms 51280 KB Output is correct
9 Correct 26 ms 51412 KB Output is correct
10 Correct 26 ms 51348 KB Output is correct
11 Correct 22 ms 51316 KB Output is correct
12 Correct 28 ms 51324 KB Output is correct
13 Correct 21 ms 51372 KB Output is correct
14 Correct 22 ms 51284 KB Output is correct
15 Correct 21 ms 51312 KB Output is correct
16 Correct 22 ms 51412 KB Output is correct
17 Correct 25 ms 51316 KB Output is correct
18 Correct 26 ms 51380 KB Output is correct
19 Correct 21 ms 51388 KB Output is correct
20 Correct 25 ms 51292 KB Output is correct
21 Correct 102 ms 57768 KB Output is correct
22 Correct 108 ms 57672 KB Output is correct
23 Correct 118 ms 57776 KB Output is correct
24 Correct 113 ms 57784 KB Output is correct
25 Correct 109 ms 57660 KB Output is correct
26 Correct 101 ms 57676 KB Output is correct
27 Correct 68 ms 56696 KB Output is correct
28 Correct 79 ms 56828 KB Output is correct
29 Correct 127 ms 57816 KB Output is correct
30 Correct 103 ms 57696 KB Output is correct
31 Correct 128 ms 57712 KB Output is correct
32 Correct 108 ms 57696 KB Output is correct
33 Correct 98 ms 56932 KB Output is correct
34 Correct 100 ms 57724 KB Output is correct
35 Correct 89 ms 57216 KB Output is correct
36 Correct 92 ms 57604 KB Output is correct
37 Correct 104 ms 57084 KB Output is correct
38 Correct 93 ms 56428 KB Output is correct
39 Correct 81 ms 55808 KB Output is correct
40 Correct 67 ms 56572 KB Output is correct
41 Correct 103 ms 57676 KB Output is correct
42 Correct 100 ms 57732 KB Output is correct
43 Correct 131 ms 57724 KB Output is correct
44 Correct 123 ms 57676 KB Output is correct
45 Correct 103 ms 57728 KB Output is correct
46 Correct 107 ms 57672 KB Output is correct
47 Correct 80 ms 56912 KB Output is correct
48 Correct 102 ms 57228 KB Output is correct
49 Correct 82 ms 55764 KB Output is correct
50 Correct 116 ms 56752 KB Output is correct
51 Correct 109 ms 57608 KB Output is correct
52 Correct 103 ms 57644 KB Output is correct
53 Correct 76 ms 56176 KB Output is correct
54 Correct 112 ms 57780 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 120 ms 57276 KB Output is correct
2 Correct 126 ms 57800 KB Output is correct
3 Correct 138 ms 57964 KB Output is correct
4 Correct 89 ms 55988 KB Output is correct
5 Correct 121 ms 57068 KB Output is correct
6 Correct 150 ms 57916 KB Output is correct
7 Correct 97 ms 56088 KB Output is correct
8 Correct 82 ms 55784 KB Output is correct
9 Correct 107 ms 57112 KB Output is correct
10 Correct 87 ms 55496 KB Output is correct
11 Correct 111 ms 57268 KB Output is correct
12 Correct 113 ms 57268 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 21 ms 51284 KB Output is correct
2 Correct 21 ms 51420 KB Output is correct
3 Correct 21 ms 51268 KB Output is correct
4 Correct 27 ms 51372 KB Output is correct
5 Correct 21 ms 51352 KB Output is correct
6 Correct 26 ms 51268 KB Output is correct
7 Correct 30 ms 51384 KB Output is correct
8 Correct 28 ms 51280 KB Output is correct
9 Correct 26 ms 51412 KB Output is correct
10 Correct 26 ms 51348 KB Output is correct
11 Correct 22 ms 51316 KB Output is correct
12 Correct 28 ms 51324 KB Output is correct
13 Correct 21 ms 51372 KB Output is correct
14 Correct 22 ms 51284 KB Output is correct
15 Correct 21 ms 51312 KB Output is correct
16 Correct 22 ms 51412 KB Output is correct
17 Correct 25 ms 51316 KB Output is correct
18 Correct 26 ms 51380 KB Output is correct
19 Correct 21 ms 51388 KB Output is correct
20 Correct 25 ms 51292 KB Output is correct
21 Correct 21 ms 51328 KB Output is correct
22 Correct 21 ms 51332 KB Output is correct
23 Correct 23 ms 51400 KB Output is correct
24 Correct 25 ms 51416 KB Output is correct
25 Correct 24 ms 51312 KB Output is correct
26 Correct 21 ms 51336 KB Output is correct
27 Correct 28 ms 51324 KB Output is correct
28 Correct 21 ms 51336 KB Output is correct
29 Correct 21 ms 51412 KB Output is correct
30 Correct 24 ms 51336 KB Output is correct
31 Correct 21 ms 51352 KB Output is correct
32 Correct 21 ms 51420 KB Output is correct
33 Correct 21 ms 51300 KB Output is correct
34 Correct 25 ms 51384 KB Output is correct
35 Correct 28 ms 51320 KB Output is correct
36 Correct 22 ms 51400 KB Output is correct
37 Correct 24 ms 51284 KB Output is correct
38 Correct 23 ms 51308 KB Output is correct
39 Correct 102 ms 57768 KB Output is correct
40 Correct 108 ms 57672 KB Output is correct
41 Correct 118 ms 57776 KB Output is correct
42 Correct 113 ms 57784 KB Output is correct
43 Correct 109 ms 57660 KB Output is correct
44 Correct 101 ms 57676 KB Output is correct
45 Correct 68 ms 56696 KB Output is correct
46 Correct 79 ms 56828 KB Output is correct
47 Correct 127 ms 57816 KB Output is correct
48 Correct 103 ms 57696 KB Output is correct
49 Correct 128 ms 57712 KB Output is correct
50 Correct 108 ms 57696 KB Output is correct
51 Correct 98 ms 56932 KB Output is correct
52 Correct 100 ms 57724 KB Output is correct
53 Correct 89 ms 57216 KB Output is correct
54 Correct 92 ms 57604 KB Output is correct
55 Correct 104 ms 57084 KB Output is correct
56 Correct 93 ms 56428 KB Output is correct
57 Correct 81 ms 55808 KB Output is correct
58 Correct 67 ms 56572 KB Output is correct
59 Correct 103 ms 57676 KB Output is correct
60 Correct 100 ms 57732 KB Output is correct
61 Correct 131 ms 57724 KB Output is correct
62 Correct 123 ms 57676 KB Output is correct
63 Correct 103 ms 57728 KB Output is correct
64 Correct 107 ms 57672 KB Output is correct
65 Correct 80 ms 56912 KB Output is correct
66 Correct 102 ms 57228 KB Output is correct
67 Correct 82 ms 55764 KB Output is correct
68 Correct 116 ms 56752 KB Output is correct
69 Correct 109 ms 57608 KB Output is correct
70 Correct 103 ms 57644 KB Output is correct
71 Correct 76 ms 56176 KB Output is correct
72 Correct 112 ms 57780 KB Output is correct
73 Correct 120 ms 57276 KB Output is correct
74 Correct 126 ms 57800 KB Output is correct
75 Correct 138 ms 57964 KB Output is correct
76 Correct 89 ms 55988 KB Output is correct
77 Correct 121 ms 57068 KB Output is correct
78 Correct 150 ms 57916 KB Output is correct
79 Correct 97 ms 56088 KB Output is correct
80 Correct 82 ms 55784 KB Output is correct
81 Correct 107 ms 57112 KB Output is correct
82 Correct 87 ms 55496 KB Output is correct
83 Correct 111 ms 57268 KB Output is correct
84 Correct 113 ms 57268 KB Output is correct
85 Correct 105 ms 57100 KB Output is correct
86 Correct 144 ms 57876 KB Output is correct
87 Correct 96 ms 56908 KB Output is correct
88 Correct 127 ms 57724 KB Output is correct
89 Correct 75 ms 55680 KB Output is correct
90 Correct 127 ms 57760 KB Output is correct
91 Correct 89 ms 56444 KB Output is correct
92 Correct 107 ms 56216 KB Output is correct
93 Correct 117 ms 57708 KB Output is correct
94 Correct 115 ms 57808 KB Output is correct
95 Correct 103 ms 57568 KB Output is correct
96 Correct 109 ms 57720 KB Output is correct
97 Correct 113 ms 57652 KB Output is correct
98 Correct 102 ms 56680 KB Output is correct
99 Correct 98 ms 56940 KB Output is correct
100 Correct 94 ms 56228 KB Output is correct
101 Correct 109 ms 57172 KB Output is correct
102 Correct 102 ms 57208 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 21 ms 51284 KB Output is correct
2 Correct 21 ms 51420 KB Output is correct
3 Correct 21 ms 51268 KB Output is correct
4 Correct 27 ms 51372 KB Output is correct
5 Correct 21 ms 51352 KB Output is correct
6 Correct 26 ms 51268 KB Output is correct
7 Correct 30 ms 51384 KB Output is correct
8 Correct 28 ms 51280 KB Output is correct
9 Correct 26 ms 51412 KB Output is correct
10 Correct 26 ms 51348 KB Output is correct
11 Correct 22 ms 51316 KB Output is correct
12 Correct 28 ms 51324 KB Output is correct
13 Correct 21 ms 51372 KB Output is correct
14 Correct 22 ms 51284 KB Output is correct
15 Correct 21 ms 51312 KB Output is correct
16 Correct 22 ms 51412 KB Output is correct
17 Correct 25 ms 51316 KB Output is correct
18 Correct 26 ms 51380 KB Output is correct
19 Correct 21 ms 51388 KB Output is correct
20 Correct 25 ms 51292 KB Output is correct
21 Correct 21 ms 51328 KB Output is correct
22 Correct 21 ms 51332 KB Output is correct
23 Correct 23 ms 51400 KB Output is correct
24 Correct 25 ms 51416 KB Output is correct
25 Correct 24 ms 51312 KB Output is correct
26 Correct 21 ms 51336 KB Output is correct
27 Correct 28 ms 51324 KB Output is correct
28 Correct 21 ms 51336 KB Output is correct
29 Correct 21 ms 51412 KB Output is correct
30 Correct 24 ms 51336 KB Output is correct
31 Correct 21 ms 51352 KB Output is correct
32 Correct 21 ms 51420 KB Output is correct
33 Correct 21 ms 51300 KB Output is correct
34 Correct 25 ms 51384 KB Output is correct
35 Correct 28 ms 51320 KB Output is correct
36 Correct 22 ms 51400 KB Output is correct
37 Correct 24 ms 51284 KB Output is correct
38 Correct 23 ms 51308 KB Output is correct
39 Correct 102 ms 57768 KB Output is correct
40 Correct 108 ms 57672 KB Output is correct
41 Correct 118 ms 57776 KB Output is correct
42 Correct 113 ms 57784 KB Output is correct
43 Correct 109 ms 57660 KB Output is correct
44 Correct 101 ms 57676 KB Output is correct
45 Correct 68 ms 56696 KB Output is correct
46 Correct 79 ms 56828 KB Output is correct
47 Correct 127 ms 57816 KB Output is correct
48 Correct 103 ms 57696 KB Output is correct
49 Correct 128 ms 57712 KB Output is correct
50 Correct 108 ms 57696 KB Output is correct
51 Correct 98 ms 56932 KB Output is correct
52 Correct 100 ms 57724 KB Output is correct
53 Correct 89 ms 57216 KB Output is correct
54 Correct 92 ms 57604 KB Output is correct
55 Correct 478 ms 74408 KB Output is correct
56 Correct 388 ms 69896 KB Output is correct
57 Correct 513 ms 76612 KB Output is correct
58 Correct 337 ms 69736 KB Output is correct
59 Correct 339 ms 69612 KB Output is correct
60 Correct 464 ms 76228 KB Output is correct
61 Correct 246 ms 72764 KB Output is correct
62 Correct 256 ms 71996 KB Output is correct
63 Correct 540 ms 76704 KB Output is correct
64 Correct 506 ms 76792 KB Output is correct
65 Correct 456 ms 76140 KB Output is correct
66 Correct 525 ms 76120 KB Output is correct
67 Correct 511 ms 76100 KB Output is correct
68 Correct 481 ms 76188 KB Output is correct
69 Correct 498 ms 76080 KB Output is correct
70 Correct 484 ms 76124 KB Output is correct
71 Correct 498 ms 76184 KB Output is correct
72 Correct 480 ms 76176 KB Output is correct
73 Correct 472 ms 76144 KB Output is correct
74 Correct 486 ms 76180 KB Output is correct
75 Correct 487 ms 76112 KB Output is correct
76 Correct 491 ms 76088 KB Output is correct
77 Correct 503 ms 76208 KB Output is correct
78 Correct 482 ms 76072 KB Output is correct
79 Correct 462 ms 73768 KB Output is correct
80 Correct 454 ms 74312 KB Output is correct
81 Correct 361 ms 74496 KB Output is correct
82 Correct 104 ms 57084 KB Output is correct
83 Correct 93 ms 56428 KB Output is correct
84 Correct 81 ms 55808 KB Output is correct
85 Correct 67 ms 56572 KB Output is correct
86 Correct 103 ms 57676 KB Output is correct
87 Correct 100 ms 57732 KB Output is correct
88 Correct 131 ms 57724 KB Output is correct
89 Correct 123 ms 57676 KB Output is correct
90 Correct 103 ms 57728 KB Output is correct
91 Correct 107 ms 57672 KB Output is correct
92 Correct 80 ms 56912 KB Output is correct
93 Correct 102 ms 57228 KB Output is correct
94 Correct 82 ms 55764 KB Output is correct
95 Correct 116 ms 56752 KB Output is correct
96 Correct 109 ms 57608 KB Output is correct
97 Correct 103 ms 57644 KB Output is correct
98 Correct 76 ms 56176 KB Output is correct
99 Correct 112 ms 57780 KB Output is correct
100 Correct 120 ms 57276 KB Output is correct
101 Correct 126 ms 57800 KB Output is correct
102 Correct 138 ms 57964 KB Output is correct
103 Correct 89 ms 55988 KB Output is correct
104 Correct 121 ms 57068 KB Output is correct
105 Correct 150 ms 57916 KB Output is correct
106 Correct 97 ms 56088 KB Output is correct
107 Correct 82 ms 55784 KB Output is correct
108 Correct 107 ms 57112 KB Output is correct
109 Correct 87 ms 55496 KB Output is correct
110 Correct 111 ms 57268 KB Output is correct
111 Correct 113 ms 57268 KB Output is correct
112 Correct 105 ms 57100 KB Output is correct
113 Correct 144 ms 57876 KB Output is correct
114 Correct 96 ms 56908 KB Output is correct
115 Correct 127 ms 57724 KB Output is correct
116 Correct 75 ms 55680 KB Output is correct
117 Correct 127 ms 57760 KB Output is correct
118 Correct 89 ms 56444 KB Output is correct
119 Correct 107 ms 56216 KB Output is correct
120 Correct 117 ms 57708 KB Output is correct
121 Correct 115 ms 57808 KB Output is correct
122 Correct 103 ms 57568 KB Output is correct
123 Correct 109 ms 57720 KB Output is correct
124 Correct 113 ms 57652 KB Output is correct
125 Correct 102 ms 56680 KB Output is correct
126 Correct 98 ms 56940 KB Output is correct
127 Correct 94 ms 56228 KB Output is correct
128 Correct 109 ms 57172 KB Output is correct
129 Correct 102 ms 57208 KB Output is correct
130 Correct 554 ms 76708 KB Output is correct
131 Correct 390 ms 69836 KB Output is correct
132 Correct 519 ms 76836 KB Output is correct
133 Correct 466 ms 75208 KB Output is correct
134 Correct 410 ms 72836 KB Output is correct
135 Correct 527 ms 76396 KB Output is correct
136 Correct 516 ms 77148 KB Output is correct
137 Correct 544 ms 77356 KB Output is correct
138 Correct 492 ms 76396 KB Output is correct
139 Correct 476 ms 76396 KB Output is correct
140 Correct 524 ms 76288 KB Output is correct
141 Correct 521 ms 76296 KB Output is correct
142 Correct 498 ms 76396 KB Output is correct
143 Correct 516 ms 76340 KB Output is correct
144 Correct 508 ms 76396 KB Output is correct
145 Correct 513 ms 76348 KB Output is correct
146 Correct 542 ms 76308 KB Output is correct
147 Correct 519 ms 76352 KB Output is correct
148 Correct 560 ms 76356 KB Output is correct
149 Correct 534 ms 76408 KB Output is correct
150 Correct 299 ms 73320 KB Output is correct
151 Correct 449 ms 74640 KB Output is correct
152 Correct 464 ms 74564 KB Output is correct
153 Correct 363 ms 74604 KB Output is correct