답안 #730985

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
730985 2023-04-26T17:34:53 Z fatemetmhr Fish 2 (JOI22_fish2) C++17
100 / 100
840 ms 16564 KB
// ~ Be Name Khoda ~
 
#include <bits/stdc++.h>
//#pragma GCC optimize ("Ofast")
//#pragma GCC target("avx2")
#pragma GCC optimize("unroll-loops,O3")
 
using namespace std;
 
typedef long long ll;
typedef pair <int, int> pii;
 
#define pb       push_back
#define mp       make_pair
#define all(x)   x.begin(), x.end()
#define fi       first
#define se       second
 
const int maxn  =  2e7   + 10;
const int maxn5 =  1e5   + 10;
const int maxnt =  5e5   + 10;
const int maxn3 =  1e3   + 10;
const int mod   =  1e9   +  7;
 
 
int a[maxn5];
int n;
vector <int> av;

namespace fen{

    ll fen[maxn5];

    inline void add(int id, ll val){
        for(++id; id < maxn5; id += id & -id)
            fen[id] += val;
    }

    inline ll get(int id){
        ll ret = 0;
        for(++id; id; id -= id & -id)
            ret += fen[id];
        return ret;
    }

    inline ll get(int l, int r){
        if(r < l || r < 0)
            return 0;
        if(l == r)
            return a[l];
        return get(r) - (l ? get(l - 1) : 0);
    }
}
 
namespace seg{
 
    pii mn[maxnt];
    int lazy[maxnt], mx[maxnt];
 
    inline pii comb(pii a, pii b){
        pii ans = min(a, b);
        if(a.fi == b.fi)
            ans.se = a.se + b.se;
        return ans;
    }
 
    void build(int l, int r, int v){
        mn[v] = {0, r - l};
        if(r - l == 1)
            return;
        int mid = (l + r) >> 1;
        build(l, mid, v * 2);
        build(mid, r, v * 2 + 1);
    }
 
    void upd(int l, int r, int id, int v){
        if(r - l == 1){
            mx[v] = a[id];
            return;
        }
        int mid = (l + r) >> 1;
        if(id < mid)
            upd(l, mid, id, v * 2);
        else
            upd(mid, r, id, v * 2 + 1);
        mx[v] = max(mx[v * 2], mx[v * 2 + 1]);
    }
 
    void add(int l, int r, int lq, int rq, int val, int v){
        if(rq <= l || r <= lq)
            return;
        if(lq <= l && r <= rq){
            lazy[v] += val;
            mn[v].fi += val;
            return;
        }
        int mid = (l + r) >> 1;
        add(l, mid, lq, rq, val, v * 2);
        add(mid, r, lq, rq, val, v * 2 + 1);
        mn[v] = comb(mn[v * 2], mn[v * 2 + 1]);
        mn[v].fi += lazy[v];
    }
 
    pii get_min(int l, int r, int lq, int rq, int v){
        if(rq <= l || r <= lq)
            return {mod, 0};
        if(lq <= l && r <= rq)
            return mn[v];
        int mid = (l + r) >> 1;
        pii ans = comb(get_min(l, mid, lq, rq, v * 2), get_min(mid, r, lq, rq, v * 2 + 1));
        ans.fi += lazy[v];
        return ans;
    }
 
    int get_first(int l, int r, int lq, int rq, ll val, int v){
        if(rq <= l || r <= lq || mx[v] < val)
            return -1;
        if(r - l == 1)
            return l;
        int mid = (l + r) >> 1;
        int ans = get_first(l, mid, lq, rq, val, v * 2);
        if(ans != -1)
            return ans;
        return get_first(mid, r, lq, rq, val, v * 2 + 1);
    }
 
    int get_last(int l, int r, int lq, int rq, ll val, int v){
        if(rq <= l || r <= lq || mx[v] < val)
            return -1;
        if(r - l == 1)
            return l;
        int mid = (l + r) >> 1;
        int ans = get_last(mid, r, lq, rq, val, v * 2 + 1);
        if(ans != -1)
            return ans;
        return get_last(l, mid, lq, rq, val, v * 2);
    }
 
}

struct segment_tree{

    ll lazy[maxnt], mx[maxnt];

    void add(int l, int r, int lq, int rq, ll val, int v){
        if(rq <= l || r <= lq)
            return;
        if(lq <= l && r <= rq){
            lazy[v] += val;
            mx[v] += val;
            return;
        }
        int mid = (l + r) >> 1;
        add(l, mid, lq, rq, val, v * 2);
        add(mid, r, lq, rq, val, v * 2 + 1);
        mx[v] = max(mx[v * 2], mx[v * 2 + 1]) + lazy[v];
    }

