답안 #475328

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
475328 2021-09-21T20:48:24 Z nafis_shifat 푸드 코트 (JOI21_foodcourt) C++14
100 / 100
914 ms 68100 KB
#include<bits/stdc++.h>
#define ll long long
#define pii pair<ll,ll>
#define f first
#define s second
using namespace std;
const int mxn=3e5+5;
const int inf=1e9;

int n,m,q;


struct segtree {
    
    ll removed[4 * mxn] = {};
    ll added[4 * mxn] = {};
    pii tree[4 * mxn];

    void init(int n) {
        for(int i = 0; i < 4 * mxn; i++) tree[i] = {0,0};
    }

    pii merge(pii a, pii b) {
        return { b.f + max(0ll, a.f - b.s), a.s + max(0ll,b.s - a.f) };
    }


    void propogate(int node) {
        int left = node << 1;
        int right = left | 1;

        removed[left] += min(tree[node].f,tree[left].s);
        removed[right] += min(tree[node].f,tree[right].s);

        tree[left] = merge(tree[node], tree[left]);
        tree[right] = merge(tree[node], tree[right]);

        removed[left] += removed[node];
        removed[right] += removed[node];
        removed[node] = 0;

        

        added[left] += added[node];
        added[right] += added[node];
        added[node] = 0;

        tree[node] = {0,0};
    }

    void update(int node,int b,int e,int l,int r, pii v) {
        if(e < l || b > r) return;
        if(b >= l && e <= r) {

            removed[node] += min(v.first, tree[node].s);
            added[node] += v.s;
            tree[node] = merge(v, tree[node]);
            // cout<<"After update ("<<b<<" "<<e<<") ("<<v.f<<" - "<<v.s<<") ("<<tree[node].f<<" "<<tree[node].s<<") "<<removed[node]<<endl;
            return;
        }
        propogate(node);

        int mid = b + e >>1;
        int left = node << 1;
        int right = left | 1;

        update(left, b, mid, l, r, v);
        update(right, mid + 1, e, l, r, v);
    }

    int query(int node,int b,int e,int p) {
        if(b == e) return node;

        int mid = b + e >> 1;
        int left = node << 1;
        int right = left | 1;

        propogate(node);

        if(p <= mid) return query(left,b,mid,p);
        return query(right, mid + 1,e,p);
    }
} st;

int type[mxn],l[mxn],r[mxn],c[mxn];
ll k[mxn];

ll a[mxn],b[mxn];
int res[mxn];

ll pos[mxn];


int lo[mxn],hi[mxn];

struct BIT
{
    ll bit[mxn] = {};
    void init() {
        memset(bit,0,sizeof bit);
    }

    void update(int p,ll v) {
        if(p==0) return;
        for(;p < mxn; p += p & -p) bit[p] += v;
    }

    ll query(int p) {
        ll r = 0;
        for(;p > 0; p -= p & -p) r += bit[p];
        return r;
    }

    void add(int l,int r,ll x) {
        update(l,x);
        update(r + 1, - x);
    }
} bt;
int main() {
    memset(c, -1, sizeof c);
    memset(res,-1,sizeof res);
    cin >> n >> m >> q;
    st.init(n);


    for(int i = 1; i <= q; i++) {
        scanf("%d",&type[i]);

        if(type[i] == 1) {
            scanf("%d%d%d %lld",&l[i],&r[i],&c[i],&k[i]);
            st.update(1,1,n,l[i],r[i],{0,k[i]});
        } else if(type[i] == 2) {
            scanf("%d%d %lld",&l[i],&r[i],&k[i]);
            st.update(1,1,n,l[i],r[i],{k[i],0});

        } else {
            scanf("%lld %lld",&a[i],&b[i]);

            int node = st.query(1,1,n,a[i]);
            if(st.tree[node].s >= b[i]) {
                pos[i] = st.removed[node] + b[i];
            }
            else res[i] = 0;
        }
    }

    vector<int> mid[q + 1];

    for(int i = 1; i <= q; i++) {
        lo[i] = 1;
        hi[i] = q;
    }

    for(int x = 1; x <= 22; x++) {
        bt.init();
        for(int i = 1; i <= q; i++) mid[i].clear();

        for(int i = 1; i <= q; i++) {
            if(type[i] == 3 && res[i] != 0 && lo[i] <= hi[i]) {
                mid[(lo[i] + hi[i] >> 1)].push_back(i);
            }
        }

        for(int i = 1; i <= q; i++) {
            if(type[i] == 1) {
                bt.add(l[i],r[i],k[i]);
            }

            for(int p : mid[i]) {
                ll val = bt.query(a[p]);
                if(val >= pos[p]) {
                    res[p] = c[i];
                    hi[p] = i - 1;
                } else {
                    lo[p] = i + 1;
                }
            }
        }


    }

    for(int i = 1; i <= q; i++) {
        if(type[i] == 3) printf("%d\n",res[i]);
    }





    


}

