답안 #494368

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
494368 2021-12-15T10:44:15 Z blue 푸드 코트 (JOI21_foodcourt) C++17
100 / 100
923 ms 130716 KB
#include <iostream>
#include <vector>
using namespace std;
 
using vi = vector<int>;
using ll = long long;
using vll = vector<ll>;
 
const int mx = 250'000;
const ll INF = 1'000'000'000'000'000'000LL;
 
vi L(1+mx), R(1+mx), C(1+mx), A(1+mx);
vll K(1+mx), B(1+mx);
vi T(1+mx);
 
vi st[1+mx], en[1+mx], qr[1+mx];
 
vi ans(1+mx, 0);
 
 
 
struct segtree
{
    int l;
    int r;
 
    pair<ll, int> mn;
    pair<ll, int> mx;
    ll lp = 0;
 
    segtree* left = NULL;
    segtree* right = NULL;
    segtree* parent = NULL;
 
 
    segtree()
    {
        ;
    }
 
    segtree(int L, int R, segtree* par)
    {
        l = L;
        r = R;
        parent = par;
        mn = {0, l};
        mx = {0, l};
        if(l == r) return;
        int m = (l+r)/2;
        left = new segtree(l, m, this);
        right = new segtree(m+1, r, this);
    }
 
    void add(int L, int R, ll V)
    {
        if(r < L || R < l) return;
        else if(L <= l && r <= R)
        {
            lp += V;
            mn.first += V;
            mx.first += V;
        }
        else
        {
            left->add(L, R, V);
            right->add(L, R, V);
 
            mn = min(left->mn, right->mn);
            mn.first += lp;
 
            mx = max(left->mx, right->mx);
            mx.first += lp;
        }
    }
 
    pair<ll, int> rangemin(int L, int R)
    {
        if(R < l || r < L) return {INF, -1};
        else if(L <= l && r <= R) return mn;
        else
        {
            auto res = min(left->rangemin(L, R), right->rangemin(L, R));
            res.first += lp;
            return res;
        }
    }
};
 
int locate(segtree& S, int L, ll V) //find the first position > L with a value >= V, or return -1 if it doesn't exist
{
    segtree* pos = &S;
    ll above_lp = 0;
    while(!(pos->l == L && pos->r == L))
    {
        above_lp += pos->lp;
        if(L <= (pos->l + pos->r)/2)
            pos = pos->left;
        else
            pos = pos->right;
    }
 
    while(1)
    {
        if(pos->parent == NULL) return -1;
 
        if(above_lp + pos->parent->right->mx.first >= V)
        {
            pos = pos->parent->right;
            break;
        }
        pos = pos->parent;
        above_lp -= pos->lp;
    }
 
    while(!(pos->l == pos->r))
    {
        above_lp += pos->lp;
        if(above_lp + pos->left->mx.first >= V)
            pos = pos->left;
        else
            pos = pos->right;
    }
 
    return pos->l;
}
 
struct BIT
{
    int Z;
    vll arr;
 
    BIT()
    {
        ;
    }
 
    BIT(int z)
    {
        Z = z;
        arr = vll(1+z, 0);
    }
 
    void add(int i, ll v)
    {
        for(int j = i; j <= Z; j += j&-j)
            arr[j] += v;
    }
 
    ll prefsum(int i)
    {
        ll ans = 0;
        for(int j = i; j >= 1; j -= j&-j)
            ans += arr[j];
        return ans;
    }
};
 
 
 
