Submission #491597

# Submission time Handle Problem Language Result Execution time Memory
491597 2021-12-03T12:32:52 Z leaked New Home (APIO18_new_home) C++14
100 / 100
4053 ms 391988 KB
#include <bits/stdc++.h>

#define f first
#define s second
#define sz(x) (int)(x).size()
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define vec vector
#define pw(x) (1LL<<(x))
#define m_p make_pair
#define fast_iati ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

using namespace std;

template <class T> bool umin(T &a,const T &b){return (a>b?a=b,1:0);}
template <class T> bool umax(T &a,const T &b){return (a<b?a=b,1:0);}
typedef long long ll;
typedef pair<int,int> pii;

//const int lg=log2(300'000)+1;
const int N=3e6;
bool del[2*N];
struct segtree{
    int mx[4*N];
    vec<pii> wyfu;
    segtree(){
        fill(mx,mx+4*N,-1e9);
    }
    void init(){
        sort(all(wyfu));
        wyfu.erase(unique(all(wyfu)),wyfu.end());
    }
    int gi(pii x){
        return upper_bound(all(wyfu),x)-wyfu.begin()-1;
    }
    void upd(int i,int x,int v,int tl,int tr){
        if(tl==tr){
            mx[v]=x;
            return;
        }
        int tm=(tl+tr)>>1;
        if(tm>=i)
            upd(i,x,2*v,tl,tm);
        else
            upd(i,x,2*v+1,tm+1,tr);
        mx[v]=max(mx[2*v],mx[2*v+1]);
    }
    int get(int l,int r,int v,int tl,int tr){
        if(l>r)
            return -1e9;
        if(tl>=l&&tr<=r)
            return mx[v];
        if(tl>r||tr<l)
            return -1e9;
        int tm=(tl+tr)>>1;
        return max(get(l,r,2*v,tl,tm),get(l,r,2*v+1,tm+1,tr));
    }
    void _debug(int v,int tl,int tr){
        cout<<"SLOY "<<v<<' '<<tl<<' '<<tr<<' '<<mx[v]<<endl;
        if(tl==tr)
            return ;
        int tm=(tl+tr)>>1;
        _debug(2*v,tl,tm);
        _debug(2*v+1,tm+1,tr);
    }
}lft,rgt;
vec<int> kek;
vec<pii> wyfu;
//map<pii,int>mp;
int tmr;
vec<pii> toadd[N];
vec<pii> todel[N];
void add(int l,int r,int t,int tp,int w=0){
    if(l==r) return;
    int mid=(l+r)>>1;
//    cout<<"CHINGY "<<l<<' '<<r<<' '<<t<<endl;
    if(!t){
//        del[mp[{l,tp}]]=1;
        if(!w)
            return ;
        ///r>=x
        lft.upd(lft.gi({mid,tp}),-1e9,1,0,sz(lft.wyfu));
//        cout<<"DEL LFT "<<mid<<' '<<-1e9<<' '<<tp<<endl;
        ///l<=x
        rgt.upd(rgt.gi({mid+1,tp}),-1e9,1,0,sz(rgt.wyfu));
//        cout<<"DEL RGT "<<mid+1<<' '<<-1e9<<' '<<tp<<endl;
        return;
    }
    if(!w)
        rgt.wyfu.pb({mid+1,tp}),lft.wyfu.pb({mid,tp});
//    mp[{l,tp}]=tmr;
    if(w){
        ///r>=x
        lft.upd(lft.gi({mid,tp}),-l,1,0,sz(lft.wyfu));
//        cout<<"ADD LFT "<<-l<<" "<<mid<<' '<<tp<<endl;
        ///l<=x
        rgt.upd(rgt.gi({mid+1,tp}),r,1,0,sz(rgt.wyfu));
//        cout<<"ADD RGT "<<r<<' '<<mid+1<<' '<<tp<<endl;
    }
//    ++tmr;
}
const int Nax=3e5+1;
multiset<int> st[Nax];
vec<int>here[Nax];
signed main(){
    fast_iati;
    int n,q,k;
    cin>>n>>k>>q;
    vec<array<int,3>>arr;
    vec<int>x(n),a(n),b(n),t(n);
    for(int i=0;i<n;i++){
        cin>>x[i]>>t[i]>>a[i]>>b[i];
//        x[i]=rand(),t[i]=rand()%k+1;
//        a[i]=rand(),b[i]=rand();
//        if(a[i]>b[i])
//            swap(a[i],b[i]);
        arr.push_back({a[i],0,i});
        arr.push_back({b[i]+1,-1,i});
        --t[i];
        here[t[i]].pb(i);
    }
    vec<int>l(q),y(q);
    for(int i=0;i<q;i++){
        cin>>l[i]>>y[i];
//        l[i]=rand(),y[i]=rand();
        arr.push_back({y[i],2,i});
    }
    sort(all(arr));
    auto stupid=[&](array<int,3> z){
        pii me={-1e9,0};
        int tx=l[z[1]];
        for(int j=0;j<k;j++){
            if(sz(st[j])==2) continue;
            auto it=st[j].lower_bound(tx);
            int omn=2e9;
            if(it!=st[j].end()) umin(omn,*it-tx);
            if(it!=st[j].begin()) umin(omn,tx-*prev(it));
//            cout<<"COLOUR "<<j<<' '<<omn<<' '<<tx<<endl;
            umax(me.f,omn);me.s++;
        }
        return me;
    };
    vec<int>cnt(k,0);
    for(int i=0;i<k;i++){
        add(-3e8,3e8,1,i);
        st[i].insert(-3e8);st[i].insert(3e8);
    }
    int total=0;
    vec<bool>bad(q,0);
    int j=0;
    for(auto &z : arr){
        swap(z[1],z[2]);
        if(z[2]==2){
            bad[z[1]]=(total==k?0:1);
            continue;
        }
//        cout<<"AUE "<<endl;
        if(z[2]==-1){
            int i=z[1];
            auto it=st[t[i]].lower_bound(x[i]);

            todel[j].pb({x[i],*next(it)});
            todel[j].pb({*prev(it),x[i]});
            toadd[j].pb({*prev(it),*next(it)});

            add(x[i],*next(it),0,t[i]);
            add(*prev(it),x[i],0,t[i]);
            add(*prev(it),*next(it),1,t[i]);
            st[t[i]].erase(it);
            cnt[t[i]]--;
            if(!cnt[t[i]])
                total--;
        }
        else{
            int i=z[1];
            if(!cnt[t[i]])
                total++;
            cnt[t[i]]++;
            st[t[i]].insert(x[i]);
            auto it=st[t[i]].lower_bound(x[i]);
            add(*prev(it),*next(it),0,t[i]);
            add(x[i],*next(it),1,t[i]);
            add(*prev(it),x[i],1,t[i]);

            toadd[j].pb({x[i],*next(it)});
            toadd[j].pb({*prev(it),x[i]});
            todel[j].pb({*prev(it),*next(it)});
        }
        j++;
//        cout<<z[0]<<' '<<total<<endl;
    }
//    cout<<endl;
    j=0;
    ///building
    lft.init();
    rgt.init();
    vec<int> ansq(q,-1);
//    assert(total==0);
    for(auto &z : arr){
        if(z[2]==2){
            int i=z[1];
            if(bad[i])
                continue;
            int what=0;
            ///r>=x
            umax(what,l[i]+lft.get(lft.gi(m_p(l[i],-2e9))+1,sz(lft.wyfu),1,0,sz(lft.wyfu)));
//            cout<<"AFTER L "<<what<<' '<<lft.gi(m_p(l[i],-2e9))+1<<endl;
            ///x>=l
            umax(what,-l[i]+rgt.get(0,rgt.gi(m_p(l[i],2e9)),1,0,sz(rgt.wyfu)));
//            cout<<"AFTER R "<<what<<endl;
            ansq[i]=what;
            continue;
        }
        int i=z[1];
        for(auto &z : todel[j])
            add(z.f,z.s,0,t[i],1);
        for(auto &z : toadd[j])
            add(z.f,z.s,1,t[i],1);
        j++;
//        cout<<"DEBUG "<<endl;
//        lft._debug(1,0,sz(lft.wyfu));
//        cout<<z[0]<<' '<<total<<endl;
    }
    for(auto &z : ansq)
        cout<<z<<'\n';
    return 0;
}
/*

4 2 4
3 1 1 10
9 2 2 4
7 2 5 7
4 1 8 10
5 3
5 6
5 9
1 10


2 1 3
1 1 1 4
1 1 2 6
1 3
1 5
1 7

1 1 1
100000000 1 1 1
1 1
*/

