답안 #732944

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
732944 2023-04-29T17:14:03 Z bin9638 자매 도시 (APIO20_swap) C++17
100 / 100
1094 ms 68640 KB
#include <bits/stdc++.h>

#ifndef SKY
#include "swap.h"
#endif // SKY

using namespace std;

#define N 200010
#define ll long long
#define fs first
#define sc second
#define ii pair<int,int>
#define pb push_back

const int root=2;

vector<ii>g[N];
vector<int>f[N];
vector<ii>vec[N];
int unpicked[N],sz[N],n,m,head[N],dp[N],times,LOG,chain,in[N],pos[N],picked[N],MV[N];
ii cha[N][21],cnt[N];

struct IT_LAZY
{
    int ST[N*4]={};

    void init()
    {
        for(int i=1;i<=n*4;i++)
            ST[i]=2e9;
    }

    void update(int id,int l,int r,int u,int v,int val)
    {
        if(l>v||r<u)
            return;
        if(l>=u&&r<=v)
        {
            ST[id]=min(ST[id],val);
            return;
        }
        int mid=(l+r)/2;
        update(id*2,l,mid,u,v,val);
        update(id*2+1,mid+1,r,u,v,val);
    }

    int get(int id,int l,int r,int i)
    {
        if(l>i||r<i)
            return 2e9;
        if(l==r)
            return ST[id];
        int res=ST[id];
        int mid=(l+r)/2;
        res=min(res,get(id*2,l,mid,i));
        res=min(res,get(id*2+1,mid+1,r,i));
        return res;
    }

    void hld_update(int r,int u,int cost)
    {
        while(in[u]!=in[r])
        {
            update(1,1,n,pos[head[in[u]]],pos[u],cost);
            u=cha[head[in[u]]][0].sc;
        }
        if(r==u)
            return;
        update(1,1,n,pos[MV[u]],pos[u],cost);
    }
}IT_LAZY;

struct IT
{
    int ST[N*4]={};

    void init()
    {
        for(int i=1;i<=n*4;i++)
            ST[i]=2e9;
    }

    void update(int id,int l,int r,int i,int val)
    {
        if(l>i||r<i)
            return;
        if(l==r)
        {
            ST[id]=val;
            return;
        }
        int mid=(l+r)/2;
        update(id*2,l,mid,i,val);
        update(id*2+1,mid+1,r,i,val);
        ST[id]=min(ST[id*2],ST[id*2+1]);
    }

    int get(int id,int l,int r,int u,int v)
    {
        if(l>v||r<u)
            return 2e9;
        if(l>=u&&r<=v)
            return ST[id];
        int mid=(l+r)/2;
        return min(get(id*2,l,mid,u,v),get(id*2+1,mid+1,r,u,v));
    }
}IT;

struct DSU
{
    int lab[N];

    void init()
    {
        memset(lab,-1,sizeof(lab));
    }

    int root(int u)
    {
        if(lab[u]<0)
            return u;
        return(lab[u]=root(lab[u]));
    }

    bool update(int u,int v)
    {
        if((u=root(u))==(v=root(v)))
            return 0;
        if(lab[u]>lab[v])
            swap(u,v);
        lab[u]+=lab[v];
        lab[v]=u;
        return 1;
    }
}DSU;

struct canh
{
    int u,v,w;

    bool operator<(const canh&A)const
    {
        return w<A.w;
    }
};
vector<canh>edge;

int get_min(int u,int A,int B)
{
    if(f[u].size()<3)
        return 2e9;
    if(A>B)
        swap(A,B);
    if(f[u][0]!=A)
        return f[u][0];
    if(f[u][1]!=B)
        return f[u][1];
    return f[u][2];
}

void DFS(int u,int p)
{
    cnt[u].fs=++times;
    sz[u]=1;
    for(auto v:g[u])
        if(v.sc!=p)
        {
            cha[v.sc][0]={v.fs,u};
            DFS(v.sc,u);
            sz[u]+=sz[v.sc];
        }
    cnt[u].sc=times;
}

