답안 #978223

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
978223 2024-05-09T04:10:51 Z model_code Card Collection (JOI24_collection) C++17
100 / 100
2076 ms 100292 KB
#include <bits/stdc++.h>
using namespace std;

using ll=long long;

#define rng(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,b) rng(i,0,b)
#define gnr(i,a,b) for(int i=int(b)-1;i>=int(a);i--)
#define per(i,b) gnr(i,0,b)
#define pb push_back
#define eb emplace_back
#define a first
#define b second
#define bg begin()
#define ed end()
#define all(x) x.bg,x.ed
#define si(x) int(x.size())
#ifdef LOCAL
#define dmp(x) cerr<<__LINE__<<" "<<#x<<" "<<x<<endl
#else
#define dmp(x) void(0)
#endif

template<class t,class u> bool chmax(t&a,u b){if(a<b){a=b;return true;}else return false;}
template<class t,class u> bool chmin(t&a,u b){if(b<a){a=b;return true;}else return false;}

template<class t> using vc=vector<t>;
template<class t> using vvc=vc<vc<t>>;

const int INF = 1000000000;
using P=pair<int,int>;
using vi=vc<int>;

struct segtree{
    vc<int> smn,smx;
    int mum;

    void init(int n){
        mum=1;
        while(mum<n) mum<<=1;
        smn.resize(mum*2);
        smx.resize(mum*2);
        for(int i=0;i<mum*2;i++){
            smn[i]=INF;
            smx[i]=-INF;
        }
    }
    void add(int k,int x){
        k+=mum-1;
        smn[k]=smx[k]=x;
        while(k>0){
            k=(k-1)/2;
            smn[k]=min(smn[k*2+1],smn[k*2+2]);
            smx[k]=max(smx[k*2+1],smx[k*2+2]);
        }
    }
    int get_min(int a,int b,int k,int l,int r){
        if(b<=l||r<=a) return INF;
        if(a<=l&&r<=b) return smn[k];
        else{
            int vl=get_min(a,b,k*2+1,l,(l+r)/2);
            int vr=get_min(a,b,k*2+2,(l+r)/2,r);
            return min(vl,vr);
        }
    }
    int get_min(int a,int b){
        return get_min(a,b,0,0,mum);
    }
    int get_max(int a,int b,int k,int l,int r){
        if(b<=l||r<=a) return -INF;
        if(a<=l&&r<=b) return smx[k];
        else{
            int vl=get_max(a,b,k*2+1,l,(l+r)/2);
            int vr=get_max(a,b,k*2+2,(l+r)/2,r);
            return max(vl,vr);
        }
    }
    int get_max(int a,int b){
        return get_max(a,b,0,0,mum);
    }
    int query(int w){
        if(smn[0]>w) return INF;
        int k=0,l=0,r=mum;
        while(l+1<r){
            if(smn[k*2+1]<=w){
                k=k*2+1;
                r=(l+r)/2;
            } else{
                k=k*2+2;
                l=(l+r)/2;
            }
        }
        return l;
    }
};

