답안 #294989

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
294989 2020-09-09T11:40:46 Z CaroLinda 새 집 (APIO18_new_home) C++14
47 / 100
5000 ms 732612 KB
#include <bits/stdc++.h>

#define lp(i,a,b) for(int i = a; i < b; i++)
#define pb push_back
#define sz(x) (int)(x.size())
#define all(x) x.begin(),x.end()
#define debug //printf
#define tiii tuple<int,int,int>
#define mkt make_tuple
#define pii pair<int,int>
#define mk make_pair
#define ll long long
#define ff first
#define ss second

const int MAXN = 6e5+100 ;
const int MAXT = 1e8+10 ;
const int MAX_COORD = 3e8+7 ;

using namespace std ;

struct Event
{
    int xConta, xIntercept, type , t1, t2 ;
    Event(int a=0, int b=0, int c=0, int d=0, int e=0) : xConta(a), xIntercept(b), type(c) , t1(d), t2(e){}

};

int ansQuery[MAXN] ;

struct Seg
{

    vector<Event> tree[MAXN*2] ;

    int m(int l, int r) { return (l+r)>>1 ; }

    void insertEvent(int pos, int l, int r, int t1, int t2,  Event e)
    {

        if( l > t2 || r < t1 ) return ;
        if( e.type > 0 ) tree[pos].push_back(e) ;
        if( l >= t1 && r <= t2 ) return (void)( tree[pos].push_back(e) );

        int lef = pos+1 ;
        int rig = pos+2*( m(l,r) - l + 1 );

        insertEvent( lef, l, m(l,r) , t1, t2 , e ) ;
        insertEvent(rig, m(l,r)+1, r, t1, t2 , e) ;

    }

    void solve(int pos, int l, int r , int forbiddenType )
    {

        int mxNegative = -MAXT , mnPositive = MAXT ;

        for(auto e : tree[pos])
        {
            if( e.type == forbiddenType ) continue ;
            if( e.type > 0 )
            {
                ansQuery[ e.type ] = max( ansQuery[e.type] , (forbiddenType == 0) ? mxNegative - e.xConta : e.xConta-mnPositive ) ;
                debug("mxNegative eh %d\n" , mxNegative) ;
            }
            else
            {
                if(forbiddenType == 0) mxNegative = max(mxNegative, e.xIntercept ) ;
                else mnPositive = min(mnPositive, e.xIntercept ) ;
            }
        }

        debug("No intervalo %d %d:\n" , l, r ) ;
        for(auto e : tree[pos]) debug("Coord %d %d e tipo %d\n" , e.xConta, e.xIntercept, e.type ) ;

        if(l == r) return ;

        solve(pos+1, l , m(l,r), forbiddenType  ) ;
        solve( pos + 2*( m(l,r) - l + 1 ) , m(l,r)+1, r , forbiddenType ) ;

    }

} seg ;

//O ANO PODE IR ATÉ 10^8
//VAI TER QUE FAZER COMPRESSÃO

int N , K , Q ;
vector< tiii > myVecOfTuples ;
set<int> store[MAXN] ;
map< pii , int > segments[MAXN] ;
vector<Event> sweep ;
map<int,int> compressionTime ;
map<int, vector<pii> > mySet[MAXN] ;

void operation( set<int>::iterator itLess, set<int>::iterator itMore , int type , int clock , bool isRemoval )
{
    int midPointL = (*itMore - *itLess)>>1 ;
    midPointL += *itLess ;

    int midPointR = midPointL ;

    if( (*itMore - (*itLess)) % 2 != 0 ) midPointR++;


    if(isRemoval)
    {
        Event a = Event( midPointL, *itLess, 0 , segments[type][ mk(midPointL,*itLess) ] , clock );
        Event b = Event( midPointR, *itMore, -1 , segments[type][ mk(midPointR, *itMore) ] , clock ) ;

        segments[type].erase( segments[type].find( mk(midPointL, *itLess) ) ) ;
        segments[type].erase( segments[type].find( mk(midPointR, *itMore) ) ) ;

        if(a.t1 <= a.t2)
            sweep.pb(a);
        if(b.t1 <= b.t2 )
            sweep.pb(b) ;
    }
    else
    {
        segments[ type ][ mk(midPointL, *itLess) ] = clock ;
        segments[type][ mk(midPointR, *itMore) ] = clock ;
    }

}

