답안 #1042232

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1042232 2024-08-02T17:06:26 Z TrinhKhanhDung 푸드 코트 (JOI21_foodcourt) C++14
100 / 100
494 ms 106484 KB
#include <bits/stdc++.h>
#define ll long long
#define fi first
#define se second
#define sz(x) (int)x.size()
#define ALL(v) v.begin(),v.end()
#define MASK(k) (1LL << (k))
#define BIT(x, i) (((x) >> (i)) & 1)
#define oo (ll)1e18
#define INF (ll)1e9
#define MOD (ll)(1e9 + 7)
#define int ll

using namespace std;

template<class T1, class T2>
    bool maximize(T1 &a, T2 b){if(a < b){a = b; return true;} return false;}

template<class T1, class T2>
    bool minimize(T1 &a, T2 b){if(a > b){a = b; return true;} return false;}

template<class T1, class T2>
    void add(T1 &a, T2 b){a += b; if(a >= MOD) a -= MOD;}

template<class T1, class T2>
    void sub(T1 &a, T2 b){a -= b; if(a < 0) a += MOD;}

template<class T>
    void cps(T &v){sort(ALL(v)); v.resize(unique(ALL(v)) - v.begin());}

struct fen{
    vector<ll> val;
    int n;

    fen(int _n = 0){
        n = _n;
        val.resize(n + 3, 0);
    }

    void upd(int p, ll c){
        while(p <= n){
            val[p] += c;
            p += p & -p;
        }
    }

    ll get(int p){
        ll ans = 0;
        while(p > 0){
            ans += val[p];
            p -= p & -p;
        }
        return ans;
    }
};

struct seg1{
    vector<ll> sum, mi;
    int n;

    seg1(int _n = 0){
        n = _n;
        sum.resize(4 * n + 3, 0);
        mi.resize(4 * n + 3, 0);
    }

    void upd(int p, ll c){
        int i = 1, l = 1, r = n;
        while(l < r){
            int m = (l + r) >> 1;
            if(p <= m){
                i = i * 2;
                r = m;
            }
            else{
                i = i * 2 + 1;
                l = m + 1;
            }
        }
        sum[i] += c;
        mi[i] = min(0LL, sum[i]);
        while(i > 1){
            i >>= 1;
            sum[i] = sum[i * 2] + sum[i * 2 + 1];
            mi[i] = min(mi[i * 2], sum[i * 2] + mi[i * 2 + 1]);
        }
    }

    pair<ll, ll> get(int i, int l, int r, int p){
        if(l > p) return make_pair(0, 0);
        if(r <= p) return make_pair(sum[i], mi[i]);
        int m = (l + r) >> 1;
        pair<ll, ll> a = get(i * 2, l, m, p), b = get(i * 2 + 1, m + 1, r, p);
        return make_pair(a.fi + b.fi, min(a.se, a.fi + b.se));
    }

    pair<ll, ll> get(int p){
        return get(1, 1, n, p);
    }
};

struct seg2{
    vector<pair<ll, int>> it;
    vector<ll> lazy;
    int n;

    void build(int i, int l, int r){
        if(l == r){
            it[i] = make_pair(0, l);
            return;
        }
        int m = (l + r) >> 1;
        build(i * 2, l, m);
        build(i * 2 + 1, m + 1, r);
        it[i] = min(it[i * 2], it[i * 2 + 1]);
    }

    seg2(int _n = 0){
        n = _n;
        it.resize(4 * n + 3);
        lazy.resize(4 * n + 3, 0);
        build(1, 1, n);
    }

    void push(int i){
        ll t = lazy[i];
        lazy[i] = 0;
        lazy[i * 2] += t;
        lazy[i * 2 + 1] += t;
        it[i * 2].fi += t;
        it[i * 2 + 1].fi += t;
    }

    void upd(int i, int l, int r, int u, int v, ll c){
        if(r < u || v < l) return;
        if(u <= l && r <= v){
            lazy[i] += c;
            it[i].fi += c;
            return;
        }
        push(i);
        int m = (l + r) >> 1;
        upd(i * 2, l, m, u, v, c);
        upd(i * 2 + 1, m + 1, r, u, v, c);
        it[i] = min(it[i * 2], it[i * 2 + 1]);
    }

    void upd(int u, int v, ll c){
        upd(1, 1, n, u, v, c);
    }
};