int main()
{
  	ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  
    int N, M, Q;
    cin >> N >> M >> Q;
 
    for(int j = 1; j <= Q; j++)
    {
        cin >> T[j];
        if(T[j] == 1) cin >> L[j] >> R[j] >> C[j] >> K[j];
        else if(T[j] == 2)
        {
            cin >> L[j] >> R[j] >> K[j];
            K[j] *= -1;
        }
        else cin >> A[j] >> B[j];
 
        if(T[j] <= 2)
        {
            st[L[j]].push_back(j);
            en[R[j]].push_back(j);
        }
        else qr[A[j]].push_back(j);
    }
 
    vll S(1+Q, 0);
 
    vi ans(1+Q, 0);
 
    segtree ST(0, Q, NULL);
    segtree ST_plus(0, Q, NULL);
    BIT plus_sum(1+Q), minus_sum(1+Q);
 
    for(int i = 1; i <= N; i++)
    {
        for(int o: st[i])
        {
            S[o] = K[o];
            ST.add(o, Q, +K[o]);
            if(K[o] < 0) minus_sum.add(o, -K[o]);
 
            if(K[o] > 0) ST_plus.add(o, Q, +K[o]);
        }
 
        for(int q: qr[i])
        {
            int p = ST.rangemin(0, q-1).second;
 
            ll min_sum = minus_sum.prefsum(q) - minus_sum.prefsum(p);
 
            // cerr << "p = " << p << '\n';
            // cerr << "total loss = " << minus_sum << '\n';
 
            ll plus_sub = ST_plus.rangemin(p, p).first;
 
            int lo = locate(ST_plus, p, min_sum + B[q] + plus_sub);
            if(lo != -1 && lo <= q)
            {
                ans[q] = C[lo];
            }
        }
 
        for(int o: en[i])
        {
            S[o] = 0;
            ST.add(o, Q, -K[o]);
            if(K[o] < 0) minus_sum.add(o, +K[o]);
 
            if(K[o] > 0)
                ST_plus.add(o, Q, -K[o]);
        }
    }
 
    for(int q = 1; q <= Q; q++)
        if(T[q] == 3)
            cout << ans[q] << '\n';
    // cout << '\n';
}
# 결과 실행 시간 메모리 Grader output
1 Correct 17 ms 28364 KB Output is correct
2 Correct 17 ms 28492 KB Output is correct
3 Correct 15 ms 28204 KB Output is correct
4 Correct 16 ms 28480 KB Output is correct
5 Correct 15 ms 28284 KB Output is correct
6 Correct 16 ms 28316 KB Output is correct
7 Correct 22 ms 28584 KB Output is correct
8 Correct 18 ms 28536 KB Output is correct
9 Correct 18 ms 28492 KB Output is correct
10 Correct 17 ms 28492 KB Output is correct
11 Correct 20 ms 28528 KB Output is correct
12 Correct 17 ms 28480 KB Output is correct
13 Correct 16 ms 28268 KB Output is correct
14 Correct 16 ms 28424 KB Output is correct
15 Correct 16 ms 28204 KB Output is correct
16 Correct 19 ms 28372 KB Output is correct
17 Correct 16 ms 28364 KB Output is correct
18 Correct 17 ms 28492 KB Output is correct
19 Correct 19 ms 28400 KB Output is correct
20 Correct 20 ms 28532 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 17 ms 28364 KB Output is correct
2 Correct 17 ms 28492 KB Output is correct
3 Correct 15 ms 28204 KB Output is correct
4 Correct 16 ms 28480 KB Output is correct
5 Correct 15 ms 28284 KB Output is correct
6 Correct 16 ms 28316 KB Output is correct
7 Correct 22 ms 28584 KB Output is correct
8 Correct 18 ms 28536 KB Output is correct
9 Correct 18 ms 28492 KB Output is correct
10 Correct 17 ms 28492 KB Output is correct
11 Correct 20 ms 28528 KB Output is correct
12 Correct 17 ms 28480 KB Output is correct
13 Correct 16 ms 28268 KB Output is correct
14 Correct 16 ms 28424 KB Output is correct
15 Correct 16 ms 28204 KB Output is correct
16 Correct 19 ms 28372 KB Output is correct
17 Correct 16 ms 28364 KB Output is correct
18 Correct 17 ms 28492 KB Output is correct
19 Correct 19 ms 28400 KB Output is correct
20 Correct 20 ms 28532 KB Output is correct
21 Correct 17 ms 28404 KB Output is correct
22 Correct 17 ms 28540 KB Output is correct
23 Correct 17 ms 28404 KB Output is correct
24 Correct 17 ms 28504 KB Output is correct
25 Correct 16 ms 28364 KB Output is correct
26 Correct 16 ms 28364 KB Output is correct
27 Correct 18 ms 28492 KB Output is correct
28 Correct 20 ms 28500 KB Output is correct
29 Correct 17 ms 28440 KB Output is correct
30 Correct 16 ms 28492 KB Output is correct
31 Correct 17 ms 28452 KB Output is correct
32 Correct 17 ms 28492 KB Output is correct
33 Correct 16 ms 28388 KB Output is correct
34 Correct 17 ms 28452 KB Output is correct
35 Correct 16 ms 28328 KB Output is correct
36 Correct 17 ms 28492 KB Output is correct
37 Correct 17 ms 28196 KB Output is correct
38 Correct 17 ms 28504 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 163 ms 53608 KB Output is correct
2 Correct 178 ms 53684 KB Output is correct
3 Correct 168 ms 53616 KB Output is correct
4 Correct 170 ms 53560 KB Output is correct
5 Correct 180 ms 53748 KB Output is correct
6 Correct 190 ms 53700 KB Output is correct
7 Correct 77 ms 49496 KB Output is correct
8 Correct 80 ms 49856 KB Output is correct
9 Correct 160 ms 53548 KB Output is correct
10 Correct 158 ms 53608 KB Output is correct
11 Correct 158 ms 53608 KB Output is correct
12 Correct 167 ms 53608 KB Output is correct
13 Correct 161 ms 50668 KB Output is correct
14 Correct 158 ms 53524 KB Output is correct
15 Correct 179 ms 52980 KB Output is correct
16 Correct 182 ms 53680 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 768 ms 119848 KB Output is correct
2 Correct 587 ms 101492 KB Output is correct
3 Correct 870 ms 128188 KB Output is correct
4 Correct 623 ms 100628 KB Output is correct
5 Correct 657 ms 101708 KB Output is correct
6 Correct 866 ms 127940 KB Output is correct
7 Correct 283 ms 118708 KB Output is correct
8 Correct 312 ms 118968 KB Output is correct
9 Correct 902 ms 127480 KB Output is correct
10 Correct 876 ms 127508 KB Output is correct
11 Correct 794 ms 127684 KB Output is correct
12 Correct 793 ms 127560 KB Output is correct
13 Correct 796 ms 127584 KB Output is correct
14 Correct 845 ms 127568 KB Output is correct
15 Correct 834 ms 127412 KB Output is correct
16 Correct 833 ms 127476 KB Output is correct
17 Correct 859 ms 127556 KB Output is correct
18 Correct 797 ms 127624 KB Output is correct
19 Correct 880 ms 127592 KB Output is correct
20 Correct 865 ms 127556 KB Output is correct
21 Correct 829 ms 127536 KB Output is correct
22 Correct 872 ms 127432 KB Output is correct
23 Correct 850 ms 127600 KB Output is correct
24 Correct 831 ms 127440 KB Output is correct
25 Correct 699 ms 121484 KB Output is correct
26 Correct 718 ms 123184 KB Output is correct
27 Correct 553 ms 129760 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 17 ms 28364 KB Output is correct
2 Correct 17 ms 28492 KB Output is correct
3 Correct 15 ms 28204 KB Output is correct
4 Correct 16 ms 28480 KB Output is correct
5 Correct 15 ms 28284 KB Output is correct
6 Correct 16 ms 28316 KB Output is correct
7 Correct 22 ms 28584 KB Output is correct
8 Correct 18 ms 28536 KB Output is correct
9 Correct 18 ms 28492 KB Output is correct
10 Correct 17 ms 28492 KB Output is correct
11 Correct 20 ms 28528 KB Output is correct
12 Correct 17 ms 28480 KB Output is correct
13 Correct 16 ms 28268 KB Output is correct
14 Correct 16 ms 28424 KB Output is correct
15 Correct 16 ms 28204 KB Output is correct
16 Correct 19 ms 28372 KB Output is correct
17 Correct 16 ms 28364 KB Output is correct
18 Correct 17 ms 28492 KB Output is correct
19 Correct 19 ms 28400 KB Output is correct
20 Correct 20 ms 28532 KB Output is correct
21 Correct 163 ms 53608 KB Output is correct
22 Correct 178 ms 53684 KB Output is correct
23 Correct 168 ms 53616 KB Output is correct
24 Correct 170 ms 53560 KB Output is correct
25 Correct 180 ms 53748 KB Output is correct
26 Correct 190 ms 53700 KB Output is correct
27 Correct 77 ms 49496 KB Output is correct
28 Correct 80 ms 49856 KB Output is correct
29 Correct 160 ms 53548 KB Output is correct
30 Correct 158 ms 53608 KB Output is correct
31 Correct 158 ms 53608 KB Output is correct
32 Correct 167 ms 53608 KB Output is correct
33 Correct 161 ms 50668 KB Output is correct
34 Correct 158 ms 53524 KB Output is correct
35 Correct 179 ms 52980 KB Output is correct
36 Correct 182 ms 53680 KB Output is correct
37 Correct 156 ms 50648 KB Output is correct
38 Correct 142 ms 48048 KB Output is correct
39 Correct 67 ms 46772 KB Output is correct
40 Correct 79 ms 49320 KB Output is correct
41 Correct 162 ms 53232 KB Output is correct
42 Correct 173 ms 53248 KB Output is correct
43 Correct 176 ms 53152 KB Output is correct
44 Correct 162 ms 53188 KB Output is correct
45 Correct 208 ms 53240 KB Output is correct
46 Correct 181 ms 53156 KB Output is correct
47 Correct 103 ms 51680 KB Output is correct
48 Correct 151 ms 51984 KB Output is correct
49 Correct 122 ms 45812 KB Output is correct
50 Correct 153 ms 49432 KB Output is correct
51 Correct 169 ms 53316 KB Output is correct
52 Correct 191 ms 53288 KB Output is correct
53 Correct 135 ms 48080 KB Output is correct
54 Correct 179 ms 53664 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 162 ms 51104 KB Output is correct
2 Correct 176 ms 53496 KB Output is correct
3 Correct 175 ms 53992 KB Output is correct
4 Correct 118 ms 46188 KB Output is correct
5 Correct 159 ms 50288 KB Output is correct
6 Correct 175 ms 53828 KB Output is correct
7 Correct 79 ms 49040 KB Output is correct
8 Correct 82 ms 47684 KB Output is correct
9 Correct 109 ms 52592 KB Output is correct
10 Correct 108 ms 45004 KB Output is correct
11 Correct 157 ms 52804 KB Output is correct
12 Correct 161 ms 52804 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 17 ms 28364 KB Output is correct
2 Correct 17 ms 28492 KB Output is correct
3 Correct 15 ms 28204 KB Output is correct
4 Correct 16 ms 28480 KB Output is correct
5 Correct 15 ms 28284 KB Output is correct
6 Correct 16 ms 28316 KB Output is correct
7 Correct 22 ms 28584 KB Output is correct
8 Correct 18 ms 28536 KB Output is correct
9 Correct 18 ms 28492 KB Output is correct
10 Correct 17 ms 28492 KB Output is correct
11 Correct 20 ms 28528 KB Output is correct
12 Correct 17 ms 28480 KB Output is correct
13 Correct 16 ms 28268 KB Output is correct
14 Correct 16 ms 28424 KB Output is correct
15 Correct 16 ms 28204 KB Output is correct
16 Correct 19 ms 28372 KB Output is correct
17 Correct 16 ms 28364 KB Output is correct
18 Correct 17 ms 28492 KB Output is correct
19 Correct 19 ms 28400 KB Output is correct
20 Correct 20 ms 28532 KB Output is correct
21 Correct 17 ms 28404 KB Output is correct
22 Correct 17 ms 28540 KB Output is correct
23 Correct 17 ms 28404 KB Output is correct
24 Correct 17 ms 28504 KB Output is correct
25 Correct 16 ms 28364 KB Output is correct
26 Correct 16 ms 28364 KB Output is correct
27 Correct 18 ms 28492 KB Output is correct
28 Correct 20 ms 28500 KB Output is correct
29 Correct 17 ms 28440 KB Output is correct
30 Correct 16 ms 28492 KB Output is correct
31 Correct 17 ms 28452 KB Output is correct
32 Correct 17 ms 28492 KB Output is correct
33 Correct 16 ms 28388 KB Output is correct
34 Correct 17 ms 28452 KB Output is correct
35 Correct 16 ms 28328 KB Output is correct
36 Correct 17 ms 28492 KB Output is correct
37 Correct 17 ms 28196 KB Output is correct
38 Correct 17 ms 28504 KB Output is correct
39 Correct 163 ms 53608 KB Output is correct
40 Correct 178 ms 53684 KB Output is correct
41 Correct 168 ms 53616 KB Output is correct
42 Correct 170 ms 53560 KB Output is correct
43 Correct 180 ms 53748 KB Output is correct
44 Correct 190 ms 53700 KB Output is correct
45 Correct 77 ms 49496 KB Output is correct
46 Correct 80 ms 49856 KB Output is correct
47 Correct 160 ms 53548 KB Output is correct
48 Correct 158 ms 53608 KB Output is correct
49 Correct 158 ms 53608 KB Output is correct
50 Correct 167 ms 53608 KB Output is correct
51 Correct 161 ms 50668 KB Output is correct
52 Correct 158 ms 53524 KB Output is correct
53 Correct 179 ms 52980 KB Output is correct
54 Correct 182 ms 53680 KB Output is correct
55 Correct 156 ms 50648 KB Output is correct
56 Correct 142 ms 48048 KB Output is correct
57 Correct 67 ms 46772 KB Output is correct
58 Correct 79 ms 49320 KB Output is correct
59 Correct 162 ms 53232 KB Output is correct
60 Correct 173 ms 53248 KB Output is correct
61 Correct 176 ms 53152 KB Output is correct
62 Correct 162 ms 53188 KB Output is correct
63 Correct 208 ms 53240 KB Output is correct
64 Correct 181 ms 53156 KB Output is correct
65 Correct 103 ms 51680 KB Output is correct
66 Correct 151 ms 51984 KB Output is correct
67 Correct 122 ms 45812 KB Output is correct
68 Correct 153 ms 49432 KB Output is correct
69 Correct 169 ms 53316 KB Output is correct
70 Correct 191 ms 53288 KB Output is correct
71 Correct 135 ms 48080 KB Output is correct
72 Correct 179 ms 53664 KB Output is correct
73 Correct 162 ms 51104 KB Output is correct
74 Correct 176 ms 53496 KB Output is correct
75 Correct 175 ms 53992 KB Output is correct
76 Correct 118 ms 46188 KB Output is correct
77 Correct 159 ms 50288 KB Output is correct
78 Correct 175 ms 53828 KB Output is correct
79 Correct 79 ms 49040 KB Output is correct
80 Correct 82 ms 47684 KB Output is correct
81 Correct 109 ms 52592 KB Output is correct
82 Correct 108 ms 45004 KB Output is correct
83 Correct 157 ms 52804 KB Output is correct
84 Correct 161 ms 52804 KB Output is correct
85 Correct 161 ms 51520 KB Output is correct
86 Correct 172 ms 53940 KB Output is correct
87 Correct 160 ms 50532 KB Output is correct
88 Correct 183 ms 53864 KB Output is correct
89 Correct 102 ms 45312 KB Output is correct
90 Correct 165 ms 53704 KB Output is correct
91 Correct 140 ms 49040 KB Output is correct
92 Correct 134 ms 47940 KB Output is correct
93 Correct 181 ms 53764 KB Output is correct
94 Correct 163 ms 53712 KB Output is correct
95 Correct 169 ms 53068 KB Output is correct
96 Correct 165 ms 53688 KB Output is correct
97 Correct 166 ms 53668 KB Output is correct
98 Correct 152 ms 49888 KB Output is correct
99 Correct 99 ms 52192 KB Output is correct
100 Correct 120 ms 48720 KB Output is correct
101 Correct 158 ms 52512 KB Output is correct
102 Correct 123 ms 54428 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 17 ms 28364 KB Output is correct
2 Correct 17 ms 28492 KB Output is correct
3 Correct 15 ms 28204 KB Output is correct
4 Correct 16 ms 28480 KB Output is correct
5 Correct 15 ms 28284 KB Output is correct
6 Correct 16 ms 28316 KB Output is correct
7 Correct 22 ms 28584 KB Output is correct
8 Correct 18 ms 28536 KB Output is correct
9 Correct 18 ms 28492 KB Output is correct
10 Correct 17 ms 28492 KB Output is correct
11 Correct 20 ms 28528 KB Output is correct
12 Correct 17 ms 28480 KB Output is correct
13 Correct 16 ms 28268 KB Output is correct
14 Correct 16 ms 28424 KB Output is correct
15 Correct 16 ms 28204 KB Output is correct
16 Correct 19 ms 28372 KB Output is correct
17 Correct 16 ms 28364 KB Output is correct
18 Correct 17 ms 28492 KB Output is correct
19 Correct 19 ms 28400 KB Output is correct
20 Correct 20 ms 28532 KB Output is correct
21 Correct 17 ms 28404 KB Output is correct
22 Correct 17 ms 28540 KB Output is correct
23 Correct 17 ms 28404 KB Output is correct
24 Correct 17 ms 28504 KB Output is correct
25 Correct 16 ms 28364 KB Output is correct
26 Correct 16 ms 28364 KB Output is correct
27 Correct 18 ms 28492 KB Output is correct
28 Correct 20 ms 28500 KB Output is correct
29 Correct 17 ms 28440 KB Output is correct
30 Correct 16 ms 28492 KB Output is correct
31 Correct 17 ms 28452 KB Output is correct
32 Correct 17 ms 28492 KB Output is correct
33 Correct 16 ms 28388 KB Output is correct
34 Correct 17 ms 28452 KB Output is correct
35 Correct 16 ms 28328 KB Output is correct
36 Correct 17 ms 28492 KB Output is correct
37 Correct 17 ms 28196 KB Output is correct
38 Correct 17 ms 28504 KB Output is correct
39 Correct 163 ms 53608 KB Output is correct
40 Correct 178 ms 53684 KB Output is correct
41 Correct 168 ms 53616 KB Output is correct
42 Correct 170 ms 53560 KB Output is correct
43 Correct 180 ms 53748 KB Output is correct
44 Correct 190 ms 53700 KB Output is correct
45 Correct 77 ms 49496 KB Output is correct
46 Correct 80 ms 49856 KB Output is correct
47 Correct 160 ms 53548 KB Output is correct
48 Correct 158 ms 53608 KB Output is correct
49 Correct 158 ms 53608 KB Output is correct
50 Correct 167 ms 53608 KB Output is correct
51 Correct 161 ms 50668 KB Output is correct
52 Correct 158 ms 53524 KB Output is correct
53 Correct 179 ms 52980 KB Output is correct
54 Correct 182 ms 53680 KB Output is correct
55 Correct 768 ms 119848 KB Output is correct
56 Correct 587 ms 101492 KB Output is correct
57 Correct 870 ms 128188 KB Output is correct
58 Correct 623 ms 100628 KB Output is correct
59 Correct 657 ms 101708 KB Output is correct
60 Correct 866 ms 127940 KB Output is correct
61 Correct 283 ms 118708 KB Output is correct
62 Correct 312 ms 118968 KB Output is correct
63 Correct 902 ms 127480 KB Output is correct
64 Correct 876 ms 127508 KB Output is correct
65 Correct 794 ms 127684 KB Output is correct
66 Correct 793 ms 127560 KB Output is correct
67 Correct 796 ms 127584 KB Output is correct
68 Correct 845 ms 127568 KB Output is correct
69 Correct 834 ms 127412 KB Output is correct
70 Correct 833 ms 127476 KB Output is correct
71 Correct 859 ms 127556 KB Output is correct
72 Correct 797 ms 127624 KB Output is correct
73 Correct 880 ms 127592 KB Output is correct
74 Correct 865 ms 127556 KB Output is correct
75 Correct 829 ms 127536 KB Output is correct
76 Correct 872 ms 127432 KB Output is correct
77 Correct 850 ms 127600 KB Output is correct
78 Correct 831 ms 127440 KB Output is correct
79 Correct 699 ms 121484 KB Output is correct
80 Correct 718 ms 123184 KB Output is correct
81 Correct 553 ms 129760 KB Output is correct
82 Correct 156 ms 50648 KB Output is correct
83 Correct 142 ms 48048 KB Output is correct
84 Correct 67 ms 46772 KB Output is correct
85 Correct 79 ms 49320 KB Output is correct
86 Correct 162 ms 53232 KB Output is correct
87 Correct 173 ms 53248 KB Output is correct
88 Correct 176 ms 53152 KB Output is correct
89 Correct 162 ms 53188 KB Output is correct
90 Correct 208 ms 53240 KB Output is correct
91 Correct 181 ms 53156 KB Output is correct
92 Correct 103 ms 51680 KB Output is correct
93 Correct 151 ms 51984 KB Output is correct
94 Correct 122 ms 45812 KB Output is correct
95 Correct 153 ms 49432 KB Output is correct
96 Correct 169 ms 53316 KB Output is correct
97 Correct 191 ms 53288 KB Output is correct
98 Correct 135 ms 48080 KB Output is correct
99 Correct 179 ms 53664 KB Output is correct
100 Correct 162 ms 51104 KB Output is correct
101 Correct 176 ms 53496 KB Output is correct
102 Correct 175 ms 53992 KB Output is correct
103 Correct 118 ms 46188 KB Output is correct
104 Correct 159 ms 50288 KB Output is correct
105 Correct 175 ms 53828 KB Output is correct
106 Correct 79 ms 49040 KB Output is correct
107 Correct 82 ms 47684 KB Output is correct
108 Correct 109 ms 52592 KB Output is correct
109 Correct 108 ms 45004 KB Output is correct
110 Correct 157 ms 52804 KB Output is correct
111 Correct 161 ms 52804 KB Output is correct
112 Correct 161 ms 51520 KB Output is correct
113 Correct 172 ms 53940 KB Output is correct
114 Correct 160 ms 50532 KB Output is correct
115 Correct 183 ms 53864 KB Output is correct
116 Correct 102 ms 45312 KB Output is correct
117 Correct 165 ms 53704 KB Output is correct
118 Correct 140 ms 49040 KB Output is correct
119 Correct 134 ms 47940 KB Output is correct
120 Correct 181 ms 53764 KB Output is correct
121 Correct 163 ms 53712 KB Output is correct
122 Correct 169 ms 53068 KB Output is correct
123 Correct 165 ms 53688 KB Output is correct
124 Correct 166 ms 53668 KB Output is correct
125 Correct 152 ms 49888 KB Output is correct
126 Correct 99 ms 52192 KB Output is correct
127 Correct 120 ms 48720 KB Output is correct
128 Correct 158 ms 52512 KB Output is correct
129 Correct 123 ms 54428 KB Output is correct
130 Correct 862 ms 128680 KB Output is correct
131 Correct 569 ms 101288 KB Output is correct
132 Correct 866 ms 128740 KB Output is correct
133 Correct 836 ms 124204 KB Output is correct
134 Correct 718 ms 113868 KB Output is correct
135 Correct 875 ms 128716 KB Output is correct
136 Correct 851 ms 128416 KB Output is correct
137 Correct 838 ms 128484 KB Output is correct
138 Correct 760 ms 128452 KB Output is correct
139 Correct 807 ms 128340 KB Output is correct
140 Correct 796 ms 128196 KB Output is correct
141 Correct 847 ms 128212 KB Output is correct
142 Correct 879 ms 128204 KB Output is correct
143 Correct 867 ms 128204 KB Output is correct
144 Correct 923 ms 128316 KB Output is correct
145 Correct 817 ms 128176 KB Output is correct
146 Correct 841 ms 128312 KB Output is correct
147 Correct 854 ms 128104 KB Output is correct
148 Correct 843 ms 128208 KB Output is correct
149 Correct 876 ms 128104 KB Output is correct
150 Correct 438 ms 122392 KB Output is correct
151 Correct 759 ms 123844 KB Output is correct
152 Correct 781 ms 123784 KB Output is correct
153 Correct 579 ms 130716 KB Output is correct