void insertion(int x_coord, int type, int clock )
{

    auto itMore = store[type].lower_bound(x_coord) ;
    auto itLess = itMore ; itLess-- ;

    operation( itLess, itMore, type, clock-1 , true) ;

    store[type].insert( x_coord ) ;

    itMore = store[type].find( x_coord ) ;
    itLess = itMore ; itLess-- ;

    operation( itLess, itMore, type, clock, false ) ;

    itLess = itMore ; itLess++ ;
    swap(itMore, itLess) ;

    operation( itLess, itMore, type, clock, false );

}

void removal(int x_coord, int type, int clock )
{

    auto itMore = store[type].find(x_coord) ;
    auto itLess = itMore ; itLess-- ;

    operation( itLess, itMore, type, clock, true ) ;

    itLess = itMore ; itLess++ ;
    swap(itMore, itLess) ;

    operation( itLess, itMore, type, clock, true ) ;

    store[type].erase(itLess);

    itMore = store[type].lower_bound(x_coord);
    itLess = itMore ; itLess--;

    operation( itLess, itMore, type, clock+1, false ) ;

}

int main()
{

    scanf("%d%d%d", &N , &K , &Q ) ;
    for(int i = 1 ; i <= K ; i++ )
    {

        store[i].insert( -MAX_COORD ) ;
        store[i].insert( MAX_COORD ) ;

        operation( store[i].begin() , prev( store[i].end() ) , i , 1, false ) ;

    }
    for(int i = 1 , x , t , a , b ; i <= N ; i++ )
    {
        scanf("%d%d%d%d", &x, &t, &a, &b ) ;
        mySet[t][x].push_back( mk(a,b) ) ;
    }

    for(int i = 1 ; i <= K ; i++ )
    {

        for(auto &aux: mySet[i] )
        {
            vector<pii> x_coord = aux.ss ;

            sort(all(x_coord)) ;
            x_coord.pb( mk( MAXT, MAXT ) ) ;

            int mnTime = x_coord[0].ff ;
            int mxTime = x_coord[0].ss ;

            for(int j = 1 ; j < sz(x_coord) ; j++ )
            {
                if( x_coord[j].ff > mxTime )
                {
                    myVecOfTuples.pb( mkt( mnTime , -i, aux.ff ) ) ;
                    myVecOfTuples.pb( mkt( mxTime, i, aux.ff ) ) ;

                    mnTime = x_coord[j].ff ;
                    mxTime = x_coord[j].ss ;
                }
                else mxTime = max(mxTime, x_coord[j].ss ) ;
            }

        }
    }

    sort(all(myVecOfTuples)) ;

    for(auto tup : myVecOfTuples )
    {

        int clock = get<0>(tup) ;
        int type = get<1>(tup) ;
        int x_coord = get<2>(tup) ;

        if( type < 0 ) insertion( x_coord , -type, clock ) ;
        else removal( x_coord, type, clock );

    }

    for(int i = 1 ; i <= K ; i++ )
        operation( store[i].begin() , prev( store[i].end() ) , i , MAXT, true ) ;

    for(int i = 1 , l , y ; i <= Q ; i++ )
    {
        scanf("%d%d", &l, &y ) ;
        sweep.pb( Event(l,l,i,y,y) );
    }

    sort(all(sweep), [&](Event a, Event b)
         {
             if( a.xConta != b.xConta ) return a.xConta < b.xConta ;
             else return a.type < b.type ;
         } );

    for(auto &e : sweep )
    {
        if( compressionTime.find( e.t1 ) == compressionTime.end() )
            compressionTime[e.t1] = 0 ;

        if( compressionTime.find( e.t2 ) == compressionTime.end() )
            compressionTime[e.t2] = 0 ;

    }
    int Key = 1 ;
    for(auto &e : compressionTime ) e.ss = Key++ ;

    for(auto e : sweep )
    {
        if(e.type == 0) continue ;
        seg.insertEvent( 1 , 1 , sz(compressionTime) , compressionTime[e.t1] , compressionTime[e.t2] , e ) ;
    }

    seg.solve(1,1, sz(compressionTime) , 0 ) ;

    sort(all(sweep), [&](Event a, Event b)
     {
         if( a.xConta != b.xConta ) return a.xConta > b.xConta ;
         else return a.type < b.type ;
     } );

    for(int i = 1 ; i < 2*MAXN ; i++ ) seg.tree[i].clear() ;

    for(auto e : sweep )
    {
        if(e.type == -1) continue ;
        seg.insertEvent( 1 , 1 , sz(compressionTime) , compressionTime[e.t1] , compressionTime[e.t2] , e ) ;
    }

    seg.solve(1,1, sz(compressionTime) , -1 ) ;

    debug("Debugging lines:\n") ;
    for(auto e : sweep )
    {
        debug("x: [%d,%d] and slope %d and time %d %d\n", e.xConta, e.xIntercept, e.type, compressionTime[e.t1] , compressionTime[e.t2] ) ;
    }

    for(int i = 1 ; i <= Q ; i++ ) printf("%d\n" , ansQuery[i] > 100000010 ? -1 : ansQuery[i] ) ;

}