void hld(int u,int p)
{
    in[u]=chain;
    pos[u]=++times;
    if(head[chain]==0)
        head[chain]=u;
    for(auto v:g[u])
        if(v.sc!=p&&(MV[u]==0||sz[v.sc]>sz[MV[u]]))
            MV[u]=v.sc;
    if(MV[u]==0)
        return;
    hld(MV[u],u);
    for(auto v:g[u])
        if(v.sc!=p&&v.sc!=MV[u])
        {
            chain++;
            hld(v.sc,u);
        }
}

bool tren(int u,int v)
{
    return(cnt[u].fs<=cnt[v].fs&&cnt[u].sc>=cnt[v].sc);
}

int lca(int u,int v)
{
    if(tren(u,v))
        return u;
    if(tren(v,u))
        return v;
    for(int k=LOG;k>=0;k--)
        if(cha[u][k].sc!=0&&!tren(cha[u][k].sc,v))
            u=cha[u][k].sc;
    return cha[u][0].sc;
}

int con_duoi(int r,int u)
{
    for(int k=LOG;k>=0;k--)
        if(cha[u][k].sc!=0&&!tren(cha[u][k].sc,r))
            u=cha[u][k].sc;
    return u;
}

int get_max(int r,int u)
{
    if(r==u)
        return 0;
    int res=0;
    for(int k=LOG;k>=0;k--)
        if(cha[u][k].sc!=0&&!tren(cha[u][k].sc,r))
        {
            res=max(res,cha[u][k].fs);
            u=cha[u][k].sc;
        }
    return max(res,cha[u][0].fs);
}

int get_2_con(int u,int A)
{
    if(f[u].size()<3)
        return 2e9;
    if(f[u][0]==A)
        return max(f[u][1],f[u][2]);
    if(f[u][1]==A)
        return max(f[u][0],f[u][2]);
    return max(f[u][0],f[u][1]);
}

void build(int u,int p)
{
    if(u!=root)
        dp[u]=get_2_con(u,cha[u][0].fs);
            else dp[u]=get_2_con(u,2e9);
    dp[u]=min(dp[u],unpicked[u]);
    for(auto v:g[u])
        if(v.sc!=p)
        {
            build(v.sc,u);
            dp[u]=min(dp[u],max(v.fs,dp[v.sc]));
        }
}

void nguoc(int u,int p,int val)
{
    for(auto v:g[u])
        if(v.sc!=p)
            vec[u].pb({max(v.fs,dp[v.sc]),v.sc});
    sort(vec[u].begin(),vec[u].end());
    for(auto v:g[u])
        if(v.sc!=p)
        {
            if(v.sc==vec[u][0].sc)
            {
                nguoc(v.sc,u, max(v.fs,min(min(unpicked[u],get_2_con(u,v.fs)),min((vec[u].size()<2 ? (int)2e9 : vec[u][1].fs),val))));
            }else
            {
                nguoc(v.sc,u,max(v.fs,min(min(unpicked[u],get_2_con(u,v.fs)),min(vec[u][0].fs,val))));
            }
        }
    vec[u].clear();
    for(auto v:g[u])
        if(v.sc!=p&&dp[v.sc]<=1e9)
            vec[u].pb({max(v.fs,dp[v.sc]),v.sc});
    if(val<=1e9)
        vec[u].pb({val,p});
    sort(vec[u].begin(),vec[u].end());
}

