답안 #723452

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
723452 2023-04-13T20:11:37 Z sysia 푸드 코트 (JOI21_foodcourt) C++17
100 / 100
783 ms 48308 KB
//Sylwia Sapkowska
#include <bits/stdc++.h>
#pragma GCC optimize("O3", "unroll-loops")
using namespace std;

void __print(int x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << "'" << x << "'";}
void __print(const char *x) {cerr << '"' << x << '"';}
void __print(const string &x) {cerr << '"' << x << '"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ", "; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? ", " : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifdef LOCAL
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

#define int long long
typedef pair<int, int> T;
const int oo = 1e18;

struct TreeSum{
    vector<int>tab;
    int size = 1;

    TreeSum(int n){
        while (size < n) size*=2;
        tab.assign(2*size, 0);
    }

    void update(int l, int r, int v){
        for (l += size-1, r += size+1; r-l>1; l/=2, r/=2){
            if (!(l&1)) tab[l+1] += v;
            if (r&1) tab[r-1] += v;
        }
    }

    void clear(){
        tab.assign(2*size, 0);
    }

    int query(int x){
        x += size;
        int ans = 0;
        while (x){
            ans += tab[x];
            x/=2;
        }
        return ans;
    }
};

struct Tree{
    vector<int>tab, lazy;
    int size = 1;

    Tree(int n){
        while (size < n) size*=2;
        tab.assign(2*size, 0);
        lazy.assign(2*size, 0);
    }

    void apply(int x, int a, int c){
        tab[x] = max(tab[x] + a, c);
        lazy[x] += a;
    }

    void push(int x){
        apply(2*x, lazy[x], tab[x]);
        apply(2*x+1, lazy[x], tab[x]);
        lazy[x] = 0;
        tab[x] = -oo;
    }

    int query(int x, int lx, int rx, int pos){
        if (lx == rx) return tab[x];
        push(x);
        int m = (lx+rx)/2;
        if (pos <= m) return query(2*x, lx, m, pos);
        return query(2*x+1, m+1, rx, pos);
    }

    void update(int x, int lx, int rx, int l, int r, int v){
        if (lx > r || rx < l) return;
        if (lx >= l && rx <= r) {
            apply(x, v, -oo);
            return;
        }
        if (lx != rx) push(x);
        int m = (lx+rx)/2;
        update(2*x, lx, m, l, r, v);
        update(2*x+1, m+1, rx, l, r, v);
    }
};

struct TreeMin{
    vector<T>tab;
    vector<int>lazy;
    int size = 1;

    TreeMin(int n){
        while (size < n) size*=2;
        tab.assign(2*size, {oo, oo});
        lazy.assign(2*size, 0);
    }
    
    void set(int x, int lx, int rx, int pos, T val){
        if (lx == rx) {
            tab[x] = val;
            return;
        }
        push(x);
        int m = (lx+rx)/2;
        if (pos <= m) set(2*x, lx, m, pos, val);
        else set(2*x+1, m+1, rx, pos, val);
        tab[x] = min(tab[2*x], tab[2*x+1]);
    }

    void push(int x){
        for (auto k: {2*x, 2*x+1}){
            tab[k].first += lazy[x];
            lazy[k] += lazy[x];
        }
        lazy[x] = 0;
    }

    T query(int x, int lx, int rx, int l, int r){
        if (lx != rx) push(x);
        if (lx > r || rx < l) return {oo, oo};
        if (lx >= l && rx <= r) return tab[x];
        int m = (lx+rx)/2;
        return min(query(2*x, lx, m, l, r), query(2*x+1, m+1, rx, l, r));
    }

    void update(int x, int lx, int rx, int l, int r, int v){
        if (lx != rx) push(x);
        if (lx > r || rx < l) return;
        if (lx >= l && rx <= r){
            tab[x].first += v;
            lazy[x] += v;
            return;
        }
        int m = (lx+rx)/2;
        update(2*x, lx, m, l, r, v);
        update(2*x+1, m+1, rx, l, r, v);
        tab[x] = min(tab[2*x], tab[2*x+1]);
    }
};

void solve(){
    int n, m, q; cin >> n >> m >> q;
    Tree t(n+2);
    TreeSum sum(n+2);
    TreeMin tt(n+2);
    vector<vector<T>>sweep(n+1);
    vector<tuple<int, int, int, int, int>>groups;
    vector<int>ans(q+1, -1), ptr(n+1);
    for (int i = 0; i<q; i++){
        int type; cin >> type;
        if (type == 1){
            int l, r, c, k; cin >> l >> r >> c >> k;
            t.update(1, 0, t.size-1, l, r, +k);
            t.apply(1, 0, 0);
            sum.update(l, r, +k);
            groups.emplace_back(i, l, r, c, k);
        } 
        if (type == 2){
            int l, r, k; cin >> l >> r >> k;
            t.update(1, 0, t.size-1, l, r, -k);
            t.apply(1, 0, 0);
        }
        if (type == 3){
            int a, b; cin >> a >> b;
            int present = max(0LL, t.query(1, 0, t.size-1, a));
            int all = sum.query(a);
            int deleted = all - present;
            int now = deleted + b;
            debug(all, present, deleted, now);
            if (b > present) {
                ans[i] = 0;
            } else {
                debug(now, i);
                sweep[a].emplace_back(now, i);
            }
        }
    }
    int ck = 0, last = -1;
    for (int i = 1; i<=n; i++){
        if (sweep[i].size()){
            sort(sweep[i].begin(), sweep[i].end());
            tt.set(1, 0, tt.size-1, i, {sweep[i][0].first, i});
        }
    }
    sum.clear();
    for (int rep = 0; rep<=q; rep++){
        if (ck < (int)groups.size() && get<0>(groups[ck]) <= rep){
            auto [ii, l, r, c, k] = groups[ck];
            sum.update(l, r, +k);
            tt.update(1, 0, tt.size-1, l, r, -k);
            last = c;
            ck++;
        }
        while (1){
            auto maybe = tt.query(1, 0, tt.size-1, 1, n);
            if (maybe.first > 0) break;
            int i = maybe.second;
            int idx = sweep[i][ptr[i]].second;
            ans[idx] = last;
            debug(idx, last);
            ptr[i]++;
            T now = {oo, oo};
            if (ptr[i] < (int)sweep[i].size()) now = {sweep[i][ptr[i]].first-sum.query(i), i};
            tt.set(1, 0, tt.size-1, i, now);
        }
    }
    for (int i = 0; i<q; i++){
        if (ans[i] != -1){
            cout << ans[i] << "\n";
        }
    }
}

int32_t main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    solve();

    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 596 KB Output is correct
2 Correct 4 ms 596 KB Output is correct
3 Correct 3 ms 592 KB Output is correct
4 Correct 4 ms 596 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 332 KB Output is correct
7 Correct 3 ms 656 KB Output is correct
8 Correct 4 ms 596 KB Output is correct
9 Correct 3 ms 596 KB Output is correct
10 Correct 3 ms 596 KB Output is correct
11 Correct 5 ms 596 KB Output is correct
12 Correct 3 ms 596 KB Output is correct
13 Correct 2 ms 596 KB Output is correct
14 Correct 4 ms 588 KB Output is correct
15 Correct 3 ms 620 KB Output is correct
16 Correct 4 ms 724 KB Output is correct
17 Correct 4 ms 636 KB Output is correct
18 Correct 3 ms 596 KB Output is correct
19 Correct 3 ms 724 KB Output is correct
20 Correct 3 ms 724 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 596 KB Output is correct
2 Correct 4 ms 596 KB Output is correct
3 Correct 3 ms 592 KB Output is correct
4 Correct 4 ms 596 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 332 KB Output is correct
7 Correct 3 ms 656 KB Output is correct
8 Correct 4 ms 596 KB Output is correct
9 Correct 3 ms 596 KB Output is correct
10 Correct 3 ms 596 KB Output is correct
11 Correct 5 ms 596 KB Output is correct
12 Correct 3 ms 596 KB Output is correct
13 Correct 2 ms 596 KB Output is correct
14 Correct 4 ms 588 KB Output is correct
15 Correct 3 ms 620 KB Output is correct
16 Correct 4 ms 724 KB Output is correct
17 Correct 4 ms 636 KB Output is correct
18 Correct 3 ms 596 KB Output is correct
19 Correct 3 ms 724 KB Output is correct
20 Correct 3 ms 724 KB Output is correct
21 Correct 4 ms 596 KB Output is correct
22 Correct 3 ms 596 KB Output is correct
23 Correct 4 ms 596 KB Output is correct
24 Correct 4 ms 724 KB Output is correct
25 Correct 1 ms 392 KB Output is correct
26 Correct 1 ms 328 KB Output is correct
27 Correct 4 ms 596 KB Output is correct
28 Correct 4 ms 596 KB Output is correct
29 Correct 4 ms 596 KB Output is correct
30 Correct 4 ms 596 KB Output is correct
31 Correct 4 ms 596 KB Output is correct
32 Correct 5 ms 588 KB Output is correct
33 Correct 3 ms 632 KB Output is correct
34 Correct 3 ms 596 KB Output is correct
35 Correct 3 ms 596 KB Output is correct
36 Correct 3 ms 588 KB Output is correct
37 Correct 3 ms 720 KB Output is correct
38 Correct 3 ms 716 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 102 ms 10968 KB Output is correct
2 Correct 105 ms 11660 KB Output is correct
3 Correct 113 ms 11512 KB Output is correct
4 Correct 101 ms 11552 KB Output is correct
5 Correct 110 ms 11660 KB Output is correct
6 Correct 124 ms 11748 KB Output is correct
7 Correct 23 ms 2908 KB Output is correct
8 Correct 20 ms 3048 KB Output is correct
9 Correct 99 ms 11472 KB Output is correct
10 Correct 100 ms 11332 KB Output is correct
11 Correct 106 ms 11380 KB Output is correct
12 Correct 112 ms 11380 KB Output is correct
13 Correct 98 ms 10692 KB Output is correct
14 Correct 118 ms 12776 KB Output is correct
15 Correct 121 ms 11984 KB Output is correct
16 Correct 128 ms 12680 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 598 ms 41140 KB Output is correct
2 Correct 457 ms 40444 KB Output is correct
3 Correct 630 ms 45664 KB Output is correct
4 Correct 549 ms 43408 KB Output is correct
5 Correct 571 ms 41580 KB Output is correct
6 Correct 736 ms 46400 KB Output is correct
7 Correct 90 ms 12528 KB Output is correct
8 Correct 95 ms 12172 KB Output is correct
9 Correct 741 ms 47528 KB Output is correct
10 Correct 782 ms 47480 KB Output is correct
11 Correct 620 ms 45148 KB Output is correct
12 Correct 656 ms 45056 KB Output is correct
13 Correct 686 ms 45164 KB Output is correct
14 Correct 721 ms 45088 KB Output is correct
15 Correct 683 ms 45140 KB Output is correct
16 Correct 689 ms 45120 KB Output is correct
17 Correct 659 ms 45136 KB Output is correct
18 Correct 641 ms 45136 KB Output is correct
19 Correct 641 ms 45052 KB Output is correct
20 Correct 658 ms 45216 KB Output is correct
21 Correct 643 ms 45136 KB Output is correct
22 Correct 655 ms 44928 KB Output is correct
23 Correct 671 ms 44952 KB Output is correct
24 Correct 696 ms 44828 KB Output is correct
25 Correct 563 ms 43904 KB Output is correct
26 Correct 562 ms 45020 KB Output is correct
27 Correct 515 ms 48308 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 596 KB Output is correct
2 Correct 4 ms 596 KB Output is correct
3 Correct 3 ms 592 KB Output is correct
4 Correct 4 ms 596 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 332 KB Output is correct
7 Correct 3 ms 656 KB Output is correct
8 Correct 4 ms 596 KB Output is correct
9 Correct 3 ms 596 KB Output is correct
10 Correct 3 ms 596 KB Output is correct
11 Correct 5 ms 596 KB Output is correct
12 Correct 3 ms 596 KB Output is correct
13 Correct 2 ms 596 KB Output is correct
14 Correct 4 ms 588 KB Output is correct
15 Correct 3 ms 620 KB Output is correct
16 Correct 4 ms 724 KB Output is correct
17 Correct 4 ms 636 KB Output is correct
18 Correct 3 ms 596 KB Output is correct
19 Correct 3 ms 724 KB Output is correct
20 Correct 3 ms 724 KB Output is correct
21 Correct 102 ms 10968 KB Output is correct
22 Correct 105 ms 11660 KB Output is correct
23 Correct 113 ms 11512 KB Output is correct
24 Correct 101 ms 11552 KB Output is correct
25 Correct 110 ms 11660 KB Output is correct
26 Correct 124 ms 11748 KB Output is correct
27 Correct 23 ms 2908 KB Output is correct
28 Correct 20 ms 3048 KB Output is correct
29 Correct 99 ms 11472 KB Output is correct
30 Correct 100 ms 11332 KB Output is correct
31 Correct 106 ms 11380 KB Output is correct
32 Correct 112 ms 11380 KB Output is correct
33 Correct 98 ms 10692 KB Output is correct
34 Correct 118 ms 12776 KB Output is correct
35 Correct 121 ms 11984 KB Output is correct
36 Correct 128 ms 12680 KB Output is correct
37 Correct 140 ms 11312 KB Output is correct
38 Correct 117 ms 10928 KB Output is correct
39 Correct 19 ms 2756 KB Output is correct
40 Correct 20 ms 2924 KB Output is correct
41 Correct 144 ms 11412 KB Output is correct
42 Correct 150 ms 11472 KB Output is correct
43 Correct 140 ms 11376 KB Output is correct
44 Correct 138 ms 11408 KB Output is correct
45 Correct 137 ms 11456 KB Output is correct
46 Correct 142 ms 11384 KB Output is correct
47 Correct 131 ms 11436 KB Output is correct
48 Correct 126 ms 11432 KB Output is correct
49 Correct 102 ms 10372 KB Output is correct
50 Correct 114 ms 11356 KB Output is correct
51 Correct 145 ms 11388 KB Output is correct
52 Correct 147 ms 11420 KB Output is correct
53 Correct 100 ms 12348 KB Output is correct
54 Correct 123 ms 12672 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 144 ms 11164 KB Output is correct
2 Correct 168 ms 11232 KB Output is correct
3 Correct 179 ms 11624 KB Output is correct
4 Correct 122 ms 10852 KB Output is correct
5 Correct 147 ms 11228 KB Output is correct
6 Correct 162 ms 11616 KB Output is correct
7 Correct 26 ms 3300 KB Output is correct
8 Correct 25 ms 3080 KB Output is correct
9 Correct 152 ms 11564 KB Output is correct
10 Correct 108 ms 10724 KB Output is correct
11 Correct 156 ms 11640 KB Output is correct
12 Correct 155 ms 11544 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 596 KB Output is correct
2 Correct 4 ms 596 KB Output is correct
3 Correct 3 ms 592 KB Output is correct
4 Correct 4 ms 596 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 332 KB Output is correct
7 Correct 3 ms 656 KB Output is correct
8 Correct 4 ms 596 KB Output is correct
9 Correct 3 ms 596 KB Output is correct
10 Correct 3 ms 596 KB Output is correct
11 Correct 5 ms 596 KB Output is correct
12 Correct 3 ms 596 KB Output is correct
13 Correct 2 ms 596 KB Output is correct
14 Correct 4 ms 588 KB Output is correct
15 Correct 3 ms 620 KB Output is correct
16 Correct 4 ms 724 KB Output is correct
17 Correct 4 ms 636 KB Output is correct
18 Correct 3 ms 596 KB Output is correct
19 Correct 3 ms 724 KB Output is correct
20 Correct 3 ms 724 KB Output is correct
21 Correct 4 ms 596 KB Output is correct
22 Correct 3 ms 596 KB Output is correct
23 Correct 4 ms 596 KB Output is correct
24 Correct 4 ms 724 KB Output is correct
25 Correct 1 ms 392 KB Output is correct
26 Correct 1 ms 328 KB Output is correct
27 Correct 4 ms 596 KB Output is correct
28 Correct 4 ms 596 KB Output is correct
29 Correct 4 ms 596 KB Output is correct
30 Correct 4 ms 596 KB Output is correct
31 Correct 4 ms 596 KB Output is correct
32 Correct 5 ms 588 KB Output is correct
33 Correct 3 ms 632 KB Output is correct
34 Correct 3 ms 596 KB Output is correct
35 Correct 3 ms 596 KB Output is correct
36 Correct 3 ms 588 KB Output is correct
37 Correct 3 ms 720 KB Output is correct
38 Correct 3 ms 716 KB Output is correct
39 Correct 102 ms 10968 KB Output is correct
40 Correct 105 ms 11660 KB Output is correct
41 Correct 113 ms 11512 KB Output is correct
42 Correct 101 ms 11552 KB Output is correct
43 Correct 110 ms 11660 KB Output is correct
44 Correct 124 ms 11748 KB Output is correct
45 Correct 23 ms 2908 KB Output is correct
46 Correct 20 ms 3048 KB Output is correct
47 Correct 99 ms 11472 KB Output is correct
48 Correct 100 ms 11332 KB Output is correct
49 Correct 106 ms 11380 KB Output is correct
50 Correct 112 ms 11380 KB Output is correct
51 Correct 98 ms 10692 KB Output is correct
52 Correct 118 ms 12776 KB Output is correct
53 Correct 121 ms 11984 KB Output is correct
54 Correct 128 ms 12680 KB Output is correct
55 Correct 140 ms 11312 KB Output is correct
56 Correct 117 ms 10928 KB Output is correct
57 Correct 19 ms 2756 KB Output is correct
58 Correct 20 ms 2924 KB Output is correct
59 Correct 144 ms 11412 KB Output is correct
60 Correct 150 ms 11472 KB Output is correct
61 Correct 140 ms 11376 KB Output is correct
62 Correct 138 ms 11408 KB Output is correct
63 Correct 137 ms 11456 KB Output is correct
64 Correct 142 ms 11384 KB Output is correct
65 Correct 131 ms 11436 KB Output is correct
66 Correct 126 ms 11432 KB Output is correct
67 Correct 102 ms 10372 KB Output is correct
68 Correct 114 ms 11356 KB Output is correct
69 Correct 145 ms 11388 KB Output is correct
70 Correct 147 ms 11420 KB Output is correct
71 Correct 100 ms 12348 KB Output is correct
72 Correct 123 ms 12672 KB Output is correct
73 Correct 144 ms 11164 KB Output is correct
74 Correct 168 ms 11232 KB Output is correct
75 Correct 179 ms 11624 KB Output is correct
76 Correct 122 ms 10852 KB Output is correct
77 Correct 147 ms 11228 KB Output is correct
78 Correct 162 ms 11616 KB Output is correct
79 Correct 26 ms 3300 KB Output is correct
80 Correct 25 ms 3080 KB Output is correct
81 Correct 152 ms 11564 KB Output is correct
82 Correct 108 ms 10724 KB Output is correct
83 Correct 156 ms 11640 KB Output is correct
84 Correct 155 ms 11544 KB Output is correct
85 Correct 141 ms 11452 KB Output is correct
86 Correct 148 ms 11976 KB Output is correct
87 Correct 134 ms 11648 KB Output is correct
88 Correct 152 ms 12316 KB Output is correct
89 Correct 90 ms 10332 KB Output is correct
90 Correct 149 ms 11976 KB Output is correct
91 Correct 119 ms 10964 KB Output is correct
92 Correct 106 ms 11016 KB Output is correct
93 Correct 145 ms 11904 KB Output is correct
94 Correct 147 ms 11960 KB Output is correct
95 Correct 138 ms 11740 KB Output is correct
96 Correct 141 ms 12072 KB Output is correct
97 Correct 138 ms 11896 KB Output is correct
98 Correct 138 ms 11104 KB Output is correct
99 Correct 132 ms 11924 KB Output is correct
100 Correct 110 ms 11436 KB Output is correct
101 Correct 135 ms 11864 KB Output is correct
102 Correct 121 ms 12764 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 596 KB Output is correct
2 Correct 4 ms 596 KB Output is correct
3 Correct 3 ms 592 KB Output is correct
4 Correct 4 ms 596 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 332 KB Output is correct
7 Correct 3 ms 656 KB Output is correct
8 Correct 4 ms 596 KB Output is correct
9 Correct 3 ms 596 KB Output is correct
10 Correct 3 ms 596 KB Output is correct
11 Correct 5 ms 596 KB Output is correct
12 Correct 3 ms 596 KB Output is correct
13 Correct 2 ms 596 KB Output is correct
14 Correct 4 ms 588 KB Output is correct
15 Correct 3 ms 620 KB Output is correct
16 Correct 4 ms 724 KB Output is correct
17 Correct 4 ms 636 KB Output is correct
18 Correct 3 ms 596 KB Output is correct
19 Correct 3 ms 724 KB Output is correct
20 Correct 3 ms 724 KB Output is correct
21 Correct 4 ms 596 KB Output is correct
22 Correct 3 ms 596 KB Output is correct
23 Correct 4 ms 596 KB Output is correct
24 Correct 4 ms 724 KB Output is correct
25 Correct 1 ms 392 KB Output is correct
26 Correct 1 ms 328 KB Output is correct
27 Correct 4 ms 596 KB Output is correct
28 Correct 4 ms 596 KB Output is correct
29 Correct 4 ms 596 KB Output is correct
30 Correct 4 ms 596 KB Output is correct
31 Correct 4 ms 596 KB Output is correct
32 Correct 5 ms 588 KB Output is correct
33 Correct 3 ms 632 KB Output is correct
34 Correct 3 ms 596 KB Output is correct
35 Correct 3 ms 596 KB Output is correct
36 Correct 3 ms 588 KB Output is correct
37 Correct 3 ms 720 KB Output is correct
38 Correct 3 ms 716 KB Output is correct
39 Correct 102 ms 10968 KB Output is correct
40 Correct 105 ms 11660 KB Output is correct
41 Correct 113 ms 11512 KB Output is correct
42 Correct 101 ms 11552 KB Output is correct
43 Correct 110 ms 11660 KB Output is correct
44 Correct 124 ms 11748 KB Output is correct
45 Correct 23 ms 2908 KB Output is correct
46 Correct 20 ms 3048 KB Output is correct
47 Correct 99 ms 11472 KB Output is correct
48 Correct 100 ms 11332 KB Output is correct
49 Correct 106 ms 11380 KB Output is correct
50 Correct 112 ms 11380 KB Output is correct
51 Correct 98 ms 10692 KB Output is correct
52 Correct 118 ms 12776 KB Output is correct
53 Correct 121 ms 11984 KB Output is correct
54 Correct 128 ms 12680 KB Output is correct
55 Correct 598 ms 41140 KB Output is correct
56 Correct 457 ms 40444 KB Output is correct
57 Correct 630 ms 45664 KB Output is correct
58 Correct 549 ms 43408 KB Output is correct
59 Correct 571 ms 41580 KB Output is correct
60 Correct 736 ms 46400 KB Output is correct
61 Correct 90 ms 12528 KB Output is correct
62 Correct 95 ms 12172 KB Output is correct
63 Correct 741 ms 47528 KB Output is correct
64 Correct 782 ms 47480 KB Output is correct
65 Correct 620 ms 45148 KB Output is correct
66 Correct 656 ms 45056 KB Output is correct
67 Correct 686 ms 45164 KB Output is correct
68 Correct 721 ms 45088 KB Output is correct
69 Correct 683 ms 45140 KB Output is correct
70 Correct 689 ms 45120 KB Output is correct
71 Correct 659 ms 45136 KB Output is correct
72 Correct 641 ms 45136 KB Output is correct
73 Correct 641 ms 45052 KB Output is correct
74 Correct 658 ms 45216 KB Output is correct
75 Correct 643 ms 45136 KB Output is correct
76 Correct 655 ms 44928 KB Output is correct
77 Correct 671 ms 44952 KB Output is correct
78 Correct 696 ms 44828 KB Output is correct
79 Correct 563 ms 43904 KB Output is correct
80 Correct 562 ms 45020 KB Output is correct
81 Correct 515 ms 48308 KB Output is correct
82 Correct 140 ms 11312 KB Output is correct
83 Correct 117 ms 10928 KB Output is correct
84 Correct 19 ms 2756 KB Output is correct
85 Correct 20 ms 2924 KB Output is correct
86 Correct 144 ms 11412 KB Output is correct
87 Correct 150 ms 11472 KB Output is correct
88 Correct 140 ms 11376 KB Output is correct
89 Correct 138 ms 11408 KB Output is correct
90 Correct 137 ms 11456 KB Output is correct
91 Correct 142 ms 11384 KB Output is correct
92 Correct 131 ms 11436 KB Output is correct
93 Correct 126 ms 11432 KB Output is correct
94 Correct 102 ms 10372 KB Output is correct
95 Correct 114 ms 11356 KB Output is correct
96 Correct 145 ms 11388 KB Output is correct
97 Correct 147 ms 11420 KB Output is correct
98 Correct 100 ms 12348 KB Output is correct
99 Correct 123 ms 12672 KB Output is correct
100 Correct 144 ms 11164 KB Output is correct
101 Correct 168 ms 11232 KB Output is correct
102 Correct 179 ms 11624 KB Output is correct
103 Correct 122 ms 10852 KB Output is correct
104 Correct 147 ms 11228 KB Output is correct
105 Correct 162 ms 11616 KB Output is correct
106 Correct 26 ms 3300 KB Output is correct
107 Correct 25 ms 3080 KB Output is correct
108 Correct 152 ms 11564 KB Output is correct
109 Correct 108 ms 10724 KB Output is correct
110 Correct 156 ms 11640 KB Output is correct
111 Correct 155 ms 11544 KB Output is correct
112 Correct 141 ms 11452 KB Output is correct
113 Correct 148 ms 11976 KB Output is correct
114 Correct 134 ms 11648 KB Output is correct
115 Correct 152 ms 12316 KB Output is correct
116 Correct 90 ms 10332 KB Output is correct
117 Correct 149 ms 11976 KB Output is correct
118 Correct 119 ms 10964 KB Output is correct
119 Correct 106 ms 11016 KB Output is correct
120 Correct 145 ms 11904 KB Output is correct
121 Correct 147 ms 11960 KB Output is correct
122 Correct 138 ms 11740 KB Output is correct
123 Correct 141 ms 12072 KB Output is correct
124 Correct 138 ms 11896 KB Output is correct
125 Correct 138 ms 11104 KB Output is correct
126 Correct 132 ms 11924 KB Output is correct
127 Correct 110 ms 11436 KB Output is correct
128 Correct 135 ms 11864 KB Output is correct
129 Correct 121 ms 12764 KB Output is correct
130 Correct 667 ms 44808 KB Output is correct
131 Correct 459 ms 40588 KB Output is correct
132 Correct 669 ms 44820 KB Output is correct
133 Correct 738 ms 45156 KB Output is correct
134 Correct 641 ms 44460 KB Output is correct
135 Correct 731 ms 45712 KB Output is correct
136 Correct 753 ms 46988 KB Output is correct
137 Correct 783 ms 46992 KB Output is correct
138 Correct 667 ms 44360 KB Output is correct
139 Correct 672 ms 44144 KB Output is correct
140 Correct 629 ms 44076 KB Output is correct
141 Correct 635 ms 43988 KB Output is correct
142 Correct 659 ms 44048 KB Output is correct
143 Correct 657 ms 43888 KB Output is correct
144 Correct 663 ms 43588 KB Output is correct
145 Correct 669 ms 43640 KB Output is correct
146 Correct 680 ms 43616 KB Output is correct
147 Correct 658 ms 43412 KB Output is correct
148 Correct 650 ms 44028 KB Output is correct
149 Correct 617 ms 44128 KB Output is correct
150 Correct 576 ms 43596 KB Output is correct
151 Correct 557 ms 44380 KB Output is correct
152 Correct 572 ms 44332 KB Output is correct
153 Correct 512 ms 47284 KB Output is correct