vc<int> run(vc<int> S,vc<int> V,vc<int> T,vc<int> W){
    int n=S.size(),m=T.size();
    vc<int> vs=S;
    sort(vs.begin(),vs.end());
    vs.erase(unique(vs.begin(),vs.end()),vs.end());
    for(int i=0;i<n;i++) S[i]=lower_bound(vs.begin(),vs.end(),S[i])-vs.begin();
    vc<int> vv=V;
    sort(vv.begin(),vv.end());
    vv.erase(unique(vv.begin(),vv.end()),vv.end());
    for(int i=0;i<n;i++) V[i]=lower_bound(vv.begin(),vv.end(),V[i])-vv.begin();

    vc<int> ps(vs.size()),pv(vv.size());
    for(int i=n-1;i>=0;i--) ps[S[i]]=i;
    for(int i=0;i<n;i++) pv[V[i]]=i;

    vc<int> ng(m);
    vc<vc<P>> q1(vs.size()),q2(vv.size());
    vc<vc<P>> a1(vs.size()),a2(vv.size());
    for(int i=0;i<n;i++){
        a1[S[i]].pb(P(i,V[i]));
        a2[V[i]].pb(P(i,S[i]));
    }
    vc<int> x(m),y(m),z(m),w(m);
    for(int i=0;i<m;i++){
        ng[i]=1;
        int p=lower_bound(vs.begin(),vs.end(),T[i])-vs.begin();
        if(p==vs.size()||vs[p]!=T[i]) continue;
        T[i]=p;
        int q=lower_bound(vv.begin(),vv.end(),W[i])-vv.begin();
        if(q==vv.size()||vv[q]!=W[i]) continue;
        W[i]=q;
        ng[i]=0;
        x[i]=ps[T[i]];
        y[i]=pv[W[i]];
        q1[T[i]].pb(P(i,W[i]));
        q2[W[i]].pb(P(i,T[i]));
    }
    segtree ss,sv;
    ss.init(n);
    sv.init(n);
    for(int i=0;i<n;i++){
        ss.add(i,S[i]);
        sv.add(i,V[i]);
    }
    segtree s1;
    s1.init(n);
    for(int i=vs.size()-1;i>=0;i--){
        for(int j=0;j<a1[i].size();j++){
            P p=a1[i][j];
            s1.add(p.a,p.b);
        }
        for(int j=0;j<q1[i].size();j++){
            P p=q1[i][j];
            int r=s1.query(p.b);
            if(0<r&&r<n&&ss.get_max(0,r)<i&&sv.get_min(0,r)>p.b){
                s1.add(r,INF);
                int nr=s1.query(p.b);
                s1.add(r,V[r]);
                r=nr;
            }
            z[p.a]=r;
        }
    }
    segtree s2;
    s2.init(n);
    for(int i=vv.size()-1;i>=0;i--){
        for(int j=0;j<a2[i].size();j++){
            P p=a2[i][j];
            s2.add(n-p.a-1,p.b);
        }
        for(int j=0;j<q2[i].size();j++){
            P p=q2[i][j];
            int r=s2.query(p.b);
            if(0<r&&r<n&&sv.get_max(n-r,n)<i&&ss.get_min(n-r,n)>p.b){
                s2.add(r,INF);
                int nr=s2.query(p.b);
                s2.add(r,S[n-r-1]);
                r=nr;
            }
            w[p.a]=n-r-1;
        }
    }
    vc<int> ret;
    for(int i=0;i<m;i++){
        if(!ng[i]&&max(x[i],z[i])<min(y[i],w[i])){
            ret.pb(i);
        }
    }
    return ret;
}
void solve(){
    int n,m;
    cin>>n>>m;
    vc<int> S(n),V(n);
    for(int i=0;i<n;i++) cin>>S[i]>>V[i];
    vc<int> T(m),W(m);
    for(int i=0;i<m;i++) cin>>T[i]>>W[i];

    segtree ss,sv;
    ss.init(n);
    sv.init(n);
    for(int i=0;i<n;i++){
        ss.add(i,S[i]);
        sv.add(i,V[i]);
    }
    set<P> st;
    for(int i=0;i<n;i++){
        bool up=true;
        if(i>0&&ss.get_max(0,i)<S[i]&&sv.get_min(0,i)>V[i]) up=false;
        if(i>0&&ss.get_min(0,i)>S[i]&&sv.get_max(0,i)<V[i]) up=false;
        if(i<n-1&&ss.get_max(i+1,n)<S[i]&&sv.get_min(i+1,n)>V[i]) up=false;
        if(i<n-1&&ss.get_min(i+1,n)>S[i]&&sv.get_max(i+1,n)<V[i]) up=false;
        if(up) st.insert(P(S[i],V[i]));
    }
    vc<int> ret;
    for(int i=0;i<m;i++) if(st.find(P(T[i],W[i]))!=st.end()) ret.pb(i);
    vc<int> ret2=run(S,V,T,W);
    for(int i=0;i<ret2.size();i++) ret.pb(ret2[i]);

    for(int i=0;i<n;i++) swap(S[i],V[i]);
    for(int i=0;i<m;i++) swap(T[i],W[i]);
    ret2=run(S,V,T,W);
    for(int i=0;i<ret2.size();i++) ret.pb(ret2[i]);

    for(int i=0;i<n;i++) S[i]=-S[i],V[i]=-V[i];
    for(int i=0;i<m;i++) T[i]=-T[i],W[i]=-W[i];
    ret2=run(S,V,T,W);
    for(int i=0;i<ret2.size();i++) ret.pb(ret2[i]);

    for(int i=0;i<n;i++) swap(S[i],V[i]);
    for(int i=0;i<m;i++) swap(T[i],W[i]);
    ret2=run(S,V,T,W);
    for(int i=0;i<ret2.size();i++) ret.pb(ret2[i]);

    sort(ret.begin(),ret.end());
    ret.erase(unique(ret.begin(),ret.end()),ret.end());
    for(int i=0;i<ret.size();i++){
        if(i!=0) cout<<" ";
        cout<<ret[i]+1;
    }
    cout<<endl;
}
int main(){
	cin.tie(0);
	ios::sync_with_stdio(0);
	cout<<fixed<<setprecision(20);
    solve();
}