void init(int NNN, int MMM,vector<int> UUU,vector<int> VVV, vector<int> WWW)
{
    n=NNN;
    m=MMM;
  //  assert(m==n-1);
    for(int i=0;i<m;i++)
    {
        UUU[i]++;
        VVV[i]++;
        edge.pb({UUU[i],VVV[i],WWW[i]});
        f[UUU[i]].pb(WWW[i]);
        f[VVV[i]].pb(WWW[i]);
    }
    sort(edge.begin(),edge.end());
    DSU.init();
    for(int i=0;i<m;i++)
        if(DSU.update(edge[i].u,edge[i].v))
        {
          //  cout<<edge[i].u-1<<" "<<edge[i].v-1<<endl;
            picked[i]=1;
            g[edge[i].u].pb({edge[i].w,edge[i].v});
            g[edge[i].v].pb({edge[i].w,edge[i].u});
        }
    for(int i=1;i<=n;i++)
        sort(f[i].begin(),f[i].end());
   DFS(root,0);
   times=0;
   hld(root,0);
    LOG=log2(n);
    for(int k=1;k<=LOG;k++)
        for(int i=1;i<=n;i++)
          cha[i][k]={max(cha[cha[i][k-1].sc][k-1].fs,cha[i][k-1].fs),cha[cha[i][k-1].sc][k-1].sc};
    IT.init();
    for(int i=1;i<=n;i++)
        if(i!=root&&cha[i][0].sc!=root)
            IT.update(1,1,n,pos[i],get_min(cha[i][0].sc,cha[i][0].fs,cha[cha[i][0].sc][0].fs));
    IT_LAZY.init();
    memset(unpicked,0x3f3f,sizeof(unpicked));
    for(int i=0;i<m;i++)
        if(picked[i]==0)
        {
            int u=edge[i].u,v=edge[i].v,r=lca(u,v),cost=max(edge[i].w,max(get_max(r,u),get_max(r,v)));
            IT_LAZY.hld_update(r,u,cost);
            IT_LAZY.hld_update(r,v,cost);
            unpicked[u]=min(unpicked[u],edge[i].w);
            unpicked[v]=min(unpicked[v],edge[i].w);
        }
    memset(dp,0x3f3f,sizeof(dp));
    build(root,0);
    nguoc(root,0,2e9);
   // exit(0);
}

int get(int r,int u)
{
    int res=2e9;
    while(in[u]!=in[r])
    {
        res=min(res,IT.get(1,1,n,pos[head[in[u]]],pos[u]));
        u=cha[head[in[u]]][0].sc;
    }
    if(u==r)
        return res;
    return min(res,IT.get(1,1,n,pos[MV[r]],pos[u]));
}

int get_cay_vl(int u,int c)
{
    if(vec[u].empty())
        return 2e9;
    if(vec[u][0].sc==c)
    {
        if(vec[u].size()<2)
            return 2e9;
        return vec[u][1].fs;
    }
    return vec[u][0].fs;
}

int getMinimumFuelCapacity(int u, int v)
{
    u++;
    v++;
    int r=lca(u,v),res=2e9;///max(get_max(r,u),get_max(r,v));
    if(r==u)
        swap(u,v);
     //  cout<<u-1<<" "<<v-1<<" "<<r-1<<" "<<con_duoi(r,u)-1<<endl;
    if(u!=r)
        res=min(res,get(con_duoi(r,u),u));
    if(v!=r)
        res=min(res,get(con_duoi(r,v),v));
   // assert(v==1||u==1);
    if(r==v)
    {
        res=min(res,get_2_con(r,cha[con_duoi(r,u)][0].fs));
        res=min(res,get_2_con(u,cha[u][0].fs));
        res=min(res,get_cay_vl(r,con_duoi(r,u)));
        res=min(res,get_cay_vl(u,cha[u][0].sc));
    }else
    {
        res=min(res,get_2_con(u,cha[u][0].fs));
        res=min(res,get_2_con(v,cha[v][0].fs));
        res=min(res,get_min(r,cha[con_duoi(r,u)][0].fs,cha[con_duoi(r,v)][0].fs));
       res=min(res,get_cay_vl(u,cha[u][0].sc));
       res=min(res,get_cay_vl(v,cha[v][0].sc));
    }
  /*  if(u!=r)
        res=min(res,IT_LAZY.get(1,1,n,pos[u]));
    if(v!=r)
        res=min(res,IT_LAZY.get(1,1,n,pos[v]));*/
    res=min(res,unpicked[u]);
    res=min(res,unpicked[v]);
   // cout<<res<<endl;
    res=max(res,max(get_max(r,u),get_max(r,v)));
    if(res<=1e9)
        return res;
            else return -1;
}