const int MAX = 250003;

int N, M, Q;
vector<pair<int, ll>> event[MAX], adds[MAX], ask[MAX], save[MAX];
int ans[MAX];

void solve(){
    cin >> N >> M >> Q;

    fen bit(Q);
    seg1 it1(Q);
    seg2 it2(N);

    vector<vector<ll>> need;

    for(int q=1; q<=Q; q++){
        int t; cin >> t;
        if(t == 1){
            ll l, r, c, k;
            cin >> l >> r >> c >> k;
            need.push_back({l, r, c, k});
            adds[l].push_back(make_pair(q, k));
            adds[r + 1].push_back(make_pair(q, -k));
            event[l].push_back(make_pair(q, k));
            event[r + 1].push_back(make_pair(q, -k));
        }

        if(t == 2){
            ll l, r, k;
            cin >> l >> r >> k;
            event[l].push_back(make_pair(q, -k));
            event[r + 1].push_back(make_pair(q, k));
        }

        if(t == 3){
            ll a, b;
            cin >> a >> b;
            ask[a].push_back(make_pair(q, b));
        }
    }

    memset(ans, -1, sizeof ans);

    for(int i=1; i<=N; i++){
        for(auto o: event[i]){
            it1.upd(o.fi, o.se);
        }
        for(auto o: adds[i]){
            bit.upd(o.fi, o.se);
        }
        for(auto o: ask[i]){
            pair<ll, ll> it = it1.get(1, 1, Q, o.fi);
            ll num = it.fi - it.se;
//            cout << o.fi << ' ' << o.se << ' ' << num << '\n';
            if(num >= o.se){
                save[i].push_back(make_pair(bit.get(o.fi) - num + o.se, o.fi));
            }
            else{
                ans[o.fi] = 0;
            }
        }
        sort(ALL(save[i]), greater<pair<ll, ll>>());
        if(sz(save[i])){
            it2.upd(i, i, save[i].back().fi);
        }
        else{
            it2.upd(i, i, (ll)1e16);
        }
    }

    for(auto o: need){
        it2.upd(o[0], o[1], -o[3]);
        while(it2.it[1].fi <= 0){
            int i = it2.it[1].se;
            ans[save[i].back().se] = o[2];
            ll pr = save[i].back().fi;
            save[i].pop_back();
            if(sz(save[i])){
                it2.upd(i, i, save[i].back().fi - pr);
            }
            else{
                it2.upd(i, i, (ll)1e16 - pr);
            }
        }
    }

    for(int i=1; i<=Q; i++){
//        cout << ans[i] << ' ';
        if(ans[i] != -1){
            cout << ans[i] << '\n';
        }
    }
}

