Submission #811260

# Submission time Handle Problem Language Result Execution time Memory
811260 2023-08-07T03:21:51 Z blackyuki Radio Towers (IOI22_towers) C++17
100 / 100
976 ms 57668 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<P> vp;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define REP(i,k,n) for(ll i=(ll)(k);i<(ll)(n);i++)
#define all(a) a.begin(),a.end()
#define fi first
#define se second
#define pb emplace_back
#define lb(v,k) (lower_bound(all(v),k)-v.begin())
template<class T> bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;}
template<class T> bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;}
template<class T> void out(T a){cout<<a<<'\n';}
template<class T> void outv(T v){rep(i,v.size()){if(i)cout<<' ';cout<<v[i];}cout<<'\n';}
const ll inf=1001001001001;
#include "towers.h"
struct Sparsetable{
    ll n;
    vvi tablema,tablemi;
    vi sz;
    void init(vi v){
        n=v.size();
        tablema=vvi(18,vi(n));tablemi=vvi(18,vi(n));
        tablema[0]=tablemi[0]=v;
        rep(i,17)rep(j,n)if(j+(1<<(i+1))<=n){
            tablema[i+1][j]=max(tablema[i][j],tablema[i][j+(1<<i)]);
            tablemi[i+1][j]=min(tablemi[i][j],tablemi[i][j+(1<<i)]);
        }
        sz=vi(n+1);
        rep(i,18)REP(j,1<<i,1<<(i+1))if(j<=n)sz[j]=i;
    }
    ll getma(ll l,ll r){
        if(l>=r)return -inf;
        // ll res=-inf;
        // REP(i,l,r)chmax(res,tablema[0][i]);
        // return res;
        ///////////////////////////////////////////////////////////
        ll s=sz[r-l];
        return max(tablema[s][l],tablema[s][r-(1<<s)]);
    }
    ll getmi(ll l,ll r){
        if(l>=r)return inf;
        // ll res=inf;
        // REP(i,l,r)chmin(res,tablemi[0][i]);
        // return res;
        ///////////////////////////////////////////////////////////
        ll s=sz[r-l];
        return min(tablemi[s][l],tablemi[s][r-(1<<s)]);
    }
};
struct segtree{
    vvi seg;
    ll n;
    void init(vi v){
        n=v.size();
        seg=vvi(n*2);
        rep(i,n)seg[i+n].pb(v[i]);
        for(int i=n-1;i>0;i--){
            seg[i]=seg[i*2];
            for(ll x:seg[i*2+1])seg[i].pb(x);
            sort(all(seg[i]));
        }
    }
    ll get(ll l,ll r,ll D){
        ll ans=0;
        for(l+=n,r+=n;l<r;l>>=1,r>>=1){
            if(l&1){
                ans+=seg[l].size()-lb(seg[l],D);
                l++;
            }
            if(r&1){
                r--;
                ans+=seg[r].size()-lb(seg[r],D);
            }
        }
        return ans;
    }
};
vi v,sp,dif;
vvi L,R;
ll n,m;
Sparsetable sps;
segtree seg;
void init(int N,vector<int> H){
    for(int x:H)v.pb(-x);
    sps.init(v);
    n=N;
    rep(i,n)if((i==0||v[i-1]>v[i])&&(i==n-1||v[i+1]>v[i]))sp.pb(i);
    m=sp.size();
    L=vvi(18,vi(m,-1));R=vvi(18,vi(m,-1));
    {
        vi st;
        for(int i=m-1;i>=0;i--){
            while(st.size()&&v[sp[st.back()]]>v[sp[i]])st.pop_back();
            if(st.size())R[0][i]=st.back();
            st.pb(i);
        }
    }
    {
        vi st;
        rep(i,m){
            while(st.size()&&v[sp[st.back()]]>v[sp[i]])st.pop_back();
            if(st.size())L[0][i]=st.back();
            st.pb(i);
        }
    }
    rep(i,17)rep(j,m)if(L[i][j]!=-1)L[i+1][j]=L[i][L[i][j]];
    rep(i,17)rep(j,m)if(R[i][j]!=-1)R[i+1][j]=R[i][R[i][j]];
    dif=vi(m);
    rep(i,m){
        P rng;
        rng.fi=(L[0][i]==-1 ? 0 : sp[L[0][i]]+1);
        rng.se=(R[0][i]==-1 ? n-1 : sp[R[0][i]]-1);
        ll ma=min(sps.getma(rng.fi,sp[i]),sps.getma(sp[i]+1,rng.se+1));
        dif[i]=ma-v[sp[i]];
    }
    seg.init(dif);
}
int max_towers(int a, int b, int D){
    ll l=lb(sp,a),r=lb(sp,b+1)-1;
    if(l>r)return 1;
    ll l_=l,r_=r;
    if(sps.getma(a,sp[l])<v[sp[l]]+D){
        l_=l+1;
        ll cur=l;
        for(ll i=17;i>=0;i--){
            ll ncur=R[i][cur];
            if(ncur!=-1&&ncur<=r&&sps.getma(a,sp[ncur])<v[sp[ncur]]+D){
                cur=ncur;
                l_=cur+1;
            }
        }
    }
    if(sps.getma(sp[r]+1,b+1)<v[sp[r]]+D){
        r_=r-1;
        ll cur=r;
        for(ll i=17;i>=0;i--){
            ll ncur=L[i][cur];
            if(ncur!=-1&&ncur>=l&&sps.getma(sp[ncur]+1,b+1)<v[sp[ncur]]+D){
                cur=ncur;
                r_=cur-1;
            }
        }
    }
    // int ans=0;
    // REP(i,l_,r_+1)if(dif[i]>=D)ans++;
    // return ans+1;
    return seg.get(l_,r_+1,D)+1;
}
# Verdict Execution time Memory Grader output
1 Correct 302 ms 18932 KB Output is correct
2 Correct 548 ms 31660 KB Output is correct
3 Correct 367 ms 31792 KB Output is correct
4 Correct 605 ms 31684 KB Output is correct
5 Correct 454 ms 31612 KB Output is correct
6 Correct 640 ms 31616 KB Output is correct
7 Correct 650 ms 31660 KB Output is correct
8 Correct 0 ms 208 KB Output is correct
9 Correct 1 ms 848 KB Output is correct
10 Correct 1 ms 848 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 464 KB Output is correct
2 Correct 1 ms 1232 KB Output is correct
3 Correct 1 ms 1104 KB Output is correct
4 Correct 1 ms 1360 KB Output is correct
5 Correct 1 ms 1360 KB Output is correct
6 Correct 1 ms 1360 KB Output is correct
7 Correct 1 ms 1360 KB Output is correct
8 Correct 1 ms 848 KB Output is correct
9 Correct 1 ms 848 KB Output is correct
10 Correct 1 ms 848 KB Output is correct
11 Correct 1 ms 848 KB Output is correct
12 Correct 0 ms 208 KB Output is correct
13 Correct 1 ms 848 KB Output is correct
14 Correct 1 ms 848 KB Output is correct
15 Correct 1 ms 1220 KB Output is correct
16 Correct 1 ms 1360 KB Output is correct
17 Correct 1 ms 1360 KB Output is correct
18 Correct 1 ms 848 KB Output is correct
19 Correct 1 ms 848 KB Output is correct
20 Correct 1 ms 1232 KB Output is correct
21 Correct 1 ms 1360 KB Output is correct
22 Correct 2 ms 1372 KB Output is correct
23 Correct 1 ms 848 KB Output is correct
24 Correct 1 ms 848 KB Output is correct
25 Correct 1 ms 720 KB Output is correct
26 Correct 1 ms 1232 KB Output is correct
27 Correct 1 ms 1104 KB Output is correct
28 Correct 1 ms 1360 KB Output is correct
29 Correct 1 ms 1360 KB Output is correct
30 Correct 1 ms 1360 KB Output is correct
31 Correct 1 ms 1360 KB Output is correct
32 Correct 1 ms 848 KB Output is correct
33 Correct 1 ms 848 KB Output is correct
34 Correct 1 ms 848 KB Output is correct
35 Correct 1 ms 848 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 464 KB Output is correct
2 Correct 1 ms 1232 KB Output is correct
3 Correct 1 ms 1104 KB Output is correct
4 Correct 1 ms 1360 KB Output is correct
5 Correct 1 ms 1360 KB Output is correct
6 Correct 1 ms 1360 KB Output is correct
7 Correct 1 ms 1360 KB Output is correct
8 Correct 1 ms 848 KB Output is correct
9 Correct 1 ms 848 KB Output is correct
10 Correct 1 ms 848 KB Output is correct
11 Correct 1 ms 848 KB Output is correct
12 Correct 0 ms 208 KB Output is correct
13 Correct 1 ms 848 KB Output is correct
14 Correct 1 ms 848 KB Output is correct
15 Correct 1 ms 1220 KB Output is correct
16 Correct 1 ms 1360 KB Output is correct
17 Correct 1 ms 1360 KB Output is correct
18 Correct 1 ms 848 KB Output is correct
19 Correct 1 ms 848 KB Output is correct
20 Correct 1 ms 1232 KB Output is correct
21 Correct 1 ms 1360 KB Output is correct
22 Correct 2 ms 1372 KB Output is correct
23 Correct 1 ms 848 KB Output is correct
24 Correct 1 ms 848 KB Output is correct
25 Correct 1 ms 720 KB Output is correct
26 Correct 1 ms 1232 KB Output is correct
27 Correct 1 ms 1104 KB Output is correct
28 Correct 1 ms 1360 KB Output is correct
29 Correct 1 ms 1360 KB Output is correct
30 Correct 1 ms 1360 KB Output is correct
31 Correct 1 ms 1360 KB Output is correct
32 Correct 1 ms 848 KB Output is correct
33 Correct 1 ms 848 KB Output is correct
34 Correct 1 ms 848 KB Output is correct
35 Correct 1 ms 848 KB Output is correct
36 Correct 32 ms 31480 KB Output is correct
37 Correct 49 ms 48588 KB Output is correct
38 Correct 54 ms 48500 KB Output is correct
39 Correct 63 ms 57620 KB Output is correct
40 Correct 62 ms 57628 KB Output is correct
41 Correct 62 ms 57604 KB Output is correct
42 Correct 68 ms 57604 KB Output is correct
43 Correct 26 ms 31604 KB Output is correct
44 Correct 29 ms 31652 KB Output is correct
45 Correct 29 ms 31640 KB Output is correct
46 Correct 25 ms 31556 KB Output is correct
47 Correct 49 ms 48408 KB Output is correct
48 Correct 64 ms 57596 KB Output is correct
49 Correct 62 ms 57628 KB Output is correct
50 Correct 25 ms 31660 KB Output is correct
51 Correct 25 ms 31616 KB Output is correct
52 Correct 49 ms 48448 KB Output is correct
53 Correct 68 ms 57576 KB Output is correct
54 Correct 62 ms 57536 KB Output is correct
55 Correct 32 ms 31668 KB Output is correct
56 Correct 27 ms 31640 KB Output is correct
57 Correct 49 ms 46716 KB Output is correct
58 Correct 50 ms 48524 KB Output is correct
59 Correct 49 ms 48540 KB Output is correct
60 Correct 62 ms 57608 KB Output is correct
61 Correct 62 ms 57576 KB Output is correct
62 Correct 68 ms 57628 KB Output is correct
63 Correct 64 ms 57628 KB Output is correct
64 Correct 27 ms 31632 KB Output is correct
65 Correct 26 ms 31668 KB Output is correct
66 Correct 27 ms 31632 KB Output is correct
67 Correct 26 ms 31660 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 525 ms 47996 KB Output is correct
2 Correct 714 ms 48412 KB Output is correct
3 Correct 970 ms 48464 KB Output is correct
4 Correct 833 ms 57584 KB Output is correct
5 Correct 948 ms 57652 KB Output is correct
6 Correct 746 ms 57628 KB Output is correct
7 Correct 769 ms 57644 KB Output is correct
8 Correct 638 ms 31636 KB Output is correct
9 Correct 565 ms 31660 KB Output is correct
10 Correct 661 ms 31668 KB Output is correct
11 Correct 552 ms 31640 KB Output is correct
12 Correct 605 ms 31644 KB Output is correct
13 Correct 571 ms 31648 KB Output is correct
14 Correct 0 ms 208 KB Output is correct
15 Correct 1 ms 848 KB Output is correct
16 Correct 1 ms 848 KB Output is correct
17 Correct 55 ms 48388 KB Output is correct
18 Correct 64 ms 57600 KB Output is correct
19 Correct 62 ms 57632 KB Output is correct
20 Correct 28 ms 31644 KB Output is correct
21 Correct 25 ms 31648 KB Output is correct
22 Correct 50 ms 48520 KB Output is correct
23 Correct 74 ms 57580 KB Output is correct
24 Correct 69 ms 57536 KB Output is correct
25 Correct 31 ms 31536 KB Output is correct
26 Correct 26 ms 31644 KB Output is correct
27 Correct 1 ms 1232 KB Output is correct
28 Correct 1 ms 1360 KB Output is correct
29 Correct 1 ms 1360 KB Output is correct
30 Correct 1 ms 928 KB Output is correct
31 Correct 1 ms 848 KB Output is correct
32 Correct 1 ms 1232 KB Output is correct
33 Correct 1 ms 1360 KB Output is correct
34 Correct 1 ms 1360 KB Output is correct
35 Correct 1 ms 848 KB Output is correct
36 Correct 1 ms 848 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 227 ms 11592 KB Output is correct
2 Correct 800 ms 48540 KB Output is correct
3 Correct 713 ms 48524 KB Output is correct
4 Correct 723 ms 57588 KB Output is correct
5 Correct 785 ms 57628 KB Output is correct
6 Correct 805 ms 57628 KB Output is correct
7 Correct 719 ms 57628 KB Output is correct
8 Correct 675 ms 31660 KB Output is correct
9 Correct 564 ms 31568 KB Output is correct
10 Correct 663 ms 31668 KB Output is correct
11 Correct 563 ms 31608 KB Output is correct
12 Correct 52 ms 48496 KB Output is correct
13 Correct 62 ms 57584 KB Output is correct
14 Correct 63 ms 57536 KB Output is correct
15 Correct 30 ms 31632 KB Output is correct
16 Correct 28 ms 31616 KB Output is correct
17 Correct 49 ms 46708 KB Output is correct
18 Correct 51 ms 48500 KB Output is correct
19 Correct 52 ms 48512 KB Output is correct
20 Correct 64 ms 57580 KB Output is correct
21 Correct 63 ms 57628 KB Output is correct
22 Correct 63 ms 57580 KB Output is correct
23 Correct 64 ms 57588 KB Output is correct
24 Correct 26 ms 31668 KB Output is correct
25 Correct 26 ms 31620 KB Output is correct
26 Correct 26 ms 31612 KB Output is correct
27 Correct 32 ms 31556 KB Output is correct
28 Correct 1 ms 1232 KB Output is correct
29 Correct 1 ms 1360 KB Output is correct
30 Correct 1 ms 1360 KB Output is correct
31 Correct 1 ms 848 KB Output is correct
32 Correct 1 ms 848 KB Output is correct
33 Correct 1 ms 720 KB Output is correct
34 Correct 1 ms 1232 KB Output is correct
35 Correct 1 ms 1104 KB Output is correct
36 Correct 1 ms 1360 KB Output is correct
37 Correct 2 ms 1360 KB Output is correct
38 Correct 1 ms 1360 KB Output is correct
39 Correct 1 ms 1360 KB Output is correct
40 Correct 1 ms 848 KB Output is correct
41 Correct 1 ms 848 KB Output is correct
42 Correct 1 ms 848 KB Output is correct
43 Correct 1 ms 848 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 464 KB Output is correct
2 Correct 1 ms 1232 KB Output is correct
3 Correct 1 ms 1104 KB Output is correct
4 Correct 1 ms 1360 KB Output is correct
5 Correct 1 ms 1360 KB Output is correct
6 Correct 1 ms 1360 KB Output is correct
7 Correct 1 ms 1360 KB Output is correct
8 Correct 1 ms 848 KB Output is correct
9 Correct 1 ms 848 KB Output is correct
10 Correct 1 ms 848 KB Output is correct
11 Correct 1 ms 848 KB Output is correct
12 Correct 0 ms 208 KB Output is correct
13 Correct 1 ms 848 KB Output is correct
14 Correct 1 ms 848 KB Output is correct
15 Correct 1 ms 1220 KB Output is correct
16 Correct 1 ms 1360 KB Output is correct
17 Correct 1 ms 1360 KB Output is correct
18 Correct 1 ms 848 KB Output is correct
19 Correct 1 ms 848 KB Output is correct
20 Correct 1 ms 1232 KB Output is correct
21 Correct 1 ms 1360 KB Output is correct
22 Correct 2 ms 1372 KB Output is correct
23 Correct 1 ms 848 KB Output is correct
24 Correct 1 ms 848 KB Output is correct
25 Correct 1 ms 720 KB Output is correct
26 Correct 1 ms 1232 KB Output is correct
27 Correct 1 ms 1104 KB Output is correct
28 Correct 1 ms 1360 KB Output is correct
29 Correct 1 ms 1360 KB Output is correct
30 Correct 1 ms 1360 KB Output is correct
31 Correct 1 ms 1360 KB Output is correct
32 Correct 1 ms 848 KB Output is correct
33 Correct 1 ms 848 KB Output is correct
34 Correct 1 ms 848 KB Output is correct
35 Correct 1 ms 848 KB Output is correct
36 Correct 32 ms 31480 KB Output is correct
37 Correct 49 ms 48588 KB Output is correct
38 Correct 54 ms 48500 KB Output is correct
39 Correct 63 ms 57620 KB Output is correct
40 Correct 62 ms 57628 KB Output is correct
41 Correct 62 ms 57604 KB Output is correct
42 Correct 68 ms 57604 KB Output is correct
43 Correct 26 ms 31604 KB Output is correct
44 Correct 29 ms 31652 KB Output is correct
45 Correct 29 ms 31640 KB Output is correct
46 Correct 25 ms 31556 KB Output is correct
47 Correct 49 ms 48408 KB Output is correct
48 Correct 64 ms 57596 KB Output is correct
49 Correct 62 ms 57628 KB Output is correct
50 Correct 25 ms 31660 KB Output is correct
51 Correct 25 ms 31616 KB Output is correct
52 Correct 49 ms 48448 KB Output is correct
53 Correct 68 ms 57576 KB Output is correct
54 Correct 62 ms 57536 KB Output is correct
55 Correct 32 ms 31668 KB Output is correct
56 Correct 27 ms 31640 KB Output is correct
57 Correct 49 ms 46716 KB Output is correct
58 Correct 50 ms 48524 KB Output is correct
59 Correct 49 ms 48540 KB Output is correct
60 Correct 62 ms 57608 KB Output is correct
61 Correct 62 ms 57576 KB Output is correct
62 Correct 68 ms 57628 KB Output is correct
63 Correct 64 ms 57628 KB Output is correct
64 Correct 27 ms 31632 KB Output is correct
65 Correct 26 ms 31668 KB Output is correct
66 Correct 27 ms 31632 KB Output is correct
67 Correct 26 ms 31660 KB Output is correct
68 Correct 525 ms 47996 KB Output is correct
69 Correct 714 ms 48412 KB Output is correct
70 Correct 970 ms 48464 KB Output is correct
71 Correct 833 ms 57584 KB Output is correct
72 Correct 948 ms 57652 KB Output is correct
73 Correct 746 ms 57628 KB Output is correct
74 Correct 769 ms 57644 KB Output is correct
75 Correct 638 ms 31636 KB Output is correct
76 Correct 565 ms 31660 KB Output is correct
77 Correct 661 ms 31668 KB Output is correct
78 Correct 552 ms 31640 KB Output is correct
79 Correct 605 ms 31644 KB Output is correct
80 Correct 571 ms 31648 KB Output is correct
81 Correct 0 ms 208 KB Output is correct
82 Correct 1 ms 848 KB Output is correct
83 Correct 1 ms 848 KB Output is correct
84 Correct 55 ms 48388 KB Output is correct
85 Correct 64 ms 57600 KB Output is correct
86 Correct 62 ms 57632 KB Output is correct
87 Correct 28 ms 31644 KB Output is correct
88 Correct 25 ms 31648 KB Output is correct
89 Correct 50 ms 48520 KB Output is correct
90 Correct 74 ms 57580 KB Output is correct
91 Correct 69 ms 57536 KB Output is correct
92 Correct 31 ms 31536 KB Output is correct
93 Correct 26 ms 31644 KB Output is correct
94 Correct 1 ms 1232 KB Output is correct
95 Correct 1 ms 1360 KB Output is correct
96 Correct 1 ms 1360 KB Output is correct
97 Correct 1 ms 928 KB Output is correct
98 Correct 1 ms 848 KB Output is correct
99 Correct 1 ms 1232 KB Output is correct
100 Correct 1 ms 1360 KB Output is correct
101 Correct 1 ms 1360 KB Output is correct
102 Correct 1 ms 848 KB Output is correct
103 Correct 1 ms 848 KB Output is correct
104 Correct 685 ms 43000 KB Output is correct
105 Correct 782 ms 48416 KB Output is correct
106 Correct 809 ms 48492 KB Output is correct
107 Correct 883 ms 57628 KB Output is correct
108 Correct 864 ms 57584 KB Output is correct
109 Correct 867 ms 57600 KB Output is correct
110 Correct 764 ms 57584 KB Output is correct
111 Correct 612 ms 31616 KB Output is correct
112 Correct 608 ms 31616 KB Output is correct
113 Correct 585 ms 31612 KB Output is correct
114 Correct 662 ms 31668 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 302 ms 18932 KB Output is correct
2 Correct 548 ms 31660 KB Output is correct
3 Correct 367 ms 31792 KB Output is correct
4 Correct 605 ms 31684 KB Output is correct
5 Correct 454 ms 31612 KB Output is correct
6 Correct 640 ms 31616 KB Output is correct
7 Correct 650 ms 31660 KB Output is correct
8 Correct 0 ms 208 KB Output is correct
9 Correct 1 ms 848 KB Output is correct
10 Correct 1 ms 848 KB Output is correct
11 Correct 1 ms 464 KB Output is correct
12 Correct 1 ms 1232 KB Output is correct
13 Correct 1 ms 1104 KB Output is correct
14 Correct 1 ms 1360 KB Output is correct
15 Correct 1 ms 1360 KB Output is correct
16 Correct 1 ms 1360 KB Output is correct
17 Correct 1 ms 1360 KB Output is correct
18 Correct 1 ms 848 KB Output is correct
19 Correct 1 ms 848 KB Output is correct
20 Correct 1 ms 848 KB Output is correct
21 Correct 1 ms 848 KB Output is correct
22 Correct 0 ms 208 KB Output is correct
23 Correct 1 ms 848 KB Output is correct
24 Correct 1 ms 848 KB Output is correct
25 Correct 1 ms 1220 KB Output is correct
26 Correct 1 ms 1360 KB Output is correct
27 Correct 1 ms 1360 KB Output is correct
28 Correct 1 ms 848 KB Output is correct
29 Correct 1 ms 848 KB Output is correct
30 Correct 1 ms 1232 KB Output is correct
31 Correct 1 ms 1360 KB Output is correct
32 Correct 2 ms 1372 KB Output is correct
33 Correct 1 ms 848 KB Output is correct
34 Correct 1 ms 848 KB Output is correct
35 Correct 1 ms 720 KB Output is correct
36 Correct 1 ms 1232 KB Output is correct
37 Correct 1 ms 1104 KB Output is correct
38 Correct 1 ms 1360 KB Output is correct
39 Correct 1 ms 1360 KB Output is correct
40 Correct 1 ms 1360 KB Output is correct
41 Correct 1 ms 1360 KB Output is correct
42 Correct 1 ms 848 KB Output is correct
43 Correct 1 ms 848 KB Output is correct
44 Correct 1 ms 848 KB Output is correct
45 Correct 1 ms 848 KB Output is correct
46 Correct 32 ms 31480 KB Output is correct
47 Correct 49 ms 48588 KB Output is correct
48 Correct 54 ms 48500 KB Output is correct
49 Correct 63 ms 57620 KB Output is correct
50 Correct 62 ms 57628 KB Output is correct
51 Correct 62 ms 57604 KB Output is correct
52 Correct 68 ms 57604 KB Output is correct
53 Correct 26 ms 31604 KB Output is correct
54 Correct 29 ms 31652 KB Output is correct
55 Correct 29 ms 31640 KB Output is correct
56 Correct 25 ms 31556 KB Output is correct
57 Correct 49 ms 48408 KB Output is correct
58 Correct 64 ms 57596 KB Output is correct
59 Correct 62 ms 57628 KB Output is correct
60 Correct 25 ms 31660 KB Output is correct
61 Correct 25 ms 31616 KB Output is correct
62 Correct 49 ms 48448 KB Output is correct
63 Correct 68 ms 57576 KB Output is correct
64 Correct 62 ms 57536 KB Output is correct
65 Correct 32 ms 31668 KB Output is correct
66 Correct 27 ms 31640 KB Output is correct
67 Correct 49 ms 46716 KB Output is correct
68 Correct 50 ms 48524 KB Output is correct
69 Correct 49 ms 48540 KB Output is correct
70 Correct 62 ms 57608 KB Output is correct
71 Correct 62 ms 57576 KB Output is correct
72 Correct 68 ms 57628 KB Output is correct
73 Correct 64 ms 57628 KB Output is correct
74 Correct 27 ms 31632 KB Output is correct
75 Correct 26 ms 31668 KB Output is correct
76 Correct 27 ms 31632 KB Output is correct
77 Correct 26 ms 31660 KB Output is correct
78 Correct 525 ms 47996 KB Output is correct
79 Correct 714 ms 48412 KB Output is correct
80 Correct 970 ms 48464 KB Output is correct
81 Correct 833 ms 57584 KB Output is correct
82 Correct 948 ms 57652 KB Output is correct
83 Correct 746 ms 57628 KB Output is correct
84 Correct 769 ms 57644 KB Output is correct
85 Correct 638 ms 31636 KB Output is correct
86 Correct 565 ms 31660 KB Output is correct
87 Correct 661 ms 31668 KB Output is correct
88 Correct 552 ms 31640 KB Output is correct
89 Correct 605 ms 31644 KB Output is correct
90 Correct 571 ms 31648 KB Output is correct
91 Correct 0 ms 208 KB Output is correct
92 Correct 1 ms 848 KB Output is correct
93 Correct 1 ms 848 KB Output is correct
94 Correct 55 ms 48388 KB Output is correct
95 Correct 64 ms 57600 KB Output is correct
96 Correct 62 ms 57632 KB Output is correct
97 Correct 28 ms 31644 KB Output is correct
98 Correct 25 ms 31648 KB Output is correct
99 Correct 50 ms 48520 KB Output is correct
100 Correct 74 ms 57580 KB Output is correct
101 Correct 69 ms 57536 KB Output is correct
102 Correct 31 ms 31536 KB Output is correct
103 Correct 26 ms 31644 KB Output is correct
104 Correct 1 ms 1232 KB Output is correct
105 Correct 1 ms 1360 KB Output is correct
106 Correct 1 ms 1360 KB Output is correct
107 Correct 1 ms 928 KB Output is correct
108 Correct 1 ms 848 KB Output is correct
109 Correct 1 ms 1232 KB Output is correct
110 Correct 1 ms 1360 KB Output is correct
111 Correct 1 ms 1360 KB Output is correct
112 Correct 1 ms 848 KB Output is correct
113 Correct 1 ms 848 KB Output is correct
114 Correct 227 ms 11592 KB Output is correct
115 Correct 800 ms 48540 KB Output is correct
116 Correct 713 ms 48524 KB Output is correct
117 Correct 723 ms 57588 KB Output is correct
118 Correct 785 ms 57628 KB Output is correct
119 Correct 805 ms 57628 KB Output is correct
120 Correct 719 ms 57628 KB Output is correct
121 Correct 675 ms 31660 KB Output is correct
122 Correct 564 ms 31568 KB Output is correct
123 Correct 663 ms 31668 KB Output is correct
124 Correct 563 ms 31608 KB Output is correct
125 Correct 52 ms 48496 KB Output is correct
126 Correct 62 ms 57584 KB Output is correct
127 Correct 63 ms 57536 KB Output is correct
128 Correct 30 ms 31632 KB Output is correct
129 Correct 28 ms 31616 KB Output is correct
130 Correct 49 ms 46708 KB Output is correct
131 Correct 51 ms 48500 KB Output is correct
132 Correct 52 ms 48512 KB Output is correct
133 Correct 64 ms 57580 KB Output is correct
134 Correct 63 ms 57628 KB Output is correct
135 Correct 63 ms 57580 KB Output is correct
136 Correct 64 ms 57588 KB Output is correct
137 Correct 26 ms 31668 KB Output is correct
138 Correct 26 ms 31620 KB Output is correct
139 Correct 26 ms 31612 KB Output is correct
140 Correct 32 ms 31556 KB Output is correct
141 Correct 1 ms 1232 KB Output is correct
142 Correct 1 ms 1360 KB Output is correct
143 Correct 1 ms 1360 KB Output is correct
144 Correct 1 ms 848 KB Output is correct
145 Correct 1 ms 848 KB Output is correct
146 Correct 1 ms 720 KB Output is correct
147 Correct 1 ms 1232 KB Output is correct
148 Correct 1 ms 1104 KB Output is correct
149 Correct 1 ms 1360 KB Output is correct
150 Correct 2 ms 1360 KB Output is correct
151 Correct 1 ms 1360 KB Output is correct
152 Correct 1 ms 1360 KB Output is correct
153 Correct 1 ms 848 KB Output is correct
154 Correct 1 ms 848 KB Output is correct
155 Correct 1 ms 848 KB Output is correct
156 Correct 1 ms 848 KB Output is correct
157 Correct 685 ms 43000 KB Output is correct
158 Correct 782 ms 48416 KB Output is correct
159 Correct 809 ms 48492 KB Output is correct
160 Correct 883 ms 57628 KB Output is correct
161 Correct 864 ms 57584 KB Output is correct
162 Correct 867 ms 57600 KB Output is correct
163 Correct 764 ms 57584 KB Output is correct
164 Correct 612 ms 31616 KB Output is correct
165 Correct 608 ms 31616 KB Output is correct
166 Correct 585 ms 31612 KB Output is correct
167 Correct 662 ms 31668 KB Output is correct
168 Correct 1 ms 292 KB Output is correct
169 Correct 472 ms 16936 KB Output is correct
170 Correct 946 ms 48300 KB Output is correct
171 Correct 948 ms 48476 KB Output is correct
172 Correct 936 ms 57628 KB Output is correct
173 Correct 964 ms 57628 KB Output is correct
174 Correct 971 ms 57604 KB Output is correct
175 Correct 976 ms 57668 KB Output is correct
176 Correct 593 ms 31616 KB Output is correct
177 Correct 634 ms 31660 KB Output is correct
178 Correct 601 ms 31660 KB Output is correct
179 Correct 798 ms 31668 KB Output is correct