    int get_first(int l, int r, int lq, int rq, ll val, int v){
        if(rq <= l || r <= lq || mx[v] < val)
            return -1;
        if(r - l == 1)
            return l;
        int mid = (l + r) >> 1;
        val -= lazy[v];
        int ans = get_first(l, mid, lq, rq, val, v * 2);
        if(ans != -1)
            return ans;
        return get_first(mid, r, lq, rq, val, v * 2 + 1);
    }
 
    int get_last(int l, int r, int lq, int rq, ll val, int v){
        if(rq <= l || r <= lq || mx[v] < val)
            return -1;
        if(r - l == 1)
            return l;
        int mid = (l + r) >> 1;
        val -= lazy[v];
        int ans = get_last(mid, r, lq, rq, val, v * 2 + 1);
        if(ans != -1)
            return ans;
        return get_last(l, mid, lq, rq, val, v * 2);
    }

} segpre, segsuf;

inline void chval(int id, int val){
    fen::add(id, val - a[id]);
    segpre.add(0, n, id + 1, n, a[id] - val, 1);
    segpre.add(0, n, id, id + 1, val - a[id], 1);
    segsuf.add(0, n, 0, id, a[id] - val, 1);
    segsuf.add(0, n, id, id + 1, val - a[id], 1);
    a[id] = val;
    seg::upd(0, n, id, 1);
}
 
 
inline void update(int x, int y){
    //cerr << "ya here " << x << ' ' << y << '\n';
    if(y == a[x])
        return;
    if(y > a[x]){
        ll sum1 = a[x], sum2 = a[x];
        int i1 = seg::get_last(0, n, 0, x, a[x] + 1, 1);
        int i2 = seg::get_first(0, n, x + 1, n, a[x] + 1, 1);
        while(i1 != -1 && i2 != -1){
            ll sum = fen::get(i1 + 1, i2 - 1);
            if(sum < min(a[i1], a[i2]) && sum - a[x] + y >= min(a[i1], a[i2]))
                seg::add(0, n, i1 + 1, i2, -1, 1);
            if(a[i1] <= a[i2]){
                sum1 += a[i1];
                i1 = seg::get_last(0, n, 0, i1, sum1 + 1, 1);
            }
            else{
                sum2 += a[i2];
                i2 = seg::get_first(0, n, i2, n, sum2 + 1, 1);
            }
        }
        ll sum = 0;
        int i = seg::get_first(0, n, x + 1, n, a[x], 1);
        while(i != -1){
            ll have = fen::get(x + 1, i - 1);
            if(have >= min(a[x], a[i]) && have < min(y, a[i]))
                seg::add(0, n, x + 1, i, 1, 1);
            sum += a[i];
            i = seg::get_first(0, n, i + 1, n, sum + 1, 1);
        }
        sum = 0;
        i = seg::get_last(0, n, 0, x, a[x], 1);
        while(i != -1){
            ll have = fen::get(i + 1, x - 1);
            if(have >= min(a[x], a[i]) && have < min(y, a[i]))
                seg::add(0, n, i + 1, x, 1, 1);
            sum += a[i];
            i = seg::get_last(0, n, 0, i, sum + 1, 1);
        }
        chval(x, y);
        return;
    }

    ll sum1 = y, sum2 = y;
    int i1 = seg::get_last(0, n, 0, x, y + 1, 1);
    int i2 = seg::get_first(0, n, x + 1, n, y + 1, 1);
    while(i1 != -1 && i2 != -1){
        ll sum = fen::get(i1 + 1, i2 - 1);
        if(sum >= min(a[i1], a[i2]) && sum - a[x] + y < min(a[i1], a[i2]))
            seg::add(0, n, i1 + 1, i2, 1, 1);
        if(a[i1] <= a[i2]){
            sum1 += a[i1];
            i1 = seg::get_last(0, n, 0, i1, sum1 + 1, 1);
        }
        else{
            sum2 += a[i2];
            i2 = seg::get_first(0, n, i2, n, sum2 + 1, 1);
        }
    }
    ll sum = 0;
    int i = x + 1;
    while(i != -1){
        ll have = fen::get(x + 1, i - 1);
        if(have < min(a[x], a[i]) && have >= min(y, a[i]))
            seg::add(0, n, x + 1, i, -1, 1);
        sum += a[i];
        i = seg::get_first(0, n, i + 1, n, sum + 1, 1);
    }
    sum = 0;
    i = x - 1;
    while(i != -1){
        ll have = fen::get(i + 1, x - 1);
        if(have < min(a[x], a[i]) && have >= min(y, a[i]))
            seg::add(0, n, i + 1, x, -1, 1);
        sum += a[i];
        i = seg::get_last(0, n, 0, i, sum + 1, 1);
    }
    chval(x, y);
    return;
}

