Submission #723450

# Submission time Handle Problem Language Result Execution time Memory
723450 2023-04-13T20:07:16 Z sysia Food Court (JOI21_foodcourt) C++17
100 / 100
846 ms 49200 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, oo2 = 1e9+7, K = 30;
const int mod = 998244353;

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;
            debug(lx, rx, v, tab[x]);
            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);
    vector<vector<T>>sweep(n+1);
    vector<tuple<int, int, int, int, int>>groups;
    vector<int>ans(q+1, -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);
            }
        }
    }
    vector<int>ptr(n+1);
    for (int i = 1; i<=n; i++) {
        sort(sweep[i].begin(), sweep[i].end());
    }
    int ck = 0;
    int last = -1;
    TreeMin tt(n+2);
    for (int i = 1; i<=n; i++){
        if (sweep[i].size()){
            tt.set(1, 0, tt.size-1, i, {sweep[i][0].first, i});
            debug(i, sweep[i][0].first);
        }
    }
    sum.clear();
    auto forward = [&](int i){
        while (ck < (int)groups.size() && get<0>(groups[ck]) <= i){
            auto [ii, l, r, c, k] = groups[ck];
            sum.update(l, r, +k);
            tt.update(1, 0, tt.size-1, l, r, -k);
            debug(l, r, -k);
            last = c;
            ck++;
        }
    };
    for (int rep = 0; rep<=q; rep++){
        forward(rep);
        while (1){
            auto maybe = tt.query(1, 0, tt.size-1, 1, n);
            debug(maybe);
            if (maybe.first > 0) break;
            debug(maybe);
            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;
}
# Verdict Execution time Memory Grader output
1 Correct 4 ms 596 KB Output is correct
2 Correct 4 ms 596 KB Output is correct
3 Correct 3 ms 596 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 328 KB Output is correct
7 Correct 3 ms 596 KB Output is correct
8 Correct 4 ms 592 KB Output is correct
9 Correct 4 ms 596 KB Output is correct
10 Correct 3 ms 596 KB Output is correct
11 Correct 3 ms 596 KB Output is correct
12 Correct 4 ms 596 KB Output is correct
13 Correct 2 ms 584 KB Output is correct
14 Correct 3 ms 588 KB Output is correct
15 Correct 2 ms 592 KB Output is correct
16 Correct 3 ms 684 KB Output is correct
17 Correct 3 ms 596 KB Output is correct
18 Correct 3 ms 584 KB Output is correct
19 Correct 3 ms 596 KB Output is correct
20 Correct 3 ms 644 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 596 KB Output is correct
2 Correct 4 ms 596 KB Output is correct
3 Correct 3 ms 596 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 328 KB Output is correct
7 Correct 3 ms 596 KB Output is correct
8 Correct 4 ms 592 KB Output is correct
9 Correct 4 ms 596 KB Output is correct
10 Correct 3 ms 596 KB Output is correct
11 Correct 3 ms 596 KB Output is correct
12 Correct 4 ms 596 KB Output is correct
13 Correct 2 ms 584 KB Output is correct
14 Correct 3 ms 588 KB Output is correct
15 Correct 2 ms 592 KB Output is correct
16 Correct 3 ms 684 KB Output is correct
17 Correct 3 ms 596 KB Output is correct
18 Correct 3 ms 584 KB Output is correct
19 Correct 3 ms 596 KB Output is correct
20 Correct 3 ms 644 KB Output is correct
21 Correct 3 ms 596 KB Output is correct
22 Correct 4 ms 596 KB Output is correct
23 Correct 3 ms 596 KB Output is correct
24 Correct 4 ms 596 KB Output is correct
25 Correct 1 ms 340 KB Output is correct
26 Correct 1 ms 340 KB Output is correct
27 Correct 3 ms 596 KB Output is correct
28 Correct 4 ms 596 KB Output is correct
29 Correct 3 ms 596 KB Output is correct
30 Correct 4 ms 596 KB Output is correct
31 Correct 3 ms 596 KB Output is correct
32 Correct 3 ms 596 KB Output is correct
33 Correct 3 ms 596 KB Output is correct
34 Correct 3 ms 588 KB Output is correct
35 Correct 3 ms 596 KB Output is correct
36 Correct 3 ms 596 KB Output is correct
37 Correct 2 ms 596 KB Output is correct
38 Correct 3 ms 724 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 97 ms 10056 KB Output is correct
2 Correct 113 ms 11456 KB Output is correct
3 Correct 96 ms 11148 KB Output is correct
4 Correct 99 ms 11076 KB Output is correct
5 Correct 104 ms 11584 KB Output is correct
6 Correct 103 ms 11572 KB Output is correct
7 Correct 18 ms 2924 KB Output is correct
8 Correct 20 ms 3016 KB Output is correct
9 Correct 96 ms 11248 KB Output is correct
10 Correct 94 ms 11180 KB Output is correct
11 Correct 115 ms 11280 KB Output is correct
12 Correct 102 ms 11200 KB Output is correct
13 Correct 95 ms 10700 KB Output is correct
14 Correct 104 ms 11736 KB Output is correct
15 Correct 103 ms 11752 KB Output is correct
16 Correct 114 ms 12460 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 610 ms 38928 KB Output is correct
2 Correct 451 ms 40508 KB Output is correct
3 Correct 645 ms 45764 KB Output is correct
4 Correct 484 ms 43076 KB Output is correct
5 Correct 490 ms 41496 KB Output is correct
6 Correct 663 ms 47180 KB Output is correct
7 Correct 91 ms 12508 KB Output is correct
8 Correct 95 ms 12236 KB Output is correct
9 Correct 723 ms 48208 KB Output is correct
10 Correct 846 ms 48296 KB Output is correct
11 Correct 702 ms 45812 KB Output is correct
12 Correct 631 ms 45828 KB Output is correct
13 Correct 616 ms 45888 KB Output is correct
14 Correct 633 ms 45784 KB Output is correct
15 Correct 627 ms 45828 KB Output is correct
16 Correct 646 ms 45812 KB Output is correct
17 Correct 615 ms 45716 KB Output is correct
18 Correct 636 ms 45868 KB Output is correct
19 Correct 635 ms 45828 KB Output is correct
20 Correct 634 ms 45776 KB Output is correct
21 Correct 640 ms 45764 KB Output is correct
22 Correct 623 ms 45856 KB Output is correct
23 Correct 633 ms 45824 KB Output is correct
24 Correct 624 ms 45748 KB Output is correct
25 Correct 548 ms 43608 KB Output is correct
26 Correct 572 ms 45596 KB Output is correct
27 Correct 507 ms 48004 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 596 KB Output is correct
2 Correct 4 ms 596 KB Output is correct
3 Correct 3 ms 596 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 328 KB Output is correct
7 Correct 3 ms 596 KB Output is correct
8 Correct 4 ms 592 KB Output is correct
9 Correct 4 ms 596 KB Output is correct
10 Correct 3 ms 596 KB Output is correct
11 Correct 3 ms 596 KB Output is correct
12 Correct 4 ms 596 KB Output is correct
13 Correct 2 ms 584 KB Output is correct
14 Correct 3 ms 588 KB Output is correct
15 Correct 2 ms 592 KB Output is correct
16 Correct 3 ms 684 KB Output is correct
17 Correct 3 ms 596 KB Output is correct
18 Correct 3 ms 584 KB Output is correct
19 Correct 3 ms 596 KB Output is correct
20 Correct 3 ms 644 KB Output is correct
21 Correct 97 ms 10056 KB Output is correct
22 Correct 113 ms 11456 KB Output is correct
23 Correct 96 ms 11148 KB Output is correct
24 Correct 99 ms 11076 KB Output is correct
25 Correct 104 ms 11584 KB Output is correct
26 Correct 103 ms 11572 KB Output is correct
27 Correct 18 ms 2924 KB Output is correct
28 Correct 20 ms 3016 KB Output is correct
29 Correct 96 ms 11248 KB Output is correct
30 Correct 94 ms 11180 KB Output is correct
31 Correct 115 ms 11280 KB Output is correct
32 Correct 102 ms 11200 KB Output is correct
33 Correct 95 ms 10700 KB Output is correct
34 Correct 104 ms 11736 KB Output is correct
35 Correct 103 ms 11752 KB Output is correct
36 Correct 114 ms 12460 KB Output is correct
37 Correct 116 ms 10864 KB Output is correct
38 Correct 111 ms 11004 KB Output is correct
39 Correct 20 ms 2748 KB Output is correct
40 Correct 26 ms 2912 KB Output is correct
41 Correct 150 ms 11392 KB Output is correct
42 Correct 136 ms 11408 KB Output is correct
43 Correct 137 ms 11388 KB Output is correct
44 Correct 142 ms 11460 KB Output is correct
45 Correct 131 ms 11416 KB Output is correct
46 Correct 129 ms 11484 KB Output is correct
47 Correct 123 ms 11320 KB Output is correct
48 Correct 118 ms 11312 KB Output is correct
49 Correct 90 ms 9928 KB Output is correct
50 Correct 108 ms 10972 KB Output is correct
51 Correct 132 ms 11480 KB Output is correct
52 Correct 128 ms 11352 KB Output is correct
53 Correct 89 ms 11288 KB Output is correct
54 Correct 115 ms 12468 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 146 ms 11132 KB Output is correct
2 Correct 155 ms 11108 KB Output is correct
3 Correct 164 ms 11444 KB Output is correct
4 Correct 124 ms 10592 KB Output is correct
5 Correct 139 ms 11140 KB Output is correct
6 Correct 160 ms 11444 KB Output is correct
7 Correct 23 ms 3176 KB Output is correct
8 Correct 24 ms 2844 KB Output is correct
9 Correct 146 ms 11444 KB Output is correct
10 Correct 104 ms 10472 KB Output is correct
11 Correct 146 ms 11400 KB Output is correct
12 Correct 159 ms 11432 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 596 KB Output is correct
2 Correct 4 ms 596 KB Output is correct
3 Correct 3 ms 596 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 328 KB Output is correct
7 Correct 3 ms 596 KB Output is correct
8 Correct 4 ms 592 KB Output is correct
9 Correct 4 ms 596 KB Output is correct
10 Correct 3 ms 596 KB Output is correct
11 Correct 3 ms 596 KB Output is correct
12 Correct 4 ms 596 KB Output is correct
13 Correct 2 ms 584 KB Output is correct
14 Correct 3 ms 588 KB Output is correct
15 Correct 2 ms 592 KB Output is correct
16 Correct 3 ms 684 KB Output is correct
17 Correct 3 ms 596 KB Output is correct
18 Correct 3 ms 584 KB Output is correct
19 Correct 3 ms 596 KB Output is correct
20 Correct 3 ms 644 KB Output is correct
21 Correct 3 ms 596 KB Output is correct
22 Correct 4 ms 596 KB Output is correct
23 Correct 3 ms 596 KB Output is correct
24 Correct 4 ms 596 KB Output is correct
25 Correct 1 ms 340 KB Output is correct
26 Correct 1 ms 340 KB Output is correct
27 Correct 3 ms 596 KB Output is correct
28 Correct 4 ms 596 KB Output is correct
29 Correct 3 ms 596 KB Output is correct
30 Correct 4 ms 596 KB Output is correct
31 Correct 3 ms 596 KB Output is correct
32 Correct 3 ms 596 KB Output is correct
33 Correct 3 ms 596 KB Output is correct
34 Correct 3 ms 588 KB Output is correct
35 Correct 3 ms 596 KB Output is correct
36 Correct 3 ms 596 KB Output is correct
37 Correct 2 ms 596 KB Output is correct
38 Correct 3 ms 724 KB Output is correct
39 Correct 97 ms 10056 KB Output is correct
40 Correct 113 ms 11456 KB Output is correct
41 Correct 96 ms 11148 KB Output is correct
42 Correct 99 ms 11076 KB Output is correct
43 Correct 104 ms 11584 KB Output is correct
44 Correct 103 ms 11572 KB Output is correct
45 Correct 18 ms 2924 KB Output is correct
46 Correct 20 ms 3016 KB Output is correct
47 Correct 96 ms 11248 KB Output is correct
48 Correct 94 ms 11180 KB Output is correct
49 Correct 115 ms 11280 KB Output is correct
50 Correct 102 ms 11200 KB Output is correct
51 Correct 95 ms 10700 KB Output is correct
52 Correct 104 ms 11736 KB Output is correct
53 Correct 103 ms 11752 KB Output is correct
54 Correct 114 ms 12460 KB Output is correct
55 Correct 116 ms 10864 KB Output is correct
56 Correct 111 ms 11004 KB Output is correct
57 Correct 20 ms 2748 KB Output is correct
58 Correct 26 ms 2912 KB Output is correct
59 Correct 150 ms 11392 KB Output is correct
60 Correct 136 ms 11408 KB Output is correct
61 Correct 137 ms 11388 KB Output is correct
62 Correct 142 ms 11460 KB Output is correct
63 Correct 131 ms 11416 KB Output is correct
64 Correct 129 ms 11484 KB Output is correct
65 Correct 123 ms 11320 KB Output is correct
66 Correct 118 ms 11312 KB Output is correct
67 Correct 90 ms 9928 KB Output is correct
68 Correct 108 ms 10972 KB Output is correct
69 Correct 132 ms 11480 KB Output is correct
70 Correct 128 ms 11352 KB Output is correct
71 Correct 89 ms 11288 KB Output is correct
72 Correct 115 ms 12468 KB Output is correct
73 Correct 146 ms 11132 KB Output is correct
74 Correct 155 ms 11108 KB Output is correct
75 Correct 164 ms 11444 KB Output is correct
76 Correct 124 ms 10592 KB Output is correct
77 Correct 139 ms 11140 KB Output is correct
78 Correct 160 ms 11444 KB Output is correct
79 Correct 23 ms 3176 KB Output is correct
80 Correct 24 ms 2844 KB Output is correct
81 Correct 146 ms 11444 KB Output is correct
82 Correct 104 ms 10472 KB Output is correct
83 Correct 146 ms 11400 KB Output is correct
84 Correct 159 ms 11432 KB Output is correct
85 Correct 128 ms 11108 KB Output is correct
86 Correct 142 ms 11996 KB Output is correct
87 Correct 131 ms 11736 KB Output is correct
88 Correct 143 ms 12340 KB Output is correct
89 Correct 99 ms 10360 KB Output is correct
90 Correct 139 ms 11988 KB Output is correct
91 Correct 109 ms 10644 KB Output is correct
92 Correct 102 ms 10548 KB Output is correct
93 Correct 135 ms 11916 KB Output is correct
94 Correct 135 ms 11980 KB Output is correct
95 Correct 135 ms 11676 KB Output is correct
96 Correct 136 ms 11932 KB Output is correct
97 Correct 135 ms 11888 KB Output is correct
98 Correct 111 ms 10816 KB Output is correct
99 Correct 130 ms 11744 KB Output is correct
100 Correct 117 ms 11008 KB Output is correct
101 Correct 131 ms 11908 KB Output is correct
102 Correct 117 ms 12580 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 596 KB Output is correct
2 Correct 4 ms 596 KB Output is correct
3 Correct 3 ms 596 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 328 KB Output is correct
7 Correct 3 ms 596 KB Output is correct
8 Correct 4 ms 592 KB Output is correct
9 Correct 4 ms 596 KB Output is correct
10 Correct 3 ms 596 KB Output is correct
11 Correct 3 ms 596 KB Output is correct
12 Correct 4 ms 596 KB Output is correct
13 Correct 2 ms 584 KB Output is correct
14 Correct 3 ms 588 KB Output is correct
15 Correct 2 ms 592 KB Output is correct
16 Correct 3 ms 684 KB Output is correct
17 Correct 3 ms 596 KB Output is correct
18 Correct 3 ms 584 KB Output is correct
19 Correct 3 ms 596 KB Output is correct
20 Correct 3 ms 644 KB Output is correct
21 Correct 3 ms 596 KB Output is correct
22 Correct 4 ms 596 KB Output is correct
23 Correct 3 ms 596 KB Output is correct
24 Correct 4 ms 596 KB Output is correct
25 Correct 1 ms 340 KB Output is correct
26 Correct 1 ms 340 KB Output is correct
27 Correct 3 ms 596 KB Output is correct
28 Correct 4 ms 596 KB Output is correct
29 Correct 3 ms 596 KB Output is correct
30 Correct 4 ms 596 KB Output is correct
31 Correct 3 ms 596 KB Output is correct
32 Correct 3 ms 596 KB Output is correct
33 Correct 3 ms 596 KB Output is correct
34 Correct 3 ms 588 KB Output is correct
35 Correct 3 ms 596 KB Output is correct
36 Correct 3 ms 596 KB Output is correct
37 Correct 2 ms 596 KB Output is correct
38 Correct 3 ms 724 KB Output is correct
39 Correct 97 ms 10056 KB Output is correct
40 Correct 113 ms 11456 KB Output is correct
41 Correct 96 ms 11148 KB Output is correct
42 Correct 99 ms 11076 KB Output is correct
43 Correct 104 ms 11584 KB Output is correct
44 Correct 103 ms 11572 KB Output is correct
45 Correct 18 ms 2924 KB Output is correct
46 Correct 20 ms 3016 KB Output is correct
47 Correct 96 ms 11248 KB Output is correct
48 Correct 94 ms 11180 KB Output is correct
49 Correct 115 ms 11280 KB Output is correct
50 Correct 102 ms 11200 KB Output is correct
51 Correct 95 ms 10700 KB Output is correct
52 Correct 104 ms 11736 KB Output is correct
53 Correct 103 ms 11752 KB Output is correct
54 Correct 114 ms 12460 KB Output is correct
55 Correct 610 ms 38928 KB Output is correct
56 Correct 451 ms 40508 KB Output is correct
57 Correct 645 ms 45764 KB Output is correct
58 Correct 484 ms 43076 KB Output is correct
59 Correct 490 ms 41496 KB Output is correct
60 Correct 663 ms 47180 KB Output is correct
61 Correct 91 ms 12508 KB Output is correct
62 Correct 95 ms 12236 KB Output is correct
63 Correct 723 ms 48208 KB Output is correct
64 Correct 846 ms 48296 KB Output is correct
65 Correct 702 ms 45812 KB Output is correct
66 Correct 631 ms 45828 KB Output is correct
67 Correct 616 ms 45888 KB Output is correct
68 Correct 633 ms 45784 KB Output is correct
69 Correct 627 ms 45828 KB Output is correct
70 Correct 646 ms 45812 KB Output is correct
71 Correct 615 ms 45716 KB Output is correct
72 Correct 636 ms 45868 KB Output is correct
73 Correct 635 ms 45828 KB Output is correct
74 Correct 634 ms 45776 KB Output is correct
75 Correct 640 ms 45764 KB Output is correct
76 Correct 623 ms 45856 KB Output is correct
77 Correct 633 ms 45824 KB Output is correct
78 Correct 624 ms 45748 KB Output is correct
79 Correct 548 ms 43608 KB Output is correct
80 Correct 572 ms 45596 KB Output is correct
81 Correct 507 ms 48004 KB Output is correct
82 Correct 116 ms 10864 KB Output is correct
83 Correct 111 ms 11004 KB Output is correct
84 Correct 20 ms 2748 KB Output is correct
85 Correct 26 ms 2912 KB Output is correct
86 Correct 150 ms 11392 KB Output is correct
87 Correct 136 ms 11408 KB Output is correct
88 Correct 137 ms 11388 KB Output is correct
89 Correct 142 ms 11460 KB Output is correct
90 Correct 131 ms 11416 KB Output is correct
91 Correct 129 ms 11484 KB Output is correct
92 Correct 123 ms 11320 KB Output is correct
93 Correct 118 ms 11312 KB Output is correct
94 Correct 90 ms 9928 KB Output is correct
95 Correct 108 ms 10972 KB Output is correct
96 Correct 132 ms 11480 KB Output is correct
97 Correct 128 ms 11352 KB Output is correct
98 Correct 89 ms 11288 KB Output is correct
99 Correct 115 ms 12468 KB Output is correct
100 Correct 146 ms 11132 KB Output is correct
101 Correct 155 ms 11108 KB Output is correct
102 Correct 164 ms 11444 KB Output is correct
103 Correct 124 ms 10592 KB Output is correct
104 Correct 139 ms 11140 KB Output is correct
105 Correct 160 ms 11444 KB Output is correct
106 Correct 23 ms 3176 KB Output is correct
107 Correct 24 ms 2844 KB Output is correct
108 Correct 146 ms 11444 KB Output is correct
109 Correct 104 ms 10472 KB Output is correct
110 Correct 146 ms 11400 KB Output is correct
111 Correct 159 ms 11432 KB Output is correct
112 Correct 128 ms 11108 KB Output is correct
113 Correct 142 ms 11996 KB Output is correct
114 Correct 131 ms 11736 KB Output is correct
115 Correct 143 ms 12340 KB Output is correct
116 Correct 99 ms 10360 KB Output is correct
117 Correct 139 ms 11988 KB Output is correct
118 Correct 109 ms 10644 KB Output is correct
119 Correct 102 ms 10548 KB Output is correct
120 Correct 135 ms 11916 KB Output is correct
121 Correct 135 ms 11980 KB Output is correct
122 Correct 135 ms 11676 KB Output is correct
123 Correct 136 ms 11932 KB Output is correct
124 Correct 135 ms 11888 KB Output is correct
125 Correct 111 ms 10816 KB Output is correct
126 Correct 130 ms 11744 KB Output is correct
127 Correct 117 ms 11008 KB Output is correct
128 Correct 131 ms 11908 KB Output is correct
129 Correct 117 ms 12580 KB Output is correct
130 Correct 679 ms 46268 KB Output is correct
131 Correct 442 ms 40596 KB Output is correct
132 Correct 695 ms 46324 KB Output is correct
133 Correct 698 ms 47044 KB Output is correct
134 Correct 586 ms 45388 KB Output is correct
135 Correct 709 ms 47944 KB Output is correct
136 Correct 750 ms 49200 KB Output is correct
137 Correct 750 ms 49144 KB Output is correct
138 Correct 664 ms 46508 KB Output is correct
139 Correct 635 ms 46520 KB Output is correct
140 Correct 637 ms 46488 KB Output is correct
141 Correct 658 ms 46532 KB Output is correct
142 Correct 638 ms 46412 KB Output is correct
143 Correct 644 ms 46372 KB Output is correct
144 Correct 646 ms 46464 KB Output is correct
145 Correct 634 ms 46528 KB Output is correct
146 Correct 628 ms 46400 KB Output is correct
147 Correct 636 ms 46396 KB Output is correct
148 Correct 624 ms 46376 KB Output is correct
149 Correct 640 ms 46564 KB Output is correct
150 Correct 581 ms 45644 KB Output is correct
151 Correct 568 ms 46088 KB Output is correct
152 Correct 576 ms 46088 KB Output is correct
153 Correct 523 ms 48812 KB Output is correct