signed main(){
    ios_base::sync_with_stdio(0); cin.tie(0);
//    freopen("deggraph.inp", "r", stdin);
//    freopen("deggraph.out", "w", stdout);

    int t = 1;
//    cin >> t;
    while(t--){
        solve();
    }

    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 12 ms 26208 KB Output is correct
2 Correct 12 ms 26436 KB Output is correct
3 Correct 12 ms 26204 KB Output is correct
4 Correct 13 ms 26460 KB Output is correct
5 Correct 11 ms 26032 KB Output is correct
6 Correct 11 ms 25948 KB Output is correct
7 Correct 11 ms 26268 KB Output is correct
8 Correct 11 ms 26460 KB Output is correct
9 Correct 12 ms 26460 KB Output is correct
10 Correct 13 ms 26268 KB Output is correct
11 Correct 12 ms 26336 KB Output is correct
12 Correct 13 ms 26456 KB Output is correct
13 Correct 10 ms 26204 KB Output is correct
14 Correct 12 ms 26460 KB Output is correct
15 Correct 10 ms 26204 KB Output is correct
16 Correct 11 ms 26204 KB Output is correct
17 Correct 12 ms 26260 KB Output is correct
18 Correct 14 ms 26460 KB Output is correct
19 Correct 11 ms 26460 KB Output is correct
20 Correct 12 ms 26460 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 12 ms 26208 KB Output is correct
2 Correct 12 ms 26436 KB Output is correct
3 Correct 12 ms 26204 KB Output is correct
4 Correct 13 ms 26460 KB Output is correct
5 Correct 11 ms 26032 KB Output is correct
6 Correct 11 ms 25948 KB Output is correct
7 Correct 11 ms 26268 KB Output is correct
8 Correct 11 ms 26460 KB Output is correct
9 Correct 12 ms 26460 KB Output is correct
10 Correct 13 ms 26268 KB Output is correct
11 Correct 12 ms 26336 KB Output is correct
12 Correct 13 ms 26456 KB Output is correct
13 Correct 10 ms 26204 KB Output is correct
14 Correct 12 ms 26460 KB Output is correct
15 Correct 10 ms 26204 KB Output is correct
16 Correct 11 ms 26204 KB Output is correct
17 Correct 12 ms 26260 KB Output is correct
18 Correct 14 ms 26460 KB Output is correct
19 Correct 11 ms 26460 KB Output is correct
20 Correct 12 ms 26460 KB Output is correct
21 Correct 12 ms 26200 KB Output is correct
22 Correct 10 ms 26252 KB Output is correct
23 Correct 11 ms 26284 KB Output is correct
24 Correct 12 ms 26460 KB Output is correct
25 Correct 11 ms 26204 KB Output is correct
26 Correct 11 ms 26204 KB Output is correct
27 Correct 11 ms 26384 KB Output is correct
28 Correct 12 ms 26460 KB Output is correct
29 Correct 15 ms 26456 KB Output is correct
30 Correct 11 ms 26460 KB Output is correct
31 Correct 12 ms 26460 KB Output is correct
32 Correct 12 ms 26460 KB Output is correct
33 Correct 11 ms 26204 KB Output is correct
34 Correct 11 ms 26456 KB Output is correct
35 Correct 13 ms 26384 KB Output is correct
36 Correct 10 ms 26460 KB Output is correct
37 Correct 11 ms 26296 KB Output is correct
38 Correct 12 ms 26456 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 75 ms 43276 KB Output is correct
2 Correct 78 ms 44884 KB Output is correct
3 Correct 72 ms 43232 KB Output is correct
4 Correct 75 ms 43320 KB Output is correct
5 Correct 83 ms 44812 KB Output is correct
6 Correct 80 ms 44808 KB Output is correct
7 Correct 28 ms 34716 KB Output is correct
8 Correct 30 ms 35060 KB Output is correct
9 Correct 80 ms 43788 KB Output is correct
10 Correct 77 ms 43856 KB Output is correct
11 Correct 70 ms 43788 KB Output is correct
12 Correct 80 ms 43784 KB Output is correct
13 Correct 63 ms 41492 KB Output is correct
14 Correct 75 ms 44920 KB Output is correct
15 Correct 79 ms 45316 KB Output is correct
16 Correct 89 ms 47368 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 373 ms 89912 KB Output is correct
2 Correct 300 ms 78340 KB Output is correct
3 Correct 403 ms 96260 KB Output is correct
4 Correct 356 ms 87040 KB Output is correct
5 Correct 337 ms 81824 KB Output is correct
6 Correct 494 ms 101376 KB Output is correct
7 Correct 93 ms 64772 KB Output is correct
8 Correct 96 ms 64380 KB Output is correct
9 Correct 463 ms 101116 KB Output is correct
10 Correct 478 ms 101124 KB Output is correct
11 Correct 422 ms 97536 KB Output is correct
12 Correct 400 ms 97532 KB Output is correct
13 Correct 410 ms 97536 KB Output is correct
14 Correct 436 ms 97616 KB Output is correct
15 Correct 405 ms 97452 KB Output is correct
16 Correct 415 ms 97468 KB Output is correct
17 Correct 399 ms 97536 KB Output is correct
18 Correct 411 ms 97432 KB Output is correct
19 Correct 397 ms 97540 KB Output is correct
20 Correct 419 ms 97536 KB Output is correct
21 Correct 416 ms 97460 KB Output is correct
22 Correct 412 ms 97532 KB Output is correct
23 Correct 418 ms 97540 KB Output is correct
24 Correct 399 ms 97280 KB Output is correct
25 Correct 289 ms 88388 KB Output is correct
26 Correct 296 ms 94856 KB Output is correct
27 Correct 354 ms 105716 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 12 ms 26208 KB Output is correct
2 Correct 12 ms 26436 KB Output is correct
3 Correct 12 ms 26204 KB Output is correct
4 Correct 13 ms 26460 KB Output is correct
5 Correct 11 ms 26032 KB Output is correct
6 Correct 11 ms 25948 KB Output is correct
7 Correct 11 ms 26268 KB Output is correct
8 Correct 11 ms 26460 KB Output is correct
9 Correct 12 ms 26460 KB Output is correct
10 Correct 13 ms 26268 KB Output is correct
11 Correct 12 ms 26336 KB Output is correct
12 Correct 13 ms 26456 KB Output is correct
13 Correct 10 ms 26204 KB Output is correct
14 Correct 12 ms 26460 KB Output is correct
15 Correct 10 ms 26204 KB Output is correct
16 Correct 11 ms 26204 KB Output is correct
17 Correct 12 ms 26260 KB Output is correct
18 Correct 14 ms 26460 KB Output is correct
19 Correct 11 ms 26460 KB Output is correct
20 Correct 12 ms 26460 KB Output is correct
21 Correct 75 ms 43276 KB Output is correct
22 Correct 78 ms 44884 KB Output is correct
23 Correct 72 ms 43232 KB Output is correct
24 Correct 75 ms 43320 KB Output is correct
25 Correct 83 ms 44812 KB Output is correct
26 Correct 80 ms 44808 KB Output is correct
27 Correct 28 ms 34716 KB Output is correct
28 Correct 30 ms 35060 KB Output is correct
29 Correct 80 ms 43788 KB Output is correct
30 Correct 77 ms 43856 KB Output is correct
31 Correct 70 ms 43788 KB Output is correct
32 Correct 80 ms 43784 KB Output is correct
33 Correct 63 ms 41492 KB Output is correct
34 Correct 75 ms 44920 KB Output is correct
35 Correct 79 ms 45316 KB Output is correct
36 Correct 89 ms 47368 KB Output is correct
37 Correct 70 ms 41740 KB Output is correct
38 Correct 77 ms 41628 KB Output is correct
39 Correct 25 ms 34172 KB Output is correct
40 Correct 31 ms 35016 KB Output is correct
41 Correct 80 ms 44040 KB Output is correct
42 Correct 81 ms 44040 KB Output is correct
43 Correct 96 ms 43856 KB Output is correct
44 Correct 86 ms 44152 KB Output is correct
45 Correct 79 ms 43896 KB Output is correct
46 Correct 77 ms 44040 KB Output is correct
47 Correct 48 ms 42100 KB Output is correct
48 Correct 72 ms 43268 KB Output is correct
49 Correct 56 ms 38708 KB Output is correct
50 Correct 67 ms 42248 KB Output is correct
51 Correct 78 ms 44040 KB Output is correct
52 Correct 84 ms 44176 KB Output is correct
53 Correct 67 ms 43276 KB Output is correct
54 Correct 87 ms 47368 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 85 ms 43788 KB Output is correct
2 Correct 89 ms 44292 KB Output is correct
3 Correct 99 ms 45552 KB Output is correct
4 Correct 64 ms 41224 KB Output is correct
5 Correct 81 ms 43528 KB Output is correct
6 Correct 93 ms 45580 KB Output is correct
7 Correct 31 ms 36284 KB Output is correct
8 Correct 33 ms 35296 KB Output is correct
9 Correct 60 ms 44144 KB Output is correct
10 Correct 58 ms 40460 KB Output is correct
11 Correct 74 ms 44760 KB Output is correct
12 Correct 74 ms 44812 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 12 ms 26208 KB Output is correct
2 Correct 12 ms 26436 KB Output is correct
3 Correct 12 ms 26204 KB Output is correct
4 Correct 13 ms 26460 KB Output is correct
5 Correct 11 ms 26032 KB Output is correct
6 Correct 11 ms 25948 KB Output is correct
7 Correct 11 ms 26268 KB Output is correct
8 Correct 11 ms 26460 KB Output is correct
9 Correct 12 ms 26460 KB Output is correct
10 Correct 13 ms 26268 KB Output is correct
11 Correct 12 ms 26336 KB Output is correct
12 Correct 13 ms 26456 KB Output is correct
13 Correct 10 ms 26204 KB Output is correct
14 Correct 12 ms 26460 KB Output is correct
15 Correct 10 ms 26204 KB Output is correct
16 Correct 11 ms 26204 KB Output is correct
17 Correct 12 ms 26260 KB Output is correct
18 Correct 14 ms 26460 KB Output is correct
19 Correct 11 ms 26460 KB Output is correct
20 Correct 12 ms 26460 KB Output is correct
21 Correct 12 ms 26200 KB Output is correct
22 Correct 10 ms 26252 KB Output is correct
23 Correct 11 ms 26284 KB Output is correct
24 Correct 12 ms 26460 KB Output is correct
25 Correct 11 ms 26204 KB Output is correct
26 Correct 11 ms 26204 KB Output is correct
27 Correct 11 ms 26384 KB Output is correct
28 Correct 12 ms 26460 KB Output is correct
29 Correct 15 ms 26456 KB Output is correct
30 Correct 11 ms 26460 KB Output is correct
31 Correct 12 ms 26460 KB Output is correct
32 Correct 12 ms 26460 KB Output is correct
33 Correct 11 ms 26204 KB Output is correct
34 Correct 11 ms 26456 KB Output is correct
35 Correct 13 ms 26384 KB Output is correct
36 Correct 10 ms 26460 KB Output is correct
37 Correct 11 ms 26296 KB Output is correct
38 Correct 12 ms 26456 KB Output is correct
39 Correct 75 ms 43276 KB Output is correct
40 Correct 78 ms 44884 KB Output is correct
41 Correct 72 ms 43232 KB Output is correct
42 Correct 75 ms 43320 KB Output is correct
43 Correct 83 ms 44812 KB Output is correct
44 Correct 80 ms 44808 KB Output is correct
45 Correct 28 ms 34716 KB Output is correct
46 Correct 30 ms 35060 KB Output is correct
47 Correct 80 ms 43788 KB Output is correct
48 Correct 77 ms 43856 KB Output is correct
49 Correct 70 ms 43788 KB Output is correct
50 Correct 80 ms 43784 KB Output is correct
51 Correct 63 ms 41492 KB Output is correct
52 Correct 75 ms 44920 KB Output is correct
53 Correct 79 ms 45316 KB Output is correct
54 Correct 89 ms 47368 KB Output is correct
55 Correct 70 ms 41740 KB Output is correct
56 Correct 77 ms 41628 KB Output is correct
57 Correct 25 ms 34172 KB Output is correct
58 Correct 31 ms 35016 KB Output is correct
59 Correct 80 ms 44040 KB Output is correct
60 Correct 81 ms 44040 KB Output is correct
61 Correct 96 ms 43856 KB Output is correct
62 Correct 86 ms 44152 KB Output is correct
63 Correct 79 ms 43896 KB Output is correct
64 Correct 77 ms 44040 KB Output is correct
65 Correct 48 ms 42100 KB Output is correct
66 Correct 72 ms 43268 KB Output is correct
67 Correct 56 ms 38708 KB Output is correct
68 Correct 67 ms 42248 KB Output is correct
69 Correct 78 ms 44040 KB Output is correct
70 Correct 84 ms 44176 KB Output is correct
71 Correct 67 ms 43276 KB Output is correct
72 Correct 87 ms 47368 KB Output is correct
73 Correct 85 ms 43788 KB Output is correct
74 Correct 89 ms 44292 KB Output is correct
75 Correct 99 ms 45552 KB Output is correct
76 Correct 64 ms 41224 KB Output is correct
77 Correct 81 ms 43528 KB Output is correct
78 Correct 93 ms 45580 KB Output is correct
79 Correct 31 ms 36284 KB Output is correct
80 Correct 33 ms 35296 KB Output is correct
81 Correct 60 ms 44144 KB Output is correct
82 Correct 58 ms 40460 KB Output is correct
83 Correct 74 ms 44760 KB Output is correct
84 Correct 74 ms 44812 KB Output is correct
85 Correct 71 ms 41736 KB Output is correct
86 Correct 85 ms 44296 KB Output is correct
87 Correct 74 ms 43528 KB Output is correct
88 Correct 90 ms 45516 KB Output is correct
89 Correct 68 ms 39080 KB Output is correct
90 Correct 85 ms 44612 KB Output is correct
91 Correct 64 ms 40204 KB Output is correct
92 Correct 69 ms 39776 KB Output is correct
93 Correct 85 ms 44552 KB Output is correct
94 Correct 87 ms 44524 KB Output is correct
95 Correct 78 ms 43528 KB Output is correct
96 Correct 92 ms 44384 KB Output is correct
97 Correct 85 ms 44552 KB Output is correct
98 Correct 76 ms 40832 KB Output is correct
99 Correct 52 ms 42636 KB Output is correct
100 Correct 61 ms 40704 KB Output is correct
101 Correct 70 ms 43720 KB Output is correct
102 Correct 78 ms 46568 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 12 ms 26208 KB Output is correct
2 Correct 12 ms 26436 KB Output is correct
3 Correct 12 ms 26204 KB Output is correct
4 Correct 13 ms 26460 KB Output is correct
5 Correct 11 ms 26032 KB Output is correct
6 Correct 11 ms 25948 KB Output is correct
7 Correct 11 ms 26268 KB Output is correct
8 Correct 11 ms 26460 KB Output is correct
9 Correct 12 ms 26460 KB Output is correct
10 Correct 13 ms 26268 KB Output is correct
11 Correct 12 ms 26336 KB Output is correct
12 Correct 13 ms 26456 KB Output is correct
13 Correct 10 ms 26204 KB Output is correct
14 Correct 12 ms 26460 KB Output is correct
15 Correct 10 ms 26204 KB Output is correct
16 Correct 11 ms 26204 KB Output is correct
17 Correct 12 ms 26260 KB Output is correct
18 Correct 14 ms 26460 KB Output is correct
19 Correct 11 ms 26460 KB Output is correct
20 Correct 12 ms 26460 KB Output is correct
21 Correct 12 ms 26200 KB Output is correct
22 Correct 10 ms 26252 KB Output is correct
23 Correct 11 ms 26284 KB Output is correct
24 Correct 12 ms 26460 KB Output is correct
25 Correct 11 ms 26204 KB Output is correct
26 Correct 11 ms 26204 KB Output is correct
27 Correct 11 ms 26384 KB Output is correct
28 Correct 12 ms 26460 KB Output is correct
29 Correct 15 ms 26456 KB Output is correct
30 Correct 11 ms 26460 KB Output is correct
31 Correct 12 ms 26460 KB Output is correct
32 Correct 12 ms 26460 KB Output is correct
33 Correct 11 ms 26204 KB Output is correct
34 Correct 11 ms 26456 KB Output is correct
35 Correct 13 ms 26384 KB Output is correct
36 Correct 10 ms 26460 KB Output is correct
37 Correct 11 ms 26296 KB Output is correct
38 Correct 12 ms 26456 KB Output is correct
39 Correct 75 ms 43276 KB Output is correct
40 Correct 78 ms 44884 KB Output is correct
41 Correct 72 ms 43232 KB Output is correct
42 Correct 75 ms 43320 KB Output is correct
43 Correct 83 ms 44812 KB Output is correct
44 Correct 80 ms 44808 KB Output is correct
45 Correct 28 ms 34716 KB Output is correct
46 Correct 30 ms 35060 KB Output is correct
47 Correct 80 ms 43788 KB Output is correct
48 Correct 77 ms 43856 KB Output is correct
49 Correct 70 ms 43788 KB Output is correct
50 Correct 80 ms 43784 KB Output is correct
51 Correct 63 ms 41492 KB Output is correct
52 Correct 75 ms 44920 KB Output is correct
53 Correct 79 ms 45316 KB Output is correct
54 Correct 89 ms 47368 KB Output is correct
55 Correct 373 ms 89912 KB Output is correct
56 Correct 300 ms 78340 KB Output is correct
57 Correct 403 ms 96260 KB Output is correct
58 Correct 356 ms 87040 KB Output is correct
59 Correct 337 ms 81824 KB Output is correct
60 Correct 494 ms 101376 KB Output is correct
61 Correct 93 ms 64772 KB Output is correct
62 Correct 96 ms 64380 KB Output is correct
63 Correct 463 ms 101116 KB Output is correct
64 Correct 478 ms 101124 KB Output is correct
65 Correct 422 ms 97536 KB Output is correct
66 Correct 400 ms 97532 KB Output is correct
67 Correct 410 ms 97536 KB Output is correct
68 Correct 436 ms 97616 KB Output is correct
69 Correct 405 ms 97452 KB Output is correct
70 Correct 415 ms 97468 KB Output is correct
71 Correct 399 ms 97536 KB Output is correct
72 Correct 411 ms 97432 KB Output is correct
73 Correct 397 ms 97540 KB Output is correct
74 Correct 419 ms 97536 KB Output is correct
75 Correct 416 ms 97460 KB Output is correct
76 Correct 412 ms 97532 KB Output is correct
77 Correct 418 ms 97540 KB Output is correct
78 Correct 399 ms 97280 KB Output is correct
79 Correct 289 ms 88388 KB Output is correct
80 Correct 296 ms 94856 KB Output is correct
81 Correct 354 ms 105716 KB Output is correct
82 Correct 70 ms 41740 KB Output is correct
83 Correct 77 ms 41628 KB Output is correct
84 Correct 25 ms 34172 KB Output is correct
85 Correct 31 ms 35016 KB Output is correct
86 Correct 80 ms 44040 KB Output is correct
87 Correct 81 ms 44040 KB Output is correct
88 Correct 96 ms 43856 KB Output is correct
89 Correct 86 ms 44152 KB Output is correct
90 Correct 79 ms 43896 KB Output is correct
91 Correct 77 ms 44040 KB Output is correct
92 Correct 48 ms 42100 KB Output is correct
93 Correct 72 ms 43268 KB Output is correct
94 Correct 56 ms 38708 KB Output is correct
95 Correct 67 ms 42248 KB Output is correct
96 Correct 78 ms 44040 KB Output is correct
97 Correct 84 ms 44176 KB Output is correct
98 Correct 67 ms 43276 KB Output is correct
99 Correct 87 ms 47368 KB Output is correct
100 Correct 85 ms 43788 KB Output is correct
101 Correct 89 ms 44292 KB Output is correct
102 Correct 99 ms 45552 KB Output is correct
103 Correct 64 ms 41224 KB Output is correct
104 Correct 81 ms 43528 KB Output is correct
105 Correct 93 ms 45580 KB Output is correct
106 Correct 31 ms 36284 KB Output is correct
107 Correct 33 ms 35296 KB Output is correct
108 Correct 60 ms 44144 KB Output is correct
109 Correct 58 ms 40460 KB Output is correct
110 Correct 74 ms 44760 KB Output is correct
111 Correct 74 ms 44812 KB Output is correct
112 Correct 71 ms 41736 KB Output is correct
113 Correct 85 ms 44296 KB Output is correct
114 Correct 74 ms 43528 KB Output is correct
115 Correct 90 ms 45516 KB Output is correct
116 Correct 68 ms 39080 KB Output is correct
117 Correct 85 ms 44612 KB Output is correct
118 Correct 64 ms 40204 KB Output is correct
119 Correct 69 ms 39776 KB Output is correct
120 Correct 85 ms 44552 KB Output is correct
121 Correct 87 ms 44524 KB Output is correct
122 Correct 78 ms 43528 KB Output is correct
123 Correct 92 ms 44384 KB Output is correct
124 Correct 85 ms 44552 KB Output is correct
125 Correct 76 ms 40832 KB Output is correct
126 Correct 52 ms 42636 KB Output is correct
127 Correct 61 ms 40704 KB Output is correct
128 Correct 70 ms 43720 KB Output is correct
129 Correct 78 ms 46568 KB Output is correct
130 Correct 408 ms 96160 KB Output is correct
131 Correct 299 ms 77836 KB Output is correct
132 Correct 445 ms 96632 KB Output is correct
133 Correct 431 ms 98816 KB Output is correct
134 Correct 382 ms 93528 KB Output is correct
135 Correct 464 ms 102144 KB Output is correct
136 Correct 438 ms 101888 KB Output is correct
137 Correct 475 ms 101888 KB Output is correct
138 Correct 394 ms 98044 KB Output is correct
139 Correct 414 ms 98100 KB Output is correct
140 Correct 413 ms 98168 KB Output is correct
141 Correct 415 ms 98240 KB Output is correct
142 Correct 403 ms 98044 KB Output is correct
143 Correct 413 ms 97964 KB Output is correct
144 Correct 420 ms 98044 KB Output is correct
145 Correct 411 ms 98044 KB Output is correct
146 Correct 415 ms 98044 KB Output is correct
147 Correct 409 ms 98044 KB Output is correct
148 Correct 415 ms 98044 KB Output is correct
149 Correct 435 ms 98132 KB Output is correct
150 Correct 202 ms 90816 KB Output is correct
151 Correct 309 ms 95448 KB Output is correct
152 Correct 309 ms 95492 KB Output is correct
153 Correct 366 ms 106484 KB Output is correct