#ifdef SKY
int main()
{
    freopen("A.inp","r",stdin);
    freopen("A.out","w",stdout);
    ios::sync_with_stdio(0);
    cin.tie(NULL);
    cout.tie(NULL);
    int n,m;
    cin>>n>>m;
    vector<int>U(m),V(m),W(m);
    for(int i=0;i<m;i++)
        cin>>U[i];
    for(int i=0;i<m;i++)
        cin>>V[i];
    for(int i=0;i<m;i++)
        cin>>W[i];
    init(n,m,U,V,W);
    int q;
    cin>>q;
    while(q--)
    {
        int u,v;
        cin>>u>>v;
        cout<<getMinimumFuelCapacity(u,v)<<endl;
    }
    return 0;
}
#endif
# 결과 실행 시간 메모리 Grader output
1 Correct 8 ms 16724 KB Output is correct
2 Correct 8 ms 16724 KB Output is correct
3 Correct 8 ms 16852 KB Output is correct
4 Correct 9 ms 16980 KB Output is correct
5 Correct 9 ms 17108 KB Output is correct
6 Correct 10 ms 17108 KB Output is correct
7 Correct 9 ms 17176 KB Output is correct
8 Correct 11 ms 17264 KB Output is correct
9 Correct 168 ms 51388 KB Output is correct
10 Correct 206 ms 60172 KB Output is correct
11 Correct 194 ms 57216 KB Output is correct
12 Correct 240 ms 59388 KB Output is correct
13 Correct 203 ms 62120 KB Output is correct
14 Correct 220 ms 49768 KB Output is correct
15 Correct 648 ms 61056 KB Output is correct
16 Correct 635 ms 57748 KB Output is correct
17 Correct 670 ms 61032 KB Output is correct
18 Correct 673 ms 62484 KB Output is correct
19 Correct 214 ms 27364 KB Output is correct
20 Correct 711 ms 62168 KB Output is correct
21 Correct 697 ms 61576 KB Output is correct
22 Correct 746 ms 64212 KB Output is correct
23 Correct 750 ms 60772 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 8 ms 16724 KB Output is correct
2 Correct 8 ms 16724 KB Output is correct
3 Correct 300 ms 54972 KB Output is correct
4 Correct 308 ms 56732 KB Output is correct
5 Correct 319 ms 55832 KB Output is correct
6 Correct 306 ms 56480 KB Output is correct
7 Correct 295 ms 56224 KB Output is correct
8 Correct 308 ms 54724 KB Output is correct
9 Correct 284 ms 55988 KB Output is correct
10 Correct 289 ms 54424 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 8 ms 16724 KB Output is correct
2 Correct 8 ms 16724 KB Output is correct
3 Correct 8 ms 16852 KB Output is correct
4 Correct 9 ms 16980 KB Output is correct
5 Correct 9 ms 17108 KB Output is correct
6 Correct 10 ms 17108 KB Output is correct
7 Correct 9 ms 17176 KB Output is correct
8 Correct 11 ms 17264 KB Output is correct
9 Correct 11 ms 16724 KB Output is correct
10 Correct 12 ms 17056 KB Output is correct
11 Correct 10 ms 17176 KB Output is correct
12 Correct 9 ms 17100 KB Output is correct
13 Correct 10 ms 17108 KB Output is correct
14 Correct 9 ms 17108 KB Output is correct
15 Correct 11 ms 17188 KB Output is correct
16 Correct 11 ms 17092 KB Output is correct
17 Correct 10 ms 17236 KB Output is correct
18 Correct 12 ms 17108 KB Output is correct
19 Correct 10 ms 16980 KB Output is correct
20 Correct 9 ms 17108 KB Output is correct
21 Correct 9 ms 17108 KB Output is correct
22 Correct 10 ms 16852 KB Output is correct
23 Correct 10 ms 17028 KB Output is correct
24 Correct 12 ms 17132 KB Output is correct
25 Correct 11 ms 17236 KB Output is correct
26 Correct 11 ms 17268 KB Output is correct
27 Correct 11 ms 17236 KB Output is correct
28 Correct 11 ms 17256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 11 ms 16724 KB Output is correct
2 Correct 8 ms 16724 KB Output is correct
3 Correct 8 ms 16724 KB Output is correct
4 Correct 8 ms 16852 KB Output is correct
5 Correct 9 ms 16980 KB Output is correct
6 Correct 9 ms 17108 KB Output is correct
7 Correct 10 ms 17108 KB Output is correct
8 Correct 9 ms 17176 KB Output is correct
9 Correct 11 ms 17264 KB Output is correct
10 Correct 168 ms 51388 KB Output is correct
11 Correct 206 ms 60172 KB Output is correct
12 Correct 194 ms 57216 KB Output is correct
13 Correct 240 ms 59388 KB Output is correct
14 Correct 203 ms 62120 KB Output is correct
15 Correct 12 ms 17056 KB Output is correct
16 Correct 10 ms 17176 KB Output is correct
17 Correct 9 ms 17100 KB Output is correct
18 Correct 10 ms 17108 KB Output is correct
19 Correct 9 ms 17108 KB Output is correct
20 Correct 11 ms 17188 KB Output is correct
21 Correct 11 ms 17092 KB Output is correct
22 Correct 10 ms 17236 KB Output is correct
23 Correct 12 ms 17108 KB Output is correct
24 Correct 10 ms 16980 KB Output is correct
25 Correct 9 ms 17108 KB Output is correct
26 Correct 9 ms 17108 KB Output is correct
27 Correct 10 ms 16852 KB Output is correct
28 Correct 10 ms 17028 KB Output is correct
29 Correct 12 ms 17132 KB Output is correct
30 Correct 11 ms 17236 KB Output is correct
31 Correct 11 ms 17268 KB Output is correct
32 Correct 11 ms 17236 KB Output is correct
33 Correct 11 ms 17256 KB Output is correct
34 Correct 30 ms 21596 KB Output is correct
35 Correct 210 ms 58684 KB Output is correct
36 Correct 202 ms 54664 KB Output is correct
37 Correct 213 ms 53420 KB Output is correct
38 Correct 196 ms 51960 KB Output is correct
39 Correct 212 ms 51604 KB Output is correct
40 Correct 174 ms 48828 KB Output is correct
41 Correct 219 ms 57820 KB Output is correct
42 Correct 215 ms 56576 KB Output is correct
43 Correct 183 ms 60284 KB Output is correct
44 Correct 205 ms 52880 KB Output is correct
45 Correct 377 ms 51548 KB Output is correct
46 Correct 208 ms 56220 KB Output is correct
47 Correct 214 ms 53840 KB Output is correct
48 Correct 249 ms 54400 KB Output is correct
49 Correct 167 ms 27872 KB Output is correct
50 Correct 198 ms 27232 KB Output is correct
51 Correct 260 ms 45624 KB Output is correct
52 Correct 375 ms 59768 KB Output is correct
53 Correct 361 ms 60312 KB Output is correct
54 Correct 427 ms 65168 KB Output is correct
55 Correct 176 ms 61664 KB Output is correct
56 Correct 423 ms 59868 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 8 ms 16724 KB Output is correct
2 Correct 8 ms 16724 KB Output is correct
3 Correct 8 ms 16852 KB Output is correct
4 Correct 9 ms 16980 KB Output is correct
5 Correct 9 ms 17108 KB Output is correct
6 Correct 10 ms 17108 KB Output is correct
7 Correct 9 ms 17176 KB Output is correct
8 Correct 11 ms 17264 KB Output is correct
9 Correct 168 ms 51388 KB Output is correct
10 Correct 206 ms 60172 KB Output is correct
11 Correct 194 ms 57216 KB Output is correct
12 Correct 240 ms 59388 KB Output is correct
13 Correct 203 ms 62120 KB Output is correct
14 Correct 220 ms 49768 KB Output is correct
15 Correct 648 ms 61056 KB Output is correct
16 Correct 635 ms 57748 KB Output is correct
17 Correct 670 ms 61032 KB Output is correct
18 Correct 673 ms 62484 KB Output is correct
19 Correct 300 ms 54972 KB Output is correct
20 Correct 308 ms 56732 KB Output is correct
21 Correct 319 ms 55832 KB Output is correct
22 Correct 306 ms 56480 KB Output is correct
23 Correct 295 ms 56224 KB Output is correct
24 Correct 308 ms 54724 KB Output is correct
25 Correct 284 ms 55988 KB Output is correct
26 Correct 289 ms 54424 KB Output is correct
27 Correct 12 ms 17056 KB Output is correct
28 Correct 10 ms 17176 KB Output is correct
29 Correct 9 ms 17100 KB Output is correct
30 Correct 10 ms 17108 KB Output is correct
31 Correct 9 ms 17108 KB Output is correct
32 Correct 11 ms 17188 KB Output is correct
33 Correct 11 ms 17092 KB Output is correct
34 Correct 10 ms 17236 KB Output is correct
35 Correct 12 ms 17108 KB Output is correct
36 Correct 30 ms 21596 KB Output is correct
37 Correct 210 ms 58684 KB Output is correct
38 Correct 202 ms 54664 KB Output is correct
39 Correct 213 ms 53420 KB Output is correct
40 Correct 196 ms 51960 KB Output is correct
41 Correct 212 ms 51604 KB Output is correct
42 Correct 174 ms 48828 KB Output is correct
43 Correct 219 ms 57820 KB Output is correct
44 Correct 215 ms 56576 KB Output is correct
45 Correct 183 ms 60284 KB Output is correct
46 Correct 205 ms 52880 KB Output is correct
47 Correct 60 ms 21540 KB Output is correct
48 Correct 684 ms 60124 KB Output is correct
49 Correct 770 ms 57576 KB Output is correct
50 Correct 797 ms 55884 KB Output is correct
51 Correct 889 ms 55244 KB Output is correct
52 Correct 743 ms 52524 KB Output is correct
53 Correct 676 ms 44184 KB Output is correct
54 Correct 753 ms 59068 KB Output is correct
55 Correct 724 ms 59744 KB Output is correct
56 Correct 694 ms 63336 KB Output is correct
57 Correct 882 ms 56176 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 11 ms 16724 KB Output is correct
2 Correct 8 ms 16724 KB Output is correct
3 Correct 8 ms 16724 KB Output is correct
4 Correct 8 ms 16852 KB Output is correct
5 Correct 9 ms 16980 KB Output is correct
6 Correct 9 ms 17108 KB Output is correct
7 Correct 10 ms 17108 KB Output is correct
8 Correct 9 ms 17176 KB Output is correct
9 Correct 11 ms 17264 KB Output is correct
10 Correct 168 ms 51388 KB Output is correct
11 Correct 206 ms 60172 KB Output is correct
12 Correct 194 ms 57216 KB Output is correct
13 Correct 240 ms 59388 KB Output is correct
14 Correct 203 ms 62120 KB Output is correct
15 Correct 220 ms 49768 KB Output is correct
16 Correct 648 ms 61056 KB Output is correct
17 Correct 635 ms 57748 KB Output is correct
18 Correct 670 ms 61032 KB Output is correct
19 Correct 673 ms 62484 KB Output is correct
20 Correct 300 ms 54972 KB Output is correct
21 Correct 308 ms 56732 KB Output is correct
22 Correct 319 ms 55832 KB Output is correct
23 Correct 306 ms 56480 KB Output is correct
24 Correct 295 ms 56224 KB Output is correct
25 Correct 308 ms 54724 KB Output is correct
26 Correct 284 ms 55988 KB Output is correct
27 Correct 289 ms 54424 KB Output is correct
28 Correct 12 ms 17056 KB Output is correct
29 Correct 10 ms 17176 KB Output is correct
30 Correct 9 ms 17100 KB Output is correct
31 Correct 10 ms 17108 KB Output is correct
32 Correct 9 ms 17108 KB Output is correct
33 Correct 11 ms 17188 KB Output is correct
34 Correct 11 ms 17092 KB Output is correct
35 Correct 10 ms 17236 KB Output is correct
36 Correct 12 ms 17108 KB Output is correct
37 Correct 30 ms 21596 KB Output is correct
38 Correct 210 ms 58684 KB Output is correct
39 Correct 202 ms 54664 KB Output is correct
40 Correct 213 ms 53420 KB Output is correct
41 Correct 196 ms 51960 KB Output is correct
42 Correct 212 ms 51604 KB Output is correct
43 Correct 174 ms 48828 KB Output is correct
44 Correct 219 ms 57820 KB Output is correct
45 Correct 215 ms 56576 KB Output is correct
46 Correct 183 ms 60284 KB Output is correct
47 Correct 205 ms 52880 KB Output is correct
48 Correct 60 ms 21540 KB Output is correct
49 Correct 684 ms 60124 KB Output is correct
50 Correct 770 ms 57576 KB Output is correct
51 Correct 797 ms 55884 KB Output is correct
52 Correct 889 ms 55244 KB Output is correct
53 Correct 743 ms 52524 KB Output is correct
54 Correct 676 ms 44184 KB Output is correct
55 Correct 753 ms 59068 KB Output is correct
56 Correct 724 ms 59744 KB Output is correct
57 Correct 694 ms 63336 KB Output is correct
58 Correct 882 ms 56176 KB Output is correct
59 Correct 214 ms 27364 KB Output is correct
60 Correct 711 ms 62168 KB Output is correct
61 Correct 697 ms 61576 KB Output is correct
62 Correct 746 ms 64212 KB Output is correct
63 Correct 750 ms 60772 KB Output is correct
64 Correct 10 ms 16980 KB Output is correct
65 Correct 9 ms 17108 KB Output is correct
66 Correct 9 ms 17108 KB Output is correct
67 Correct 10 ms 16852 KB Output is correct
68 Correct 10 ms 17028 KB Output is correct
69 Correct 12 ms 17132 KB Output is correct
70 Correct 11 ms 17236 KB Output is correct
71 Correct 11 ms 17268 KB Output is correct
72 Correct 11 ms 17236 KB Output is correct
73 Correct 11 ms 17256 KB Output is correct
74 Correct 377 ms 51548 KB Output is correct
75 Correct 208 ms 56220 KB Output is correct
76 Correct 214 ms 53840 KB Output is correct
77 Correct 249 ms 54400 KB Output is correct
78 Correct 167 ms 27872 KB Output is correct
79 Correct 198 ms 27232 KB Output is correct
80 Correct 260 ms 45624 KB Output is correct
81 Correct 375 ms 59768 KB Output is correct
82 Correct 361 ms 60312 KB Output is correct
83 Correct 427 ms 65168 KB Output is correct
84 Correct 176 ms 61664 KB Output is correct
85 Correct 423 ms 59868 KB Output is correct
86 Correct 226 ms 30928 KB Output is correct
87 Correct 759 ms 60420 KB Output is correct
88 Correct 813 ms 61540 KB Output is correct
89 Correct 698 ms 56932 KB Output is correct
90 Correct 404 ms 31952 KB Output is correct
91 Correct 574 ms 34612 KB Output is correct
92 Correct 834 ms 50512 KB Output is correct
93 Correct 1045 ms 65304 KB Output is correct
94 Correct 1094 ms 64072 KB Output is correct
95 Correct 1028 ms 68640 KB Output is correct
96 Correct 779 ms 65712 KB Output is correct
97 Correct 914 ms 62456 KB Output is correct