Compilation message

foodcourt.cpp: In member function 'void segtree::update(int, int, int, int, int, std::pair<long long int, long long int>)':
foodcourt.cpp:63:21: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   63 |         int mid = b + e >>1;
      |                   ~~^~~
foodcourt.cpp: In member function 'int segtree::query(int, int, int, int)':
foodcourt.cpp:74:21: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   74 |         int mid = b + e >> 1;
      |                   ~~^~~
foodcourt.cpp: In function 'int main()':
foodcourt.cpp:160:28: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
  160 |                 mid[(lo[i] + hi[i] >> 1)].push_back(i);
      |                      ~~~~~~^~~~~~~
foodcourt.cpp:127:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
  127 |         scanf("%d",&type[i]);
      |         ~~~~~^~~~~~~~~~~~~~~
foodcourt.cpp:130:18: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
  130 |             scanf("%d%d%d %lld",&l[i],&r[i],&c[i],&k[i]);
      |             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
foodcourt.cpp:133:18: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
  133 |             scanf("%d%d %lld",&l[i],&r[i],&k[i]);
      |             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
foodcourt.cpp:137:18: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
  137 |             scanf("%lld %lld",&a[i],&b[i]);
      |             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 16 ms 23972 KB Output is correct
2 Correct 17 ms 24004 KB Output is correct
3 Correct 15 ms 23960 KB Output is correct
4 Correct 17 ms 24068 KB Output is correct
5 Correct 16 ms 23944 KB Output is correct
6 Correct 15 ms 23884 KB Output is correct
7 Correct 16 ms 24012 KB Output is correct
8 Correct 17 ms 24056 KB Output is correct
9 Correct 16 ms 24012 KB Output is correct
10 Correct 17 ms 23996 KB Output is correct
11 Correct 17 ms 24064 KB Output is correct
12 Correct 16 ms 24000 KB Output is correct
13 Correct 15 ms 23956 KB Output is correct
14 Correct 16 ms 24012 KB Output is correct
15 Correct 17 ms 24020 KB Output is correct
16 Correct 17 ms 24096 KB Output is correct
17 Correct 17 ms 24024 KB Output is correct
18 Correct 17 ms 24012 KB Output is correct
19 Correct 17 ms 24012 KB Output is correct
20 Correct 18 ms 23960 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 16 ms 23972 KB Output is correct
2 Correct 17 ms 24004 KB Output is correct
3 Correct 15 ms 23960 KB Output is correct
4 Correct 17 ms 24068 KB Output is correct
5 Correct 16 ms 23944 KB Output is correct
6 Correct 15 ms 23884 KB Output is correct
7 Correct 16 ms 24012 KB Output is correct
8 Correct 17 ms 24056 KB Output is correct
9 Correct 16 ms 24012 KB Output is correct
10 Correct 17 ms 23996 KB Output is correct
11 Correct 17 ms 24064 KB Output is correct
12 Correct 16 ms 24000 KB Output is correct
13 Correct 15 ms 23956 KB Output is correct
14 Correct 16 ms 24012 KB Output is correct
15 Correct 17 ms 24020 KB Output is correct
16 Correct 17 ms 24096 KB Output is correct
17 Correct 17 ms 24024 KB Output is correct
18 Correct 17 ms 24012 KB Output is correct
19 Correct 17 ms 24012 KB Output is correct
20 Correct 18 ms 23960 KB Output is correct
21 Correct 16 ms 23960 KB Output is correct
22 Correct 17 ms 24096 KB Output is correct
23 Correct 17 ms 24012 KB Output is correct
24 Correct 17 ms 24092 KB Output is correct
25 Correct 18 ms 23884 KB Output is correct
26 Correct 16 ms 24012 KB Output is correct
27 Correct 17 ms 24088 KB Output is correct
28 Correct 16 ms 24012 KB Output is correct
29 Correct 17 ms 24068 KB Output is correct
30 Correct 17 ms 24012 KB Output is correct
31 Correct 17 ms 23992 KB Output is correct
32 Correct 16 ms 24068 KB Output is correct
33 Correct 15 ms 24012 KB Output is correct
34 Correct 16 ms 24028 KB Output is correct
35 Correct 16 ms 24012 KB Output is correct
36 Correct 17 ms 24048 KB Output is correct
37 Correct 16 ms 24012 KB Output is correct
38 Correct 18 ms 24076 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 127 ms 30276 KB Output is correct
2 Correct 144 ms 30240 KB Output is correct
3 Correct 136 ms 30200 KB Output is correct
4 Correct 128 ms 30340 KB Output is correct
5 Correct 143 ms 30276 KB Output is correct
6 Correct 142 ms 30288 KB Output is correct
7 Correct 113 ms 29348 KB Output is correct
8 Correct 117 ms 29440 KB Output is correct
9 Correct 138 ms 31824 KB Output is correct
10 Correct 132 ms 31428 KB Output is correct
11 Correct 143 ms 31744 KB Output is correct
12 Correct 157 ms 31456 KB Output is correct
13 Correct 140 ms 32032 KB Output is correct
14 Correct 158 ms 32808 KB Output is correct
15 Correct 160 ms 31916 KB Output is correct
16 Correct 166 ms 32020 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 681 ms 55868 KB Output is correct
2 Correct 549 ms 51300 KB Output is correct
3 Correct 751 ms 57976 KB Output is correct
4 Correct 630 ms 49924 KB Output is correct
5 Correct 619 ms 50504 KB Output is correct
6 Correct 812 ms 56876 KB Output is correct
7 Correct 473 ms 50048 KB Output is correct
8 Correct 481 ms 49904 KB Output is correct
9 Correct 864 ms 61152 KB Output is correct
10 Correct 855 ms 61176 KB Output is correct
11 Correct 730 ms 56080 KB Output is correct
12 Correct 763 ms 56672 KB Output is correct
13 Correct 716 ms 56056 KB Output is correct
14 Correct 756 ms 56764 KB Output is correct
15 Correct 755 ms 56772 KB Output is correct
16 Correct 756 ms 56584 KB Output is correct
17 Correct 744 ms 57104 KB Output is correct
18 Correct 741 ms 56556 KB Output is correct
19 Correct 777 ms 56844 KB Output is correct
20 Correct 728 ms 56476 KB Output is correct
21 Correct 716 ms 56788 KB Output is correct
22 Correct 710 ms 57024 KB Output is correct
23 Correct 776 ms 56840 KB Output is correct
24 Correct 722 ms 56900 KB Output is correct
25 Correct 616 ms 57912 KB Output is correct
26 Correct 644 ms 58308 KB Output is correct
27 Correct 699 ms 52572 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 16 ms 23972 KB Output is correct
2 Correct 17 ms 24004 KB Output is correct
3 Correct 15 ms 23960 KB Output is correct
4 Correct 17 ms 24068 KB Output is correct
5 Correct 16 ms 23944 KB Output is correct
6 Correct 15 ms 23884 KB Output is correct
7 Correct 16 ms 24012 KB Output is correct
8 Correct 17 ms 24056 KB Output is correct
9 Correct 16 ms 24012 KB Output is correct
10 Correct 17 ms 23996 KB Output is correct
11 Correct 17 ms 24064 KB Output is correct
12 Correct 16 ms 24000 KB Output is correct
13 Correct 15 ms 23956 KB Output is correct
14 Correct 16 ms 24012 KB Output is correct
15 Correct 17 ms 24020 KB Output is correct
16 Correct 17 ms 24096 KB Output is correct
17 Correct 17 ms 24024 KB Output is correct
18 Correct 17 ms 24012 KB Output is correct
19 Correct 17 ms 24012 KB Output is correct
20 Correct 18 ms 23960 KB Output is correct
21 Correct 127 ms 30276 KB Output is correct
22 Correct 144 ms 30240 KB Output is correct
23 Correct 136 ms 30200 KB Output is correct
24 Correct 128 ms 30340 KB Output is correct
25 Correct 143 ms 30276 KB Output is correct
26 Correct 142 ms 30288 KB Output is correct
27 Correct 113 ms 29348 KB Output is correct
28 Correct 117 ms 29440 KB Output is correct
29 Correct 138 ms 31824 KB Output is correct
30 Correct 132 ms 31428 KB Output is correct
31 Correct 143 ms 31744 KB Output is correct
32 Correct 157 ms 31456 KB Output is correct
33 Correct 140 ms 32032 KB Output is correct
34 Correct 158 ms 32808 KB Output is correct
35 Correct 160 ms 31916 KB Output is correct
36 Correct 166 ms 32020 KB Output is correct
37 Correct 148 ms 32768 KB Output is correct
38 Correct 137 ms 31828 KB Output is correct
39 Correct 111 ms 29556 KB Output is correct
40 Correct 122 ms 30540 KB Output is correct
41 Correct 163 ms 33152 KB Output is correct
42 Correct 154 ms 33344 KB Output is correct
43 Correct 159 ms 33300 KB Output is correct
44 Correct 166 ms 33344 KB Output is correct
45 Correct 181 ms 33264 KB Output is correct
46 Correct 160 ms 33368 KB Output is correct
47 Correct 122 ms 33404 KB Output is correct
48 Correct 154 ms 33544 KB Output is correct
49 Correct 121 ms 30948 KB Output is correct
50 Correct 133 ms 31976 KB Output is correct
51 Correct 158 ms 33220 KB Output is correct
52 Correct 156 ms 33220 KB Output is correct
53 Correct 145 ms 30700 KB Output is correct
54 Correct 181 ms 32012 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 163 ms 32500 KB Output is correct
2 Correct 199 ms 34876 KB Output is correct
3 Correct 199 ms 35032 KB Output is correct
4 Correct 136 ms 32356 KB Output is correct
5 Correct 174 ms 33724 KB Output is correct
6 Correct 198 ms 35184 KB Output is correct
7 Correct 153 ms 31808 KB Output is correct
8 Correct 141 ms 31172 KB Output is correct
9 Correct 160 ms 34904 KB Output is correct
10 Correct 128 ms 32068 KB Output is correct
11 Correct 182 ms 34992 KB Output is correct
12 Correct 185 ms 35052 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 16 ms 23972 KB Output is correct
2 Correct 17 ms 24004 KB Output is correct
3 Correct 15 ms 23960 KB Output is correct
4 Correct 17 ms 24068 KB Output is correct
5 Correct 16 ms 23944 KB Output is correct
6 Correct 15 ms 23884 KB Output is correct
7 Correct 16 ms 24012 KB Output is correct
8 Correct 17 ms 24056 KB Output is correct
9 Correct 16 ms 24012 KB Output is correct
10 Correct 17 ms 23996 KB Output is correct
11 Correct 17 ms 24064 KB Output is correct
12 Correct 16 ms 24000 KB Output is correct
13 Correct 15 ms 23956 KB Output is correct
14 Correct 16 ms 24012 KB Output is correct
15 Correct 17 ms 24020 KB Output is correct
16 Correct 17 ms 24096 KB Output is correct
17 Correct 17 ms 24024 KB Output is correct
18 Correct 17 ms 24012 KB Output is correct
19 Correct 17 ms 24012 KB Output is correct
20 Correct 18 ms 23960 KB Output is correct
21 Correct 16 ms 23960 KB Output is correct
22 Correct 17 ms 24096 KB Output is correct
23 Correct 17 ms 24012 KB Output is correct
24 Correct 17 ms 24092 KB Output is correct
25 Correct 18 ms 23884 KB Output is correct
26 Correct 16 ms 24012 KB Output is correct
27 Correct 17 ms 24088 KB Output is correct
28 Correct 16 ms 24012 KB Output is correct
29 Correct 17 ms 24068 KB Output is correct
30 Correct 17 ms 24012 KB Output is correct
31 Correct 17 ms 23992 KB Output is correct
32 Correct 16 ms 24068 KB Output is correct
33 Correct 15 ms 24012 KB Output is correct
34 Correct 16 ms 24028 KB Output is correct
35 Correct 16 ms 24012 KB Output is correct
36 Correct 17 ms 24048 KB Output is correct
37 Correct 16 ms 24012 KB Output is correct
38 Correct 18 ms 24076 KB Output is correct
39 Correct 127 ms 30276 KB Output is correct
40 Correct 144 ms 30240 KB Output is correct
41 Correct 136 ms 30200 KB Output is correct
42 Correct 128 ms 30340 KB Output is correct
43 Correct 143 ms 30276 KB Output is correct
44 Correct 142 ms 30288 KB Output is correct
45 Correct 113 ms 29348 KB Output is correct
46 Correct 117 ms 29440 KB Output is correct
47 Correct 138 ms 31824 KB Output is correct
48 Correct 132 ms 31428 KB Output is correct
49 Correct 143 ms 31744 KB Output is correct
50 Correct 157 ms 31456 KB Output is correct
51 Correct 140 ms 32032 KB Output is correct
52 Correct 158 ms 32808 KB Output is correct
53 Correct 160 ms 31916 KB Output is correct
54 Correct 166 ms 32020 KB Output is correct
55 Correct 148 ms 32768 KB Output is correct
56 Correct 137 ms 31828 KB Output is correct
57 Correct 111 ms 29556 KB Output is correct
58 Correct 122 ms 30540 KB Output is correct
59 Correct 163 ms 33152 KB Output is correct
60 Correct 154 ms 33344 KB Output is correct
61 Correct 159 ms 33300 KB Output is correct
62 Correct 166 ms 33344 KB Output is correct
63 Correct 181 ms 33264 KB Output is correct
64 Correct 160 ms 33368 KB Output is correct
65 Correct 122 ms 33404 KB Output is correct
66 Correct 154 ms 33544 KB Output is correct
67 Correct 121 ms 30948 KB Output is correct
68 Correct 133 ms 31976 KB Output is correct
69 Correct 158 ms 33220 KB Output is correct
70 Correct 156 ms 33220 KB Output is correct
71 Correct 145 ms 30700 KB Output is correct
72 Correct 181 ms 32012 KB Output is correct
73 Correct 163 ms 32500 KB Output is correct
74 Correct 199 ms 34876 KB Output is correct
75 Correct 199 ms 35032 KB Output is correct
76 Correct 136 ms 32356 KB Output is correct
77 Correct 174 ms 33724 KB Output is correct
78 Correct 198 ms 35184 KB Output is correct
79 Correct 153 ms 31808 KB Output is correct
80 Correct 141 ms 31172 KB Output is correct
81 Correct 160 ms 34904 KB Output is correct
82 Correct 128 ms 32068 KB Output is correct
83 Correct 182 ms 34992 KB Output is correct
84 Correct 185 ms 35052 KB Output is correct
85 Correct 149 ms 33280 KB Output is correct
86 Correct 164 ms 34120 KB Output is correct
87 Correct 158 ms 32900 KB Output is correct
88 Correct 185 ms 33940 KB Output is correct
89 Correct 109 ms 31136 KB Output is correct
90 Correct 167 ms 33820 KB Output is correct
91 Correct 150 ms 32468 KB Output is correct
92 Correct 133 ms 32092 KB Output is correct
93 Correct 165 ms 33820 KB Output is correct
94 Correct 163 ms 33772 KB Output is correct
95 Correct 164 ms 33748 KB Output is correct
96 Correct 164 ms 33768 KB Output is correct
97 Correct 158 ms 33868 KB Output is correct
98 Correct 145 ms 32676 KB Output is correct
99 Correct 127 ms 33996 KB Output is correct
100 Correct 136 ms 32780 KB Output is correct
101 Correct 155 ms 34048 KB Output is correct
102 Correct 159 ms 32648 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 16 ms 23972 KB Output is correct
2 Correct 17 ms 24004 KB Output is correct
3 Correct 15 ms 23960 KB Output is correct
4 Correct 17 ms 24068 KB Output is correct
5 Correct 16 ms 23944 KB Output is correct
6 Correct 15 ms 23884 KB Output is correct
7 Correct 16 ms 24012 KB Output is correct
8 Correct 17 ms 24056 KB Output is correct
9 Correct 16 ms 24012 KB Output is correct
10 Correct 17 ms 23996 KB Output is correct
11 Correct 17 ms 24064 KB Output is correct
12 Correct 16 ms 24000 KB Output is correct
13 Correct 15 ms 23956 KB Output is correct
14 Correct 16 ms 24012 KB Output is correct
15 Correct 17 ms 24020 KB Output is correct
16 Correct 17 ms 24096 KB Output is correct
17 Correct 17 ms 24024 KB Output is correct
18 Correct 17 ms 24012 KB Output is correct
19 Correct 17 ms 24012 KB Output is correct
20 Correct 18 ms 23960 KB Output is correct
21 Correct 16 ms 23960 KB Output is correct
22 Correct 17 ms 24096 KB Output is correct
23 Correct 17 ms 24012 KB Output is correct
24 Correct 17 ms 24092 KB Output is correct
25 Correct 18 ms 23884 KB Output is correct
26 Correct 16 ms 24012 KB Output is correct
27 Correct 17 ms 24088 KB Output is correct
28 Correct 16 ms 24012 KB Output is correct
29 Correct 17 ms 24068 KB Output is correct
30 Correct 17 ms 24012 KB Output is correct
31 Correct 17 ms 23992 KB Output is correct
32 Correct 16 ms 24068 KB Output is correct
33 Correct 15 ms 24012 KB Output is correct
34 Correct 16 ms 24028 KB Output is correct
35 Correct 16 ms 24012 KB Output is correct
36 Correct 17 ms 24048 KB Output is correct
37 Correct 16 ms 24012 KB Output is correct
38 Correct 18 ms 24076 KB Output is correct
39 Correct 127 ms 30276 KB Output is correct
40 Correct 144 ms 30240 KB Output is correct
41 Correct 136 ms 30200 KB Output is correct
42 Correct 128 ms 30340 KB Output is correct
43 Correct 143 ms 30276 KB Output is correct
44 Correct 142 ms 30288 KB Output is correct
45 Correct 113 ms 29348 KB Output is correct
46 Correct 117 ms 29440 KB Output is correct
47 Correct 138 ms 31824 KB Output is correct
48 Correct 132 ms 31428 KB Output is correct
49 Correct 143 ms 31744 KB Output is correct
50 Correct 157 ms 31456 KB Output is correct
51 Correct 140 ms 32032 KB Output is correct
52 Correct 158 ms 32808 KB Output is correct
53 Correct 160 ms 31916 KB Output is correct
54 Correct 166 ms 32020 KB Output is correct
55 Correct 681 ms 55868 KB Output is correct
56 Correct 549 ms 51300 KB Output is correct
57 Correct 751 ms 57976 KB Output is correct
58 Correct 630 ms 49924 KB Output is correct
59 Correct 619 ms 50504 KB Output is correct
60 Correct 812 ms 56876 KB Output is correct
61 Correct 473 ms 50048 KB Output is correct
62 Correct 481 ms 49904 KB Output is correct
63 Correct 864 ms 61152 KB Output is correct
64 Correct 855 ms 61176 KB Output is correct
65 Correct 730 ms 56080 KB Output is correct
66 Correct 763 ms 56672 KB Output is correct
67 Correct 716 ms 56056 KB Output is correct
68 Correct 756 ms 56764 KB Output is correct
69 Correct 755 ms 56772 KB Output is correct
70 Correct 756 ms 56584 KB Output is correct
71 Correct 744 ms 57104 KB Output is correct
72 Correct 741 ms 56556 KB Output is correct
73 Correct 777 ms 56844 KB Output is correct
74 Correct 728 ms 56476 KB Output is correct
75 Correct 716 ms 56788 KB Output is correct
76 Correct 710 ms 57024 KB Output is correct
77 Correct 776 ms 56840 KB Output is correct
78 Correct 722 ms 56900 KB Output is correct
79 Correct 616 ms 57912 KB Output is correct
80 Correct 644 ms 58308 KB Output is correct
81 Correct 699 ms 52572 KB Output is correct
82 Correct 148 ms 32768 KB Output is correct
83 Correct 137 ms 31828 KB Output is correct
84 Correct 111 ms 29556 KB Output is correct
85 Correct 122 ms 30540 KB Output is correct
86 Correct 163 ms 33152 KB Output is correct
87 Correct 154 ms 33344 KB Output is correct
88 Correct 159 ms 33300 KB Output is correct
89 Correct 166 ms 33344 KB Output is correct
90 Correct 181 ms 33264 KB Output is correct
91 Correct 160 ms 33368 KB Output is correct
92 Correct 122 ms 33404 KB Output is correct
93 Correct 154 ms 33544 KB Output is correct
94 Correct 121 ms 30948 KB Output is correct
95 Correct 133 ms 31976 KB Output is correct
96 Correct 158 ms 33220 KB Output is correct
97 Correct 156 ms 33220 KB Output is correct
98 Correct 145 ms 30700 KB Output is correct
99 Correct 181 ms 32012 KB Output is correct
100 Correct 163 ms 32500 KB Output is correct
101 Correct 199 ms 34876 KB Output is correct
102 Correct 199 ms 35032 KB Output is correct
103 Correct 136 ms 32356 KB Output is correct
104 Correct 174 ms 33724 KB Output is correct
105 Correct 198 ms 35184 KB Output is correct
106 Correct 153 ms 31808 KB Output is correct
107 Correct 141 ms 31172 KB Output is correct
108 Correct 160 ms 34904 KB Output is correct
109 Correct 128 ms 32068 KB Output is correct
110 Correct 182 ms 34992 KB Output is correct
111 Correct 185 ms 35052 KB Output is correct
112 Correct 149 ms 33280 KB Output is correct
113 Correct 164 ms 34120 KB Output is correct
114 Correct 158 ms 32900 KB Output is correct
115 Correct 185 ms 33940 KB Output is correct
116 Correct 109 ms 31136 KB Output is correct
117 Correct 167 ms 33820 KB Output is correct
118 Correct 150 ms 32468 KB Output is correct
119 Correct 133 ms 32092 KB Output is correct
120 Correct 165 ms 33820 KB Output is correct
121 Correct 163 ms 33772 KB Output is correct
122 Correct 164 ms 33748 KB Output is correct
123 Correct 164 ms 33768 KB Output is correct
124 Correct 158 ms 33868 KB Output is correct
125 Correct 145 ms 32676 KB Output is correct
126 Correct 127 ms 33996 KB Output is correct
127 Correct 136 ms 32780 KB Output is correct
128 Correct 155 ms 34048 KB Output is correct
129 Correct 159 ms 32648 KB Output is correct
130 Correct 756 ms 64404 KB Output is correct
131 Correct 544 ms 56004 KB Output is correct
132 Correct 738 ms 64400 KB Output is correct
133 Correct 830 ms 62272 KB Output is correct
134 Correct 744 ms 59004 KB Output is correct
135 Correct 842 ms 63896 KB Output is correct
136 Correct 882 ms 68072 KB Output is correct
137 Correct 914 ms 68100 KB Output is correct
138 Correct 752 ms 62788 KB Output is correct
139 Correct 800 ms 63440 KB Output is correct
140 Correct 783 ms 62876 KB Output is correct
141 Correct 743 ms 63444 KB Output is correct
142 Correct 790 ms 63296 KB Output is correct
143 Correct 752 ms 63544 KB Output is correct
144 Correct 812 ms 63296 KB Output is correct
145 Correct 765 ms 63544 KB Output is correct
146 Correct 743 ms 63232 KB Output is correct
147 Correct 756 ms 63684 KB Output is correct
148 Correct 747 ms 63492 KB Output is correct
149 Correct 748 ms 63552 KB Output is correct
150 Correct 524 ms 64064 KB Output is correct
151 Correct 637 ms 64500 KB Output is correct
152 Correct 646 ms 64676 KB Output is correct
153 Correct 638 ms 59088 KB Output is correct