/*

2 1 1
39682063 1 1 100000000
29000832 1 1 100000000
34341447 100000000

2 1 1
39682063 1 1 100000000
29000832 1 1 100000000
34341447 100000000

5 4 1
39682063 3 1 100000000
37986244 2 1 100000000
29273266 1 1 100000000
33173370 4 1 100000000
29000832 3 1 100000000
34341447 100000000



5 2 2
4 2 3 3
5 1 2 5
5 1 2 5
5 1 5 5
4 1 3 3
90 3
7 10

1 1 1
5 1 1 10
7 5

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

6 3 4
10 1 1 100000000
13 2 1 100000000
10 2 1 100000000
1 3 1 100000000
15 1 1 100000000
26 3 1 100000000
15 20
30 100000000
50 800
100000000 1

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

1 1 1
100000000 1 1 1 1
1 1


*/

Compilation message

new_home.cpp: In member function 'void Seg::solve(int, int, int, int)':
new_home.cpp:64:23: warning: left operand of comma operator has no effect [-Wunused-value]
   64 |                 debug("mxNegative eh %d\n" , mxNegative) ;
      |                       ^~~~~~~~~~~~~~~~~~~~
new_home.cpp:73:15: warning: left operand of comma operator has no effect [-Wunused-value]
   73 |         debug("No intervalo %d %d:\n" , l, r ) ;
      |               ^~~~~~~~~~~~~~~~~~~~~~~
new_home.cpp:73:44: warning: right operand of comma operator has no effect [-Wunused-value]
   73 |         debug("No intervalo %d %d:\n" , l, r ) ;
      |                                            ^
new_home.cpp:74:39: warning: left operand of comma operator has no effect [-Wunused-value]
   74 |         for(auto e : tree[pos]) debug("Coord %d %d e tipo %d\n" , e.xConta, e.xIntercept, e.type ) ;
      |                                       ^~~~~~~~~~~~~~~~~~~~~~~~~
new_home.cpp:74:69: warning: right operand of comma operator has no effect [-Wunused-value]
   74 |         for(auto e : tree[pos]) debug("Coord %d %d e tipo %d\n" , e.xConta, e.xIntercept, e.type ) ;
      |                                                                   ~~^~~~~~
new_home.cpp:74:79: warning: right operand of comma operator has no effect [-Wunused-value]
   74 |         for(auto e : tree[pos]) debug("Coord %d %d e tipo %d\n" , e.xConta, e.xIntercept, e.type ) ;
      |                                                                             ~~^~~~~~~~~~
new_home.cpp: In function 'int main()':
new_home.cpp:284:11: warning: statement has no effect [-Wunused-value]
  284 |     debug("Debugging lines:\n") ;
      |          ~^~~~~~~~~~~~~~~~~~~~~
new_home.cpp:287:15: warning: left operand of comma operator has no effect [-Wunused-value]
  287 |         debug("x: [%d,%d] and slope %d and time %d %d\n", e.xConta, e.xIntercept, e.type, compressionTime[e.t1] , compressionTime[e.t2] ) ;
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
new_home.cpp:287:61: warning: right operand of comma operator has no effect [-Wunused-value]
  287 |         debug("x: [%d,%d] and slope %d and time %d %d\n", e.xConta, e.xIntercept, e.type, compressionTime[e.t1] , compressionTime[e.t2] ) ;
      |                                                           ~~^~~~~~