inline void add(int l, int r){
    ll sum = fen::get(l + 1, r - 1);
    if(sum >= min(a[l], a[r]))
        return;
    seg::add(0, n, l + 1, r, 1, 1);
}
 
int main()
{
    ios_base::sync_with_stdio(false); cin.tie(0);
 
    cin >> n;
    seg::build(0, n, 1);
    for(int i = 0; i < n; i++){
        int keep;
        cin >> keep;
        chval(i, keep);
        while(av.size() && a[av.back()] <= a[i]){
            add(av.back(), i);
            av.pop_back();
        }
        if(av.size())
            add(av.back(), i);
        av.pb(i);
    }
 
    int q; cin >> q;
    while(q--){
        int ty, x, y; cin >> ty >> x >> y;
        x--;
        if(ty == 1)
            update(x, y);
        else{
            y--;
            ll sumpre = fen::get(0, x - 1);
            int l = segpre.get_last(0, n, x, y + 1, (-sumpre) + 1, 1);
            if(l == -1)
                l = x;
            sumpre = fen::get(y + 1, n);
            int r = segsuf.get_first(0, n, x, y + 1, (-sumpre) + 1, 1);
            if(r == -1)
                r = y;
            cout << seg::get_min(0, n, l, r + 1, 1).se << '\n';
        }
    }
}
 