Compilation message

new_home.cpp: In function 'int main()':
new_home.cpp:130:10: warning: variable 'stupid' set but not used [-Wunused-but-set-variable]
  130 |     auto stupid=[&](array<int,3> z){
      |          ^~~~~~
# Verdict Execution time Memory Grader output
1 Correct 124 ms 256192 KB Output is correct
2 Correct 117 ms 256272 KB Output is correct
3 Correct 124 ms 256252 KB Output is correct
4 Correct 121 ms 256264 KB Output is correct
5 Correct 117 ms 256272 KB Output is correct
6 Correct 117 ms 256392 KB Output is correct
7 Correct 121 ms 256440 KB Output is correct
8 Correct 119 ms 256332 KB Output is correct
9 Correct 117 ms 256380 KB Output is correct
10 Correct 117 ms 256336 KB Output is correct
11 Correct 145 ms 256452 KB Output is correct
12 Correct 120 ms 256316 KB Output is correct
13 Correct 118 ms 256392 KB Output is correct
14 Correct 118 ms 256292 KB Output is correct
15 Correct 128 ms 256412 KB Output is correct
16 Correct 121 ms 256424 KB Output is correct
17 Correct 124 ms 256324 KB Output is correct
18 Correct 119 ms 256328 KB Output is correct
19 Correct 117 ms 256452 KB Output is correct
20 Correct 122 ms 256316 KB Output is correct
21 Correct 115 ms 256336 KB Output is correct
22 Correct 120 ms 256520 KB Output is correct
23 Correct 120 ms 256324 KB Output is correct
24 Correct 116 ms 256364 KB Output is correct
25 Correct 116 ms 256288 KB Output is correct
26 Correct 126 ms 256324 KB Output is correct
27 Correct 117 ms 256308 KB Output is correct
28 Correct 114 ms 256344 KB Output is correct
29 Correct 117 ms 256364 KB Output is correct
30 Correct 119 ms 256276 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 124 ms 256192 KB Output is correct
2 Correct 117 ms 256272 KB Output is correct
3 Correct 124 ms 256252 KB Output is correct
4 Correct 121 ms 256264 KB Output is correct
5 Correct 117 ms 256272 KB Output is correct
6 Correct 117 ms 256392 KB Output is correct
7 Correct 121 ms 256440 KB Output is correct
8 Correct 119 ms 256332 KB Output is correct
9 Correct 117 ms 256380 KB Output is correct
10 Correct 117 ms 256336 KB Output is correct
11 Correct 145 ms 256452 KB Output is correct
12 Correct 120 ms 256316 KB Output is correct
13 Correct 118 ms 256392 KB Output is correct
14 Correct 118 ms 256292 KB Output is correct
15 Correct 128 ms 256412 KB Output is correct
16 Correct 121 ms 256424 KB Output is correct
17 Correct 124 ms 256324 KB Output is correct
18 Correct 119 ms 256328 KB Output is correct
19 Correct 117 ms 256452 KB Output is correct
20 Correct 122 ms 256316 KB Output is correct
21 Correct 115 ms 256336 KB Output is correct
22 Correct 120 ms 256520 KB Output is correct
23 Correct 120 ms 256324 KB Output is correct
24 Correct 116 ms 256364 KB Output is correct
25 Correct 116 ms 256288 KB Output is correct
26 Correct 126 ms 256324 KB Output is correct
27 Correct 117 ms 256308 KB Output is correct
28 Correct 114 ms 256344 KB Output is correct
29 Correct 117 ms 256364 KB Output is correct
30 Correct 119 ms 256276 KB Output is correct
31 Correct 546 ms 272836 KB Output is correct
32 Correct 303 ms 270576 KB Output is correct
33 Correct 512 ms 271620 KB Output is correct
34 Correct 557 ms 272016 KB Output is correct
35 Correct 571 ms 272608 KB Output is correct
36 Correct 535 ms 272636 KB Output is correct
37 Correct 437 ms 271592 KB Output is correct
38 Correct 445 ms 271260 KB Output is correct
39 Correct 401 ms 271108 KB Output is correct
40 Correct 417 ms 271128 KB Output is correct
41 Correct 535 ms 271280 KB Output is correct
42 Correct 499 ms 271112 KB Output is correct
43 Correct 256 ms 271352 KB Output is correct
44 Correct 532 ms 271396 KB Output is correct
45 Correct 484 ms 271276 KB Output is correct
46 Correct 497 ms 271320 KB Output is correct
47 Correct 330 ms 270580 KB Output is correct
48 Correct 343 ms 270444 KB Output is correct
49 Correct 360 ms 270652 KB Output is correct
50 Correct 395 ms 271196 KB Output is correct
51 Correct 393 ms 270648 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3647 ms 343656 KB Output is correct
2 Correct 3137 ms 334616 KB Output is correct
3 Correct 3398 ms 391772 KB Output is correct
4 Correct 3404 ms 362816 KB Output is correct
5 Correct 2938 ms 346372 KB Output is correct
6 Correct 3154 ms 346660 KB Output is correct
7 Correct 2506 ms 391672 KB Output is correct
8 Correct 2843 ms 362496 KB Output is correct
9 Correct 3084 ms 353224 KB Output is correct
10 Correct 3111 ms 348504 KB Output is correct
11 Correct 1637 ms 345564 KB Output is correct
12 Correct 1892 ms 347668 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4053 ms 337664 KB Output is correct
2 Correct 1193 ms 337496 KB Output is correct
3 Correct 3686 ms 346596 KB Output is correct
4 Correct 3744 ms 389396 KB Output is correct
5 Correct 3226 ms 355104 KB Output is correct
6 Correct 3368 ms 360492 KB Output is correct
7 Correct 3234 ms 346004 KB Output is correct
8 Correct 3389 ms 346556 KB Output is correct
9 Correct 2987 ms 390732 KB Output is correct
10 Correct 3193 ms 358320 KB Output is correct
11 Correct 3415 ms 350684 KB Output is correct
12 Correct 3391 ms 347868 KB Output is correct
13 Correct 1472 ms 343856 KB Output is correct
14 Correct 1459 ms 342640 KB Output is correct
15 Correct 1687 ms 345072 KB Output is correct
16 Correct 1895 ms 347224 KB Output is correct
17 Correct 1811 ms 344524 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 124 ms 256192 KB Output is correct
2 Correct 117 ms 256272 KB Output is correct
3 Correct 124 ms 256252 KB Output is correct
4 Correct 121 ms 256264 KB Output is correct
5 Correct 117 ms 256272 KB Output is correct
6 Correct 117 ms 256392 KB Output is correct
7 Correct 121 ms 256440 KB Output is correct
8 Correct 119 ms 256332 KB Output is correct
9 Correct 117 ms 256380 KB Output is correct
10 Correct 117 ms 256336 KB Output is correct
11 Correct 145 ms 256452 KB Output is correct
12 Correct 120 ms 256316 KB Output is correct
13 Correct 118 ms 256392 KB Output is correct
14 Correct 118 ms 256292 KB Output is correct
15 Correct 128 ms 256412 KB Output is correct
16 Correct 121 ms 256424 KB Output is correct
17 Correct 124 ms 256324 KB Output is correct
18 Correct 119 ms 256328 KB Output is correct
19 Correct 117 ms 256452 KB Output is correct
20 Correct 122 ms 256316 KB Output is correct
21 Correct 115 ms 256336 KB Output is correct
22 Correct 120 ms 256520 KB Output is correct
23 Correct 120 ms 256324 KB Output is correct
24 Correct 116 ms 256364 KB Output is correct
25 Correct 116 ms 256288 KB Output is correct
26 Correct 126 ms 256324 KB Output is correct
27 Correct 117 ms 256308 KB Output is correct
28 Correct 114 ms 256344 KB Output is correct
29 Correct 117 ms 256364 KB Output is correct
30 Correct 119 ms 256276 KB Output is correct
31 Correct 546 ms 272836 KB Output is correct
32 Correct 303 ms 270576 KB Output is correct
33 Correct 512 ms 271620 KB Output is correct
34 Correct 557 ms 272016 KB Output is correct
35 Correct 571 ms 272608 KB Output is correct
36 Correct 535 ms 272636 KB Output is correct
37 Correct 437 ms 271592 KB Output is correct
38 Correct 445 ms 271260 KB Output is correct
39 Correct 401 ms 271108 KB Output is correct
40 Correct 417 ms 271128 KB Output is correct
41 Correct 535 ms 271280 KB Output is correct
42 Correct 499 ms 271112 KB Output is correct
43 Correct 256 ms 271352 KB Output is correct
44 Correct 532 ms 271396 KB Output is correct
45 Correct 484 ms 271276 KB Output is correct
46 Correct 497 ms 271320 KB Output is correct
47 Correct 330 ms 270580 KB Output is correct
48 Correct 343 ms 270444 KB Output is correct
49 Correct 360 ms 270652 KB Output is correct
50 Correct 395 ms 271196 KB Output is correct
51 Correct 393 ms 270648 KB Output is correct
52 Correct 573 ms 281328 KB Output is correct
53 Correct 588 ms 280700 KB Output is correct
54 Correct 532 ms 275688 KB Output is correct
55 Correct 535 ms 275516 KB Output is correct
56 Correct 510 ms 277108 KB Output is correct
57 Correct 544 ms 273192 KB Output is correct
58 Correct 545 ms 275440 KB Output is correct
59 Correct 514 ms 276828 KB Output is correct
60 Correct 523 ms 273180 KB Output is correct
61 Correct 334 ms 281716 KB Output is correct
62 Correct 570 ms 281432 KB Output is correct
63 Correct 543 ms 277112 KB Output is correct
64 Correct 542 ms 275452 KB Output is correct
65 Correct 554 ms 273264 KB Output is correct
66 Correct 549 ms 272488 KB Output is correct
67 Correct 479 ms 273132 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 124 ms 256192 KB Output is correct
2 Correct 117 ms 256272 KB Output is correct
3 Correct 124 ms 256252 KB Output is correct
4 Correct 121 ms 256264 KB Output is correct
5 Correct 117 ms 256272 KB Output is correct
6 Correct 117 ms 256392 KB Output is correct
7 Correct 121 ms 256440 KB Output is correct
8 Correct 119 ms 256332 KB Output is correct
9 Correct 117 ms 256380 KB Output is correct
10 Correct 117 ms 256336 KB Output is correct
11 Correct 145 ms 256452 KB Output is correct
12 Correct 120 ms 256316 KB Output is correct
13 Correct 118 ms 256392 KB Output is correct
14 Correct 118 ms 256292 KB Output is correct
15 Correct 128 ms 256412 KB Output is correct
16 Correct 121 ms 256424 KB Output is correct
17 Correct 124 ms 256324 KB Output is correct
18 Correct 119 ms 256328 KB Output is correct
19 Correct 117 ms 256452 KB Output is correct
20 Correct 122 ms 256316 KB Output is correct
21 Correct 115 ms 256336 KB Output is correct
22 Correct 120 ms 256520 KB Output is correct
23 Correct 120 ms 256324 KB Output is correct
24 Correct 116 ms 256364 KB Output is correct
25 Correct 116 ms 256288 KB Output is correct
26 Correct 126 ms 256324 KB Output is correct
27 Correct 117 ms 256308 KB Output is correct
28 Correct 114 ms 256344 KB Output is correct
29 Correct 117 ms 256364 KB Output is correct
30 Correct 119 ms 256276 KB Output is correct
31 Correct 546 ms 272836 KB Output is correct
32 Correct 303 ms 270576 KB Output is correct
33 Correct 512 ms 271620 KB Output is correct
34 Correct 557 ms 272016 KB Output is correct
35 Correct 571 ms 272608 KB Output is correct
36 Correct 535 ms 272636 KB Output is correct
37 Correct 437 ms 271592 KB Output is correct
38 Correct 445 ms 271260 KB Output is correct
39 Correct 401 ms 271108 KB Output is correct
40 Correct 417 ms 271128 KB Output is correct
41 Correct 535 ms 271280 KB Output is correct
42 Correct 499 ms 271112 KB Output is correct
43 Correct 256 ms 271352 KB Output is correct
44 Correct 532 ms 271396 KB Output is correct
45 Correct 484 ms 271276 KB Output is correct
46 Correct 497 ms 271320 KB Output is correct
47 Correct 330 ms 270580 KB Output is correct
48 Correct 343 ms 270444 KB Output is correct
49 Correct 360 ms 270652 KB Output is correct
50 Correct 395 ms 271196 KB Output is correct
51 Correct 393 ms 270648 KB Output is correct
52 Correct 3647 ms 343656 KB Output is correct
53 Correct 3137 ms 334616 KB Output is correct
54 Correct 3398 ms 391772 KB Output is correct
55 Correct 3404 ms 362816 KB Output is correct
56 Correct 2938 ms 346372 KB Output is correct
57 Correct 3154 ms 346660 KB Output is correct
58 Correct 2506 ms 391672 KB Output is correct
59 Correct 2843 ms 362496 KB Output is correct
60 Correct 3084 ms 353224 KB Output is correct
61 Correct 3111 ms 348504 KB Output is correct
62 Correct 1637 ms 345564 KB Output is correct
63 Correct 1892 ms 347668 KB Output is correct
64 Correct 4053 ms 337664 KB Output is correct
65 Correct 1193 ms 337496 KB Output is correct
66 Correct 3686 ms 346596 KB Output is correct
67 Correct 3744 ms 389396 KB Output is correct
68 Correct 3226 ms 355104 KB Output is correct
69 Correct 3368 ms 360492 KB Output is correct
70 Correct 3234 ms 346004 KB Output is correct
71 Correct 3389 ms 346556 KB Output is correct
72 Correct 2987 ms 390732 KB Output is correct
73 Correct 3193 ms 358320 KB Output is correct
74 Correct 3415 ms 350684 KB Output is correct
75 Correct 3391 ms 347868 KB Output is correct
76 Correct 1472 ms 343856 KB Output is correct
77 Correct 1459 ms 342640 KB Output is correct
78 Correct 1687 ms 345072 KB Output is correct
79 Correct 1895 ms 347224 KB Output is correct
80 Correct 1811 ms 344524 KB Output is correct
81 Correct 573 ms 281328 KB Output is correct
82 Correct 588 ms 280700 KB Output is correct
83 Correct 532 ms 275688 KB Output is correct
84 Correct 535 ms 275516 KB Output is correct
85 Correct 510 ms 277108 KB Output is correct
86 Correct 544 ms 273192 KB Output is correct
87 Correct 545 ms 275440 KB Output is correct
88 Correct 514 ms 276828 KB Output is correct
89 Correct 523 ms 273180 KB Output is correct
90 Correct 334 ms 281716 KB Output is correct
91 Correct 570 ms 281432 KB Output is correct
92 Correct 543 ms 277112 KB Output is correct
93 Correct 542 ms 275452 KB Output is correct
94 Correct 554 ms 273264 KB Output is correct
95 Correct 549 ms 272488 KB Output is correct
96 Correct 479 ms 273132 KB Output is correct
97 Correct 3604 ms 391684 KB Output is correct
98 Correct 1068 ms 336872 KB Output is correct
99 Correct 3465 ms 345904 KB Output is correct
100 Correct 3554 ms 388624 KB Output is correct
101 Correct 3329 ms 362720 KB Output is correct
102 Correct 3462 ms 348868 KB Output is correct
103 Correct 2241 ms 345772 KB Output is correct
104 Correct 2389 ms 345276 KB Output is correct
105 Correct 1795 ms 344668 KB Output is correct
106 Correct 1775 ms 344932 KB Output is correct
107 Correct 3390 ms 361860 KB Output is correct
108 Correct 3230 ms 373896 KB Output is correct
109 Correct 3390 ms 351864 KB Output is correct
110 Correct 3297 ms 361592 KB Output is correct
111 Correct 3356 ms 374344 KB Output is correct
112 Correct 3272 ms 350704 KB Output is correct
113 Correct 1224 ms 390136 KB Output is correct
114 Correct 3545 ms 391988 KB Output is correct
115 Correct 3502 ms 375000 KB Output is correct
116 Correct 3566 ms 361660 KB Output is correct
117 Correct 3561 ms 351412 KB Output is correct
118 Correct 3532 ms 346764 KB Output is correct
119 Correct 2453 ms 342376 KB Output is correct
120 Correct 1175 ms 337084 KB Output is correct
121 Correct 1375 ms 341064 KB Output is correct
122 Correct 1382 ms 340288 KB Output is correct
123 Correct 1581 ms 342376 KB Output is correct
124 Correct 1703 ms 344320 KB Output is correct
125 Correct 1768 ms 342860 KB Output is correct
126 Correct 1691 ms 345624 KB Output is correct