Compilation message

Main.cpp: In function 'vc<int> run(vc<int>, vc<int>, vc<int>, vc<int>)':
Main.cpp:123:13: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  123 |         if(p==vs.size()||vs[p]!=T[i]) continue;
      |            ~^~~~~~~~~~~
Main.cpp:126:13: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  126 |         if(q==vv.size()||vv[q]!=W[i]) continue;
      |            ~^~~~~~~~~~~
Main.cpp:144:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  144 |         for(int j=0;j<a1[i].size();j++){
      |                     ~^~~~~~~~~~~~~
Main.cpp:148:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  148 |         for(int j=0;j<q1[i].size();j++){
      |                     ~^~~~~~~~~~~~~
Main.cpp:163:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  163 |         for(int j=0;j<a2[i].size();j++){
      |                     ~^~~~~~~~~~~~~
Main.cpp:167:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  167 |         for(int j=0;j<q2[i].size();j++){
      |                     ~^~~~~~~~~~~~~
Main.cpp: In function 'void solve()':
Main.cpp:214:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  214 |     for(int i=0;i<ret2.size();i++) ret.pb(ret2[i]);
      |                 ~^~~~~~~~~~~~
Main.cpp:219:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  219 |     for(int i=0;i<ret2.size();i++) ret.pb(ret2[i]);
      |                 ~^~~~~~~~~~~~
Main.cpp:224:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  224 |     for(int i=0;i<ret2.size();i++) ret.pb(ret2[i]);
      |                 ~^~~~~~~~~~~~
Main.cpp:229:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  229 |     for(int i=0;i<ret2.size();i++) ret.pb(ret2[i]);
      |                 ~^~~~~~~~~~~~
Main.cpp:233:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  233 |     for(int i=0;i<ret.size();i++){
      |                 ~^~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 0 ms 456 KB Output is correct
12 Correct 0 ms 368 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 0 ms 344 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 0 ms 348 KB Output is correct
23 Correct 1 ms 348 KB Output is correct
24 Correct 1 ms 344 KB Output is correct
25 Correct 1 ms 348 KB Output is correct
26 Correct 0 ms 344 KB Output is correct
27 Correct 1 ms 348 KB Output is correct
28 Correct 0 ms 344 KB Output is correct
29 Correct 1 ms 348 KB Output is correct
30 Correct 1 ms 348 KB Output is correct
31 Correct 1 ms 348 KB Output is correct
32 Correct 1 ms 348 KB Output is correct
33 Correct 1 ms 600 KB Output is correct
34 Correct 0 ms 348 KB Output is correct
35 Correct 0 ms 348 KB Output is correct
36 Correct 1 ms 456 KB Output is correct
37 Correct 1 ms 344 KB Output is correct
38 Correct 1 ms 344 KB Output is correct
39 Correct 0 ms 348 KB Output is correct
40 Correct 1 ms 348 KB Output is correct
41 Correct 1 ms 344 KB Output is correct
42 Correct 1 ms 600 KB Output is correct
43 Correct 0 ms 352 KB Output is correct
44 Correct 0 ms 352 KB Output is correct
45 Correct 1 ms 356 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 0 ms 456 KB Output is correct
12 Correct 0 ms 368 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 0 ms 344 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 0 ms 348 KB Output is correct
23 Correct 1 ms 348 KB Output is correct
24 Correct 1 ms 344 KB Output is correct
25 Correct 1 ms 348 KB Output is correct
26 Correct 0 ms 344 KB Output is correct
27 Correct 1 ms 348 KB Output is correct
28 Correct 0 ms 344 KB Output is correct
29 Correct 1 ms 348 KB Output is correct
30 Correct 1 ms 348 KB Output is correct
31 Correct 1 ms 348 KB Output is correct
32 Correct 1 ms 348 KB Output is correct
33 Correct 1 ms 600 KB Output is correct
34 Correct 0 ms 348 KB Output is correct
35 Correct 0 ms 348 KB Output is correct
36 Correct 1 ms 456 KB Output is correct
37 Correct 1 ms 344 KB Output is correct
38 Correct 1 ms 344 KB Output is correct
39 Correct 0 ms 348 KB Output is correct
40 Correct 1 ms 348 KB Output is correct
41 Correct 1 ms 344 KB Output is correct
42 Correct 1 ms 600 KB Output is correct
43 Correct 0 ms 352 KB Output is correct
44 Correct 0 ms 352 KB Output is correct
45 Correct 1 ms 356 KB Output is correct
46 Correct 5 ms 860 KB Output is correct
47 Correct 7 ms 864 KB Output is correct
48 Correct 5 ms 864 KB Output is correct
49 Correct 5 ms 868 KB Output is correct
50 Correct 7 ms 872 KB Output is correct
51 Correct 7 ms 864 KB Output is correct
52 Correct 7 ms 1120 KB Output is correct
53 Correct 5 ms 1112 KB Output is correct
54 Correct 5 ms 1128 KB Output is correct
55 Correct 4 ms 616 KB Output is correct
56 Correct 4 ms 864 KB Output is correct
57 Correct 4 ms 780 KB Output is correct
58 Correct 7 ms 1128 KB Output is correct
59 Correct 4 ms 1128 KB Output is correct
60 Correct 4 ms 984 KB Output is correct
61 Correct 3 ms 796 KB Output is correct
62 Correct 4 ms 768 KB Output is correct
63 Correct 3 ms 764 KB Output is correct
64 Correct 4 ms 752 KB Output is correct
65 Correct 3 ms 748 KB Output is correct
66 Correct 3 ms 764 KB Output is correct
67 Correct 4 ms 764 KB Output is correct
68 Correct 4 ms 756 KB Output is correct
69 Correct 4 ms 792 KB Output is correct
70 Correct 3 ms 772 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 0 ms 456 KB Output is correct
12 Correct 0 ms 368 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 0 ms 344 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 0 ms 348 KB Output is correct
23 Correct 1 ms 348 KB Output is correct
24 Correct 1 ms 344 KB Output is correct
25 Correct 1 ms 348 KB Output is correct
26 Correct 0 ms 344 KB Output is correct
27 Correct 1 ms 348 KB Output is correct
28 Correct 0 ms 344 KB Output is correct
29 Correct 1 ms 348 KB Output is correct
30 Correct 1 ms 348 KB Output is correct
31 Correct 1 ms 348 KB Output is correct
32 Correct 1 ms 348 KB Output is correct
33 Correct 1 ms 600 KB Output is correct
34 Correct 0 ms 348 KB Output is correct
35 Correct 0 ms 348 KB Output is correct
36 Correct 1 ms 456 KB Output is correct
37 Correct 1 ms 344 KB Output is correct
38 Correct 1 ms 344 KB Output is correct
39 Correct 0 ms 348 KB Output is correct
40 Correct 1 ms 348 KB Output is correct
41 Correct 1 ms 344 KB Output is correct
42 Correct 1 ms 600 KB Output is correct
43 Correct 0 ms 352 KB Output is correct
44 Correct 0 ms 352 KB Output is correct
45 Correct 1 ms 356 KB Output is correct
46 Correct 5 ms 860 KB Output is correct
47 Correct 7 ms 864 KB Output is correct
48 Correct 5 ms 864 KB Output is correct
49 Correct 5 ms 868 KB Output is correct
50 Correct 7 ms 872 KB Output is correct
51 Correct 7 ms 864 KB Output is correct
52 Correct 7 ms 1120 KB Output is correct
53 Correct 5 ms 1112 KB Output is correct
54 Correct 5 ms 1128 KB Output is correct
55 Correct 4 ms 616 KB Output is correct
56 Correct 4 ms 864 KB Output is correct
57 Correct 4 ms 780 KB Output is correct
58 Correct 7 ms 1128 KB Output is correct
59 Correct 4 ms 1128 KB Output is correct
60 Correct 4 ms 984 KB Output is correct
61 Correct 3 ms 796 KB Output is correct
62 Correct 4 ms 768 KB Output is correct
63 Correct 3 ms 764 KB Output is correct
64 Correct 4 ms 752 KB Output is correct
65 Correct 3 ms 748 KB Output is correct
66 Correct 3 ms 764 KB Output is correct
67 Correct 4 ms 764 KB Output is correct
68 Correct 4 ms 756 KB Output is correct
69 Correct 4 ms 792 KB Output is correct
70 Correct 3 ms 772 KB Output is correct
71 Correct 728 ms 54608 KB Output is correct
72 Correct 744 ms 58380 KB Output is correct
73 Correct 840 ms 60556 KB Output is correct
74 Correct 918 ms 62412 KB Output is correct
75 Correct 931 ms 62620 KB Output is correct
76 Correct 991 ms 62828 KB Output is correct
77 Correct 1010 ms 71292 KB Output is correct
78 Correct 1085 ms 73384 KB Output is correct
79 Correct 1169 ms 77984 KB Output is correct
80 Correct 540 ms 41164 KB Output is correct
81 Correct 580 ms 41928 KB Output is correct
82 Correct 603 ms 42876 KB Output is correct
83 Correct 1129 ms 76144 KB Output is correct
84 Correct 630 ms 72820 KB Output is correct
85 Correct 567 ms 65116 KB Output is correct
86 Correct 456 ms 36008 KB Output is correct
87 Correct 420 ms 36092 KB Output is correct
88 Correct 426 ms 36776 KB Output is correct
89 Correct 423 ms 36592 KB Output is correct
90 Correct 422 ms 36484 KB Output is correct
91 Correct 425 ms 36752 KB Output is correct
92 Correct 419 ms 36660 KB Output is correct
93 Correct 423 ms 36904 KB Output is correct
94 Correct 422 ms 36920 KB Output is correct
95 Correct 425 ms 35364 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 0 ms 456 KB Output is correct
12 Correct 0 ms 368 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 0 ms 344 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 0 ms 348 KB Output is correct
23 Correct 1 ms 348 KB Output is correct
24 Correct 1 ms 344 KB Output is correct
25 Correct 1 ms 348 KB Output is correct
26 Correct 0 ms 344 KB Output is correct
27 Correct 1 ms 348 KB Output is correct
28 Correct 0 ms 344 KB Output is correct
29 Correct 1 ms 348 KB Output is correct
30 Correct 1 ms 348 KB Output is correct
31 Correct 1 ms 348 KB Output is correct
32 Correct 1 ms 348 KB Output is correct
33 Correct 1 ms 600 KB Output is correct
34 Correct 0 ms 348 KB Output is correct
35 Correct 0 ms 348 KB Output is correct
36 Correct 1 ms 456 KB Output is correct
37 Correct 1 ms 344 KB Output is correct
38 Correct 1 ms 344 KB Output is correct
39 Correct 0 ms 348 KB Output is correct
40 Correct 1 ms 348 KB Output is correct
41 Correct 1 ms 344 KB Output is correct
42 Correct 1 ms 600 KB Output is correct
43 Correct 0 ms 352 KB Output is correct
44 Correct 0 ms 352 KB Output is correct
45 Correct 1 ms 356 KB Output is correct
46 Correct 5 ms 860 KB Output is correct
47 Correct 7 ms 864 KB Output is correct
48 Correct 5 ms 864 KB Output is correct
49 Correct 5 ms 868 KB Output is correct
50 Correct 7 ms 872 KB Output is correct
51 Correct 7 ms 864 KB Output is correct
52 Correct 7 ms 1120 KB Output is correct
53 Correct 5 ms 1112 KB Output is correct
54 Correct 5 ms 1128 KB Output is correct
55 Correct 4 ms 616 KB Output is correct
56 Correct 4 ms 864 KB Output is correct
57 Correct 4 ms 780 KB Output is correct
58 Correct 7 ms 1128 KB Output is correct
59 Correct 4 ms 1128 KB Output is correct
60 Correct 4 ms 984 KB Output is correct
61 Correct 3 ms 796 KB Output is correct
62 Correct 4 ms 768 KB Output is correct
63 Correct 3 ms 764 KB Output is correct
64 Correct 4 ms 752 KB Output is correct
65 Correct 3 ms 748 KB Output is correct
66 Correct 3 ms 764 KB Output is correct
67 Correct 4 ms 764 KB Output is correct
68 Correct 4 ms 756 KB Output is correct
69 Correct 4 ms 792 KB Output is correct
70 Correct 3 ms 772 KB Output is correct
71 Correct 728 ms 54608 KB Output is correct
72 Correct 744 ms 58380 KB Output is correct
73 Correct 840 ms 60556 KB Output is correct
74 Correct 918 ms 62412 KB Output is correct
75 Correct 931 ms 62620 KB Output is correct
76 Correct 991 ms 62828 KB Output is correct
77 Correct 1010 ms 71292 KB Output is correct
78 Correct 1085 ms 73384 KB Output is correct
79 Correct 1169 ms 77984 KB Output is correct
80 Correct 540 ms 41164 KB Output is correct
81 Correct 580 ms 41928 KB Output is correct
82 Correct 603 ms 42876 KB Output is correct
83 Correct 1129 ms 76144 KB Output is correct
84 Correct 630 ms 72820 KB Output is correct
85 Correct 567 ms 65116 KB Output is correct
86 Correct 456 ms 36008 KB Output is correct
87 Correct 420 ms 36092 KB Output is correct
88 Correct 426 ms 36776 KB Output is correct
89 Correct 423 ms 36592 KB Output is correct
90 Correct 422 ms 36484 KB Output is correct
91 Correct 425 ms 36752 KB Output is correct
92 Correct 419 ms 36660 KB Output is correct
93 Correct 423 ms 36904 KB Output is correct
94 Correct 422 ms 36920 KB Output is correct
95 Correct 425 ms 35364 KB Output is correct
96 Correct 1160 ms 70844 KB Output is correct
97 Correct 1189 ms 72252 KB Output is correct
98 Correct 1268 ms 74668 KB Output is correct
99 Correct 1329 ms 77852 KB Output is correct
100 Correct 1378 ms 80104 KB Output is correct
101 Correct 1443 ms 79556 KB Output is correct
102 Correct 1888 ms 93336 KB Output is correct
103 Correct 2066 ms 97376 KB Output is correct
104 Correct 2076 ms 100292 KB Output is correct
105 Correct 905 ms 63608 KB Output is correct
106 Correct 1027 ms 60860 KB Output is correct
107 Correct 1120 ms 63652 KB Output is correct
108 Correct 1742 ms 93888 KB Output is correct
109 Correct 1650 ms 90648 KB Output is correct
110 Correct 1574 ms 87464 KB Output is correct
111 Correct 725 ms 61756 KB Output is correct
112 Correct 735 ms 53748 KB Output is correct
113 Correct 717 ms 53984 KB Output is correct
114 Correct 693 ms 53828 KB Output is correct
115 Correct 733 ms 52724 KB Output is correct
116 Correct 735 ms 52756 KB Output is correct
117 Correct 789 ms 53404 KB Output is correct
118 Correct 727 ms 51796 KB Output is correct
119 Correct 704 ms 54096 KB Output is correct
120 Correct 978 ms 61240 KB Output is correct