/*
5
6 4 2 2 6
3
1 3 1
2 2 5
2 1 5
2 2 4
 
5
6 4 2 2 6
1
2 1 3
2 1 5
1 3 1
2 2 5
2 1 5
2 2 4
 
3
6 4 2
1
2 1 2
 
10
2 3 5 10 1 3 4 9 5 2
2
1 4 1000000000
2 1 10
1 8 20
1 4 8
2 1 10 

7
27 18 36 31 55 86 4 
4
1 7 18
1 7 60
1 3 11
2 1 6

7
27 18 36 31 55 86 60
3
2 2 3
1 3 11
2 1 6

8
41 53 10 12 43 91 11 92 
10
2 5 8
1 8 65
2 4 7
2 3 8
1 2 37
1 8 5
2 7 8
1 8 43
1 1 30
1 6 60
*/
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 4 ms 468 KB Output is correct
6 Correct 2 ms 468 KB Output is correct
7 Correct 3 ms 468 KB Output is correct
8 Correct 2 ms 464 KB Output is correct
9 Correct 2 ms 468 KB Output is correct
10 Correct 2 ms 512 KB Output is correct
11 Correct 2 ms 468 KB Output is correct
12 Correct 3 ms 468 KB Output is correct
13 Correct 3 ms 464 KB Output is correct
14 Correct 2 ms 472 KB Output is correct
15 Correct 2 ms 468 KB Output is correct
16 Correct 1 ms 468 KB Output is correct
17 Correct 3 ms 468 KB Output is correct
18 Correct 2 ms 468 KB Output is correct
19 Correct 2 ms 468 KB Output is correct
20 Correct 2 ms 512 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 141 ms 14376 KB Output is correct
3 Correct 153 ms 14060 KB Output is correct
4 Correct 159 ms 14376 KB Output is correct
5 Correct 139 ms 14172 KB Output is correct
6 Correct 149 ms 14584 KB Output is correct
7 Correct 103 ms 13952 KB Output is correct
8 Correct 140 ms 14668 KB Output is correct
9 Correct 118 ms 14024 KB Output is correct
10 Correct 125 ms 14396 KB Output is correct
11 Correct 121 ms 14144 KB Output is correct
12 Correct 107 ms 14008 KB Output is correct
13 Correct 113 ms 13980 KB Output is correct
14 Correct 140 ms 14344 KB Output is correct
15 Correct 130 ms 14288 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 4 ms 468 KB Output is correct
6 Correct 2 ms 468 KB Output is correct
7 Correct 3 ms 468 KB Output is correct
8 Correct 2 ms 464 KB Output is correct
9 Correct 2 ms 468 KB Output is correct
10 Correct 2 ms 512 KB Output is correct
11 Correct 2 ms 468 KB Output is correct
12 Correct 3 ms 468 KB Output is correct
13 Correct 3 ms 464 KB Output is correct
14 Correct 2 ms 472 KB Output is correct
15 Correct 2 ms 468 KB Output is correct
16 Correct 1 ms 468 KB Output is correct
17 Correct 3 ms 468 KB Output is correct
18 Correct 2 ms 468 KB Output is correct
19 Correct 2 ms 468 KB Output is correct
20 Correct 2 ms 512 KB Output is correct
21 Correct 1 ms 340 KB Output is correct
22 Correct 141 ms 14376 KB Output is correct
23 Correct 153 ms 14060 KB Output is correct
24 Correct 159 ms 14376 KB Output is correct
25 Correct 139 ms 14172 KB Output is correct
26 Correct 149 ms 14584 KB Output is correct
27 Correct 103 ms 13952 KB Output is correct
28 Correct 140 ms 14668 KB Output is correct
29 Correct 118 ms 14024 KB Output is correct
30 Correct 125 ms 14396 KB Output is correct
31 Correct 121 ms 14144 KB Output is correct
32 Correct 107 ms 14008 KB Output is correct
33 Correct 113 ms 13980 KB Output is correct
34 Correct 140 ms 14344 KB Output is correct
35 Correct 130 ms 14288 KB Output is correct
36 Correct 139 ms 14420 KB Output is correct
37 Correct 134 ms 14092 KB Output is correct
38 Correct 120 ms 14156 KB Output is correct
39 Correct 152 ms 14300 KB Output is correct
40 Correct 128 ms 14184 KB Output is correct
41 Correct 128 ms 14656 KB Output is correct
42 Correct 129 ms 14588 KB Output is correct
43 Correct 133 ms 14172 KB Output is correct
44 Correct 128 ms 14032 KB Output is correct
45 Correct 136 ms 14388 KB Output is correct
46 Correct 130 ms 14384 KB Output is correct
47 Correct 117 ms 14100 KB Output is correct
48 Correct 136 ms 14048 KB Output is correct
49 Correct 117 ms 14004 KB Output is correct
50 Correct 129 ms 14416 KB Output is correct
51 Correct 122 ms 14340 KB Output is correct
52 Correct 118 ms 14352 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 141 ms 14376 KB Output is correct
3 Correct 153 ms 14060 KB Output is correct
4 Correct 159 ms 14376 KB Output is correct
5 Correct 139 ms 14172 KB Output is correct
6 Correct 149 ms 14584 KB Output is correct
7 Correct 103 ms 13952 KB Output is correct
8 Correct 140 ms 14668 KB Output is correct
9 Correct 118 ms 14024 KB Output is correct
10 Correct 125 ms 14396 KB Output is correct
11 Correct 121 ms 14144 KB Output is correct
12 Correct 107 ms 14008 KB Output is correct
13 Correct 113 ms 13980 KB Output is correct
14 Correct 140 ms 14344 KB Output is correct
15 Correct 130 ms 14288 KB Output is correct
16 Correct 1 ms 340 KB Output is correct
17 Correct 263 ms 15880 KB Output is correct
18 Correct 300 ms 16176 KB Output is correct
19 Correct 246 ms 15800 KB Output is correct
20 Correct 255 ms 15816 KB Output is correct
21 Correct 256 ms 15820 KB Output is correct
22 Correct 291 ms 16184 KB Output is correct
23 Correct 255 ms 15844 KB Output is correct
24 Correct 261 ms 15844 KB Output is correct
25 Correct 253 ms 15860 KB Output is correct
26 Correct 250 ms 15920 KB Output is correct
27 Correct 331 ms 16532 KB Output is correct
28 Correct 270 ms 16480 KB Output is correct
29 Correct 319 ms 16496 KB Output is correct
30 Correct 239 ms 15504 KB Output is correct
31 Correct 183 ms 15520 KB Output is correct
32 Correct 225 ms 15664 KB Output is correct
33 Correct 303 ms 16220 KB Output is correct
34 Correct 221 ms 15708 KB Output is correct
35 Correct 238 ms 15632 KB Output is correct
36 Correct 290 ms 16124 KB Output is correct
37 Correct 206 ms 15572 KB Output is correct
38 Correct 213 ms 15640 KB Output is correct
39 Correct 329 ms 16228 KB Output is correct
40 Correct 244 ms 16140 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 141 ms 14376 KB Output is correct
3 Correct 153 ms 14060 KB Output is correct
4 Correct 159 ms 14376 KB Output is correct
5 Correct 139 ms 14172 KB Output is correct
6 Correct 149 ms 14584 KB Output is correct
7 Correct 103 ms 13952 KB Output is correct
8 Correct 140 ms 14668 KB Output is correct
9 Correct 118 ms 14024 KB Output is correct
10 Correct 125 ms 14396 KB Output is correct
11 Correct 121 ms 14144 KB Output is correct
12 Correct 107 ms 14008 KB Output is correct
13 Correct 113 ms 13980 KB Output is correct
14 Correct 140 ms 14344 KB Output is correct
15 Correct 130 ms 14288 KB Output is correct
16 Correct 1 ms 340 KB Output is correct
17 Correct 805 ms 15392 KB Output is correct
18 Correct 659 ms 15820 KB Output is correct
19 Correct 619 ms 15332 KB Output is correct
20 Correct 598 ms 15776 KB Output is correct
21 Correct 840 ms 15464 KB Output is correct
22 Correct 683 ms 15780 KB Output is correct
23 Correct 708 ms 15284 KB Output is correct
24 Correct 637 ms 15744 KB Output is correct
25 Correct 680 ms 15280 KB Output is correct
26 Correct 381 ms 16400 KB Output is correct
27 Correct 469 ms 16312 KB Output is correct
28 Correct 481 ms 15744 KB Output is correct
29 Correct 380 ms 16304 KB Output is correct
30 Correct 446 ms 16420 KB Output is correct
31 Correct 544 ms 15768 KB Output is correct
32 Correct 630 ms 15788 KB Output is correct
33 Correct 270 ms 15428 KB Output is correct
34 Correct 614 ms 16092 KB Output is correct
35 Correct 288 ms 15788 KB Output is correct
36 Correct 626 ms 15752 KB Output is correct
37 Correct 427 ms 15484 KB Output is correct
38 Correct 289 ms 15556 KB Output is correct
39 Correct 420 ms 16228 KB Output is correct
40 Correct 288 ms 15976 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 4 ms 468 KB Output is correct
6 Correct 2 ms 468 KB Output is correct
7 Correct 3 ms 468 KB Output is correct
8 Correct 2 ms 464 KB Output is correct
9 Correct 2 ms 468 KB Output is correct
10 Correct 2 ms 512 KB Output is correct
11 Correct 2 ms 468 KB Output is correct
12 Correct 3 ms 468 KB Output is correct
13 Correct 3 ms 464 KB Output is correct
14 Correct 2 ms 472 KB Output is correct
15 Correct 2 ms 468 KB Output is correct
16 Correct 1 ms 468 KB Output is correct
17 Correct 3 ms 468 KB Output is correct
18 Correct 2 ms 468 KB Output is correct
19 Correct 2 ms 468 KB Output is correct
20 Correct 2 ms 512 KB Output is correct
21 Correct 1 ms 340 KB Output is correct
22 Correct 141 ms 14376 KB Output is correct
23 Correct 153 ms 14060 KB Output is correct
24 Correct 159 ms 14376 KB Output is correct
25 Correct 139 ms 14172 KB Output is correct
26 Correct 149 ms 14584 KB Output is correct
27 Correct 103 ms 13952 KB Output is correct
28 Correct 140 ms 14668 KB Output is correct
29 Correct 118 ms 14024 KB Output is correct
30 Correct 125 ms 14396 KB Output is correct
31 Correct 121 ms 14144 KB Output is correct
32 Correct 107 ms 14008 KB Output is correct
33 Correct 113 ms 13980 KB Output is correct
34 Correct 140 ms 14344 KB Output is correct
35 Correct 130 ms 14288 KB Output is correct
36 Correct 139 ms 14420 KB Output is correct
37 Correct 134 ms 14092 KB Output is correct
38 Correct 120 ms 14156 KB Output is correct
39 Correct 152 ms 14300 KB Output is correct
40 Correct 128 ms 14184 KB Output is correct
41 Correct 128 ms 14656 KB Output is correct
42 Correct 129 ms 14588 KB Output is correct
43 Correct 133 ms 14172 KB Output is correct
44 Correct 128 ms 14032 KB Output is correct
45 Correct 136 ms 14388 KB Output is correct
46 Correct 130 ms 14384 KB Output is correct
47 Correct 117 ms 14100 KB Output is correct
48 Correct 136 ms 14048 KB Output is correct
49 Correct 117 ms 14004 KB Output is correct
50 Correct 129 ms 14416 KB Output is correct
51 Correct 122 ms 14340 KB Output is correct
52 Correct 118 ms 14352 KB Output is correct
53 Correct 1 ms 340 KB Output is correct
54 Correct 263 ms 15880 KB Output is correct
55 Correct 300 ms 16176 KB Output is correct
56 Correct 246 ms 15800 KB Output is correct
57 Correct 255 ms 15816 KB Output is correct
58 Correct 256 ms 15820 KB Output is correct
59 Correct 291 ms 16184 KB Output is correct
60 Correct 255 ms 15844 KB Output is correct
61 Correct 261 ms 15844 KB Output is correct
62 Correct 253 ms 15860 KB Output is correct
63 Correct 250 ms 15920 KB Output is correct
64 Correct 331 ms 16532 KB Output is correct
65 Correct 270 ms 16480 KB Output is correct
66 Correct 319 ms 16496 KB Output is correct
67 Correct 239 ms 15504 KB Output is correct
68 Correct 183 ms 15520 KB Output is correct
69 Correct 225 ms 15664 KB Output is correct
70 Correct 303 ms 16220 KB Output is correct
71 Correct 221 ms 15708 KB Output is correct
72 Correct 238 ms 15632 KB Output is correct
73 Correct 290 ms 16124 KB Output is correct
74 Correct 206 ms 15572 KB Output is correct
75 Correct 213 ms 15640 KB Output is correct
76 Correct 329 ms 16228 KB Output is correct
77 Correct 244 ms 16140 KB Output is correct
78 Correct 1 ms 340 KB Output is correct
79 Correct 805 ms 15392 KB Output is correct
80 Correct 659 ms 15820 KB Output is correct
81 Correct 619 ms 15332 KB Output is correct
82 Correct 598 ms 15776 KB Output is correct
83 Correct 840 ms 15464 KB Output is correct
84 Correct 683 ms 15780 KB Output is correct
85 Correct 708 ms 15284 KB Output is correct
86 Correct 637 ms 15744 KB Output is correct
87 Correct 680 ms 15280 KB Output is correct
88 Correct 381 ms 16400 KB Output is correct
89 Correct 469 ms 16312 KB Output is correct
90 Correct 481 ms 15744 KB Output is correct
91 Correct 380 ms 16304 KB Output is correct
92 Correct 446 ms 16420 KB Output is correct
93 Correct 544 ms 15768 KB Output is correct
94 Correct 630 ms 15788 KB Output is correct
95 Correct 270 ms 15428 KB Output is correct
96 Correct 614 ms 16092 KB Output is correct
97 Correct 288 ms 15788 KB Output is correct
98 Correct 626 ms 15752 KB Output is correct
99 Correct 427 ms 15484 KB Output is correct
100 Correct 289 ms 15556 KB Output is correct
101 Correct 420 ms 16228 KB Output is correct
102 Correct 288 ms 15976 KB Output is correct
103 Correct 768 ms 15132 KB Output is correct
104 Correct 705 ms 16124 KB Output is correct
105 Correct 332 ms 15772 KB Output is correct
106 Correct 350 ms 15976 KB Output is correct
107 Correct 753 ms 15240 KB Output is correct
108 Correct 632 ms 16108 KB Output is correct
109 Correct 388 ms 15612 KB Output is correct
110 Correct 434 ms 15948 KB Output is correct
111 Correct 298 ms 15848 KB Output is correct
112 Correct 354 ms 16064 KB Output is correct
113 Correct 388 ms 16368 KB Output is correct
114 Correct 280 ms 16564 KB Output is correct
115 Correct 494 ms 15880 KB Output is correct
116 Correct 411 ms 15820 KB Output is correct
117 Correct 306 ms 16556 KB Output is correct
118 Correct 298 ms 15808 KB Output is correct
119 Correct 412 ms 16536 KB Output is correct
120 Correct 484 ms 15700 KB Output is correct
121 Correct 368 ms 15812 KB Output is correct
122 Correct 599 ms 15772 KB Output is correct
123 Correct 244 ms 15640 KB Output is correct
124 Correct 384 ms 15828 KB Output is correct
125 Correct 202 ms 15696 KB Output is correct
126 Correct 324 ms 15784 KB Output is correct
127 Correct 352 ms 15628 KB Output is correct
128 Correct 219 ms 15736 KB Output is correct
129 Correct 395 ms 16392 KB Output is correct
130 Correct 284 ms 16180 KB Output is correct