new_home.cpp:287:71: warning: right operand of comma operator has no effect [-Wunused-value]
  287 |         debug("x: [%d,%d] and slope %d and time %d %d\n", e.xConta, e.xIntercept, e.type, compressionTime[e.t1] , compressionTime[e.t2] ) ;
      |                                                                     ~~^~~~~~~~~~
new_home.cpp:287:85: warning: right operand of comma operator has no effect [-Wunused-value]
  287 |         debug("x: [%d,%d] and slope %d and time %d %d\n", e.xConta, e.xIntercept, e.type, compressionTime[e.t1] , compressionTime[e.t2] ) ;
      |                                                                                   ~~^~~~
new_home.cpp:174:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  174 |     scanf("%d%d%d", &N , &K , &Q ) ;
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
new_home.cpp:186:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  186 |         scanf("%d%d%d%d", &x, &t, &a, &b ) ;
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
new_home.cpp:238:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  238 |         scanf("%d%d", &l, &y ) ;
      |         ~~~~~^~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 77 ms 113016 KB Output is correct
2 Correct 77 ms 113016 KB Output is correct
3 Correct 78 ms 113144 KB Output is correct
4 Correct 77 ms 113016 KB Output is correct
5 Correct 79 ms 113144 KB Output is correct
6 Correct 83 ms 113656 KB Output is correct
7 Correct 86 ms 113784 KB Output is correct
8 Correct 86 ms 113784 KB Output is correct
9 Correct 84 ms 113784 KB Output is correct
10 Correct 86 ms 113656 KB Output is correct
11 Correct 83 ms 113656 KB Output is correct
12 Correct 83 ms 113628 KB Output is correct
13 Correct 84 ms 113528 KB Output is correct
14 Correct 81 ms 113612 KB Output is correct
15 Correct 85 ms 113656 KB Output is correct
16 Correct 85 ms 113656 KB Output is correct
17 Correct 84 ms 113656 KB Output is correct
18 Correct 85 ms 113788 KB Output is correct
19 Correct 85 ms 113784 KB Output is correct
20 Correct 83 ms 113656 KB Output is correct
21 Correct 80 ms 113400 KB Output is correct
22 Correct 85 ms 113784 KB Output is correct
23 Correct 83 ms 113784 KB Output is correct
24 Correct 83 ms 113788 KB Output is correct
25 Correct 84 ms 113656 KB Output is correct
26 Correct 83 ms 113596 KB Output is correct
27 Correct 81 ms 113400 KB Output is correct
28 Correct 84 ms 113636 KB Output is correct
29 Correct 83 ms 113656 KB Output is correct
30 Correct 82 ms 113528 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 77 ms 113016 KB Output is correct
2 Correct 77 ms 113016 KB Output is correct
3 Correct 78 ms 113144 KB Output is correct
4 Correct 77 ms 113016 KB Output is correct
5 Correct 79 ms 113144 KB Output is correct
6 Correct 83 ms 113656 KB Output is correct
7 Correct 86 ms 113784 KB Output is correct
8 Correct 86 ms 113784 KB Output is correct
9 Correct 84 ms 113784 KB Output is correct
10 Correct 86 ms 113656 KB Output is correct
11 Correct 83 ms 113656 KB Output is correct
12 Correct 83 ms 113628 KB Output is correct
13 Correct 84 ms 113528 KB Output is correct
14 Correct 81 ms 113612 KB Output is correct
15 Correct 85 ms 113656 KB Output is correct
16 Correct 85 ms 113656 KB Output is correct
17 Correct 84 ms 113656 KB Output is correct
18 Correct 85 ms 113788 KB Output is correct
19 Correct 85 ms 113784 KB Output is correct
20 Correct 83 ms 113656 KB Output is correct
21 Correct 80 ms 113400 KB Output is correct
22 Correct 85 ms 113784 KB Output is correct
23 Correct 83 ms 113784 KB Output is correct
24 Correct 83 ms 113788 KB Output is correct
25 Correct 84 ms 113656 KB Output is correct
26 Correct 83 ms 113596 KB Output is correct
27 Correct 81 ms 113400 KB Output is correct
28 Correct 84 ms 113636 KB Output is correct
29 Correct 83 ms 113656 KB Output is correct
30 Correct 82 ms 113528 KB Output is correct
31 Correct 3365 ms 250072 KB Output is correct
32 Correct 166 ms 125300 KB Output is correct
33 Correct 2843 ms 238388 KB Output is correct
34 Correct 3175 ms 238776 KB Output is correct
35 Correct 3241 ms 249940 KB Output is correct
36 Correct 3047 ms 249852 KB Output is correct
37 Correct 1943 ms 229304 KB Output is correct
38 Correct 1867 ms 229068 KB Output is correct
39 Correct 1271 ms 216276 KB Output is correct
40 Correct 1323 ms 219596 KB Output is correct
41 Correct 2873 ms 224136 KB Output is correct
42 Correct 2858 ms 225072 KB Output is correct
43 Correct 150 ms 123184 KB Output is correct
44 Correct 2808 ms 223820 KB Output is correct
45 Correct 2737 ms 216016 KB Output is correct
46 Correct 2427 ms 201244 KB Output is correct
47 Correct 995 ms 200140 KB Output is correct
48 Correct 957 ms 195068 KB Output is correct
49 Correct 1141 ms 206156 KB Output is correct
50 Correct 1332 ms 223564 KB Output is correct
51 Correct 1195 ms 201300 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4660 ms 547584 KB Output is correct
2 Correct 4958 ms 500440 KB Output is correct
3 Execution timed out 5065 ms 732612 KB Time limit exceeded
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 3955 ms 510928 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 77 ms 113016 KB Output is correct
2 Correct 77 ms 113016 KB Output is correct
3 Correct 78 ms 113144 KB Output is correct
4 Correct 77 ms 113016 KB Output is correct
5 Correct 79 ms 113144 KB Output is correct
6 Correct 83 ms 113656 KB Output is correct
7 Correct 86 ms 113784 KB Output is correct
8 Correct 86 ms 113784 KB Output is correct
9 Correct 84 ms 113784 KB Output is correct
10 Correct 86 ms 113656 KB Output is correct
11 Correct 83 ms 113656 KB Output is correct
12 Correct 83 ms 113628 KB Output is correct
13 Correct 84 ms 113528 KB Output is correct
14 Correct 81 ms 113612 KB Output is correct
15 Correct 85 ms 113656 KB Output is correct
16 Correct 85 ms 113656 KB Output is correct
17 Correct 84 ms 113656 KB Output is correct
18 Correct 85 ms 113788 KB Output is correct
19 Correct 85 ms 113784 KB Output is correct
20 Correct 83 ms 113656 KB Output is correct
21 Correct 80 ms 113400 KB Output is correct
22 Correct 85 ms 113784 KB Output is correct
23 Correct 83 ms 113784 KB Output is correct
24 Correct 83 ms 113788 KB Output is correct
25 Correct 84 ms 113656 KB Output is correct
26 Correct 83 ms 113596 KB Output is correct
27 Correct 81 ms 113400 KB Output is correct
28 Correct 84 ms 113636 KB Output is correct
29 Correct 83 ms 113656 KB Output is correct
30 Correct 82 ms 113528 KB Output is correct
31 Correct 3365 ms 250072 KB Output is correct
32 Correct 166 ms 125300 KB Output is correct
33 Correct 2843 ms 238388 KB Output is correct
34 Correct 3175 ms 238776 KB Output is correct
35 Correct 3241 ms 249940 KB Output is correct
36 Correct 3047 ms 249852 KB Output is correct
37 Correct 1943 ms 229304 KB Output is correct
38 Correct 1867 ms 229068 KB Output is correct
39 Correct 1271 ms 216276 KB Output is correct
40 Correct 1323 ms 219596 KB Output is correct
41 Correct 2873 ms 224136 KB Output is correct
42 Correct 2858 ms 225072 KB Output is correct
43 Correct 150 ms 123184 KB Output is correct
44 Correct 2808 ms 223820 KB Output is correct
45 Correct 2737 ms 216016 KB Output is correct
46 Correct 2427 ms 201244 KB Output is correct
47 Correct 995 ms 200140 KB Output is correct
48 Correct 957 ms 195068 KB Output is correct
49 Correct 1141 ms 206156 KB Output is correct
50 Correct 1332 ms 223564 KB Output is correct
51 Correct 1195 ms 201300 KB Output is correct
52 Correct 3319 ms 276136 KB Output is correct
53 Correct 3391 ms 258768 KB Output is correct
54 Correct 3474 ms 260092 KB Output is correct
55 Correct 2914 ms 241584 KB Output is correct
56 Correct 2999 ms 248792 KB Output is correct
57 Correct 2959 ms 229368 KB Output is correct
58 Correct 3143 ms 241228 KB Output is correct
59 Correct 3202 ms 250876 KB Output is correct
60 Correct 3003 ms 229584 KB Output is correct
61 Correct 299 ms 160532 KB Output is correct
62 Correct 3215 ms 275800 KB Output is correct
63 Correct 3389 ms 262612 KB Output is correct
64 Correct 3402 ms 256044 KB Output is correct
65 Correct 3259 ms 243436 KB Output is correct
66 Correct 3282 ms 228328 KB Output is correct
67 Correct 435 ms 154780 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 77 ms 113016 KB Output is correct
2 Correct 77 ms 113016 KB Output is correct
3 Correct 78 ms 113144 KB Output is correct
4 Correct 77 ms 113016 KB Output is correct
5 Correct 79 ms 113144 KB Output is correct
6 Correct 83 ms 113656 KB Output is correct
7 Correct 86 ms 113784 KB Output is correct
8 Correct 86 ms 113784 KB Output is correct
9 Correct 84 ms 113784 KB Output is correct
10 Correct 86 ms 113656 KB Output is correct
11 Correct 83 ms 113656 KB Output is correct
12 Correct 83 ms 113628 KB Output is correct
13 Correct 84 ms 113528 KB Output is correct
14 Correct 81 ms 113612 KB Output is correct
15 Correct 85 ms 113656 KB Output is correct
16 Correct 85 ms 113656 KB Output is correct
17 Correct 84 ms 113656 KB Output is correct
18 Correct 85 ms 113788 KB Output is correct
19 Correct 85 ms 113784 KB Output is correct
20 Correct 83 ms 113656 KB Output is correct
21 Correct 80 ms 113400 KB Output is correct
22 Correct 85 ms 113784 KB Output is correct
23 Correct 83 ms 113784 KB Output is correct
24 Correct 83 ms 113788 KB Output is correct
25 Correct 84 ms 113656 KB Output is correct
26 Correct 83 ms 113596 KB Output is correct
27 Correct 81 ms 113400 KB Output is correct
28 Correct 84 ms 113636 KB Output is correct
29 Correct 83 ms 113656 KB Output is correct
30 Correct 82 ms 113528 KB Output is correct
31 Correct 3365 ms 250072 KB Output is correct
32 Correct 166 ms 125300 KB Output is correct
33 Correct 2843 ms 238388 KB Output is correct
34 Correct 3175 ms 238776 KB Output is correct
35 Correct 3241 ms 249940 KB Output is correct
36 Correct 3047 ms 249852 KB Output is correct
37 Correct 1943 ms 229304 KB Output is correct
38 Correct 1867 ms 229068 KB Output is correct
39 Correct 1271 ms 216276 KB Output is correct
40 Correct 1323 ms 219596 KB Output is correct
41 Correct 2873 ms 224136 KB Output is correct
42 Correct 2858 ms 225072 KB Output is correct
43 Correct 150 ms 123184 KB Output is correct
44 Correct 2808 ms 223820 KB Output is correct
45 Correct 2737 ms 216016 KB Output is correct
46 Correct 2427 ms 201244 KB Output is correct
47 Correct 995 ms 200140 KB Output is correct
48 Correct 957 ms 195068 KB Output is correct
49 Correct 1141 ms 206156 KB Output is correct
50 Correct 1332 ms 223564 KB Output is correct
51 Correct 1195 ms 201300 KB Output is correct
52 Correct 4660 ms 547584 KB Output is correct
53 Correct 4958 ms 500440 KB Output is correct
54 Execution timed out 5065 ms 732612 KB Time limit exceeded
55 Halted 0 ms 0 KB -