답안 #225802

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
225802 2020-04-21T17:44:33 Z CaroLinda Building Skyscrapers (CEOI19_skyscrapers) C++14
61 / 100
3500 ms 794196 KB
#include <bits/stdc++.h>

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

const int MAX = 1e7+10 ;
const int MAXN = 150100 ;
const int inf = 1e9+10 ;

using namespace std ;

int N , T , idx ;
int X[MAX] , Y[MAX] , vet[MAXN] , pai[MAX] , pai_aux[MAXN] ;
int dx[8] = { 1,-1,0,0, 1,-1,1,-1 } , dy[8] = { 0,0,1,-1, -1,1, 1, -1} ;
int dx_cyclic[8] = { -1 , -1 , 0 , 1 , 1 ,1 , 0, -1 } , dy_cyclic[8] = { 0 , -1 , -1 , -1, 0 , 1 , 1 ,1  } ;
pii id[MAX] ;
bool is_full[MAX] , reachable[MAX] , checked[MAX] ;
map< pii , int > mp ;
set<int> s ;
vector<int> ans , fila ;
vector<int> componente[MAX] , adj[MAX] , adj_cyclic[MAX] ;
set<int>::iterator it ;

// ------------------------------------------------

int get_code(int x, int y)
{

    if( mp.find( mk(x,y) ) == mp.end() ) return 0 ;
    return mp.find( mk(x,y) )->ss ;

}

int find(int x)
{
    if( x == pai[x] ) return x ;
    return pai[x] = find( pai[x] ) ;
}


bool identify_articulation(int name)
{
    int j = -1 ;
    vector<int> group ;

    lp(i,0,8)
        if( is_full[ adj_cyclic[name][i] ] ) { j = i ; break ; }

    if( j == -1 ) return false ;

    int beg = -1, en = beg , times = 0 ;

    for(int i = (j+1)%8 ; true ; i = (i+1)%8 )
    {

        if( i == ((j+1)%8) && times == 1 ) break ;
        else if( i == ((j+1)%8) && times == 0 ) times ++ ;

        int c = adj_cyclic[name][i] ;

        if( is_full[c] )
        {

            if( beg == -1 ) continue ;
            if( beg % 2 == 1 && en == beg )  { beg = -1 ; continue ; }
            group.pb( find( adj_cyclic[name][beg] ) ) ;
            beg = -1 ;
            continue ;
        }

        if( beg == -1 ) beg = en = i ;
        else en = i ;

    }

    sort(all(group) ) ;

    for(int i = 1 ; i < group.size() ; i++ )
        if( group[i] == group[i-1] ) return true ;

    return false ;

}

bool identify_infinity(int name)
{
    lp(i,0,4)
    {
        int c = adj[name][i] ;
        if(c != 0 && reachable[ find(c) ]) return true ;
    }

    return false ;

}
bool check(int i) { return ( !identify_articulation(i) )&identify_infinity(i) ; }

inline void to_change(int name)
{

    for(int i = 0 ; i < 8 ; i++ )
    {

        int c = adj[name][i] ;

        if( c == 0 || !is_full[c] ) continue ;

        if( check(c) && !checked[c] )
        {
            s.insert(c) ;
            checked[c] = true ;
        }
        else if( !check(c) && checked[c] )
        {
            s.erase( s.find(c) ) ;
            checked[c] = false ;
        }

    }

}

bool join(int a, int b, bool ok )
{

    a = find(a) ;
    b = find(b) ;

    if(a==b) return false ;

    if( componente[a].size() > componente[b].size() ) swap( a , b  );

    pai[a] = b ;
    if( !reachable[b] && reachable[a] )
    {

        reachable[b] = true ;
        if(ok) for(int i : componente[b] ) fila.pb(i) ;
    }

    for( int i : componente[a] )
    {
        componente[b].pb(i) ;
        if( ok ) fila.pb(i) ;
    }
    componente[a].clear() ;

    for(int i : fila ) to_change(i) ;
    fila.clear() ;

    return true ;

}

int find_aux(int x)
{
    if( x == pai_aux[x] ) return x ;
    return pai_aux[x] = find_aux( pai_aux[x] ) ;
}
inline void join_aux(int a, int b)
{
    a = find_aux(a) ;
    b = find_aux(b) ;

    if( rand() % 2 ) swap(a,b) ;

    pai_aux[a] = b ;

}

int main()
{
    scanf("%d%d", &N , &T ) ;
    lp(i,1,N+1)
    {
        scanf("%d%d", &X[i] , &Y[i]) ;
        mp.insert( mk( mk( X[i] , Y[i] ) , i ) ) ;
        is_full[i] = true ;
        vet[i] = pai_aux[i] = i ;
    }

    idx = N ;

    lp(i,1,N+1)
    {
        for(int j = 0 ; j < 8 ; j++ )
        {

            int nx = dx[j] + X[i] ;
            int ny = dy[j] + Y[i] ;

            if( mp.find( mk(nx,ny) ) == mp.end() ) mp.insert( mk( mk(nx,ny) , ++idx ) ) ;

            if( is_full[ get_code(nx,ny) ] ) join_aux( i , get_code(nx,ny) ) ;

        }
    }

    lp(i,2,N+1)
        if( find_aux(i) != find_aux(1) ) {  printf("NO\n") ; return 0 ; }

    for(auto p : mp )
    {
        X[p.ss] = p.ff.ff ;
        Y[p.ss] = p.ff.ss ;
        pai[ p.ss ] = p.ss ;
        componente[p.ss].pb( p.ss ) ;

        for(int j = 0 , nx , ny , c ; j < 8 ; j++ )
        {

            nx = p.ff.ff + dx[j] ;
            ny = p.ff.ss + dy[j] ;
            c = get_code(nx,ny) ;

            adj[p.ss].pb(c) ;

            nx = p.ff.ff + dx_cyclic[j] ;
            ny = p.ff.ss + dy_cyclic[j] ;
            c = get_code(nx,ny) ;

            adj_cyclic[p.ss].pb( c ) ;

        }

    }

    int id = -1 , mn = inf ;

    for(auto p : mp )
        if( p.ff.ff < mn ) mn = p.ff.ff , id = p.ss ;
    reachable[id] = true ;

    for(auto p : mp )
    {

        if( is_full[p.ss] ) continue ;

        lp(i,0,4)
            if( adj[p.ss][i] != 0 && !is_full[ adj[p.ss][i] ] )
                join( p.ss , adj[p.ss][i] , false ) ;

    }


    lp(i,1,N+1)
        if( check(i) )
        {
            s.insert(i) ;
            checked[i] = true ;
        }

    while( s.size() > 0 )
    {
        it = prev( s.end() ) ;

        int best_id = *it ;
        s.erase(it) ;

        ans.pb( best_id ) ;
        is_full[best_id] = false ;

        for(int i = 0 , nx , ny ,c ; i < 4 ; i++ )
        {
            nx = dx[i] + X[best_id] ;
            ny = dy[i] + Y[ best_id ] ;
            c = get_code( nx,ny ) ;

            if( is_full[c] ) continue ;

            join( c , best_id, true ) ;

        }

        to_change( best_id ) ;

        for(int i : fila ) to_change(i) ;

    }

    printf("YES\n") ;
    reverse(all(ans)) ;
    for(int i : ans ) printf("%d\n" , i ) ;

}

Compilation message

skyscrapers.cpp: In function 'bool identify_articulation(int)':
skyscrapers.cpp:85:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i = 1 ; i < group.size() ; i++ )
                     ~~^~~~~~~~~~~~~~
skyscrapers.cpp: In function 'int main()':
skyscrapers.cpp:180:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d", &N , &T ) ;
     ~~~~~^~~~~~~~~~~~~~~~~~
skyscrapers.cpp:183:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d%d", &X[i] , &Y[i]) ;
         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 363 ms 704976 KB ans=YES N=1
2 Correct 368 ms 704888 KB ans=YES N=4
3 Correct 362 ms 705016 KB ans=NO N=4
4 Correct 367 ms 704824 KB ans=YES N=5
5 Correct 358 ms 704892 KB ans=YES N=9
6 Correct 356 ms 704888 KB ans=YES N=5
7 Correct 362 ms 704888 KB ans=NO N=9
8 Correct 356 ms 704984 KB ans=NO N=10
9 Correct 362 ms 704888 KB ans=YES N=10
10 Correct 361 ms 704888 KB ans=YES N=10
11 Correct 358 ms 704888 KB ans=YES N=10
12 Correct 361 ms 705016 KB ans=YES N=9
13 Correct 361 ms 704888 KB ans=YES N=9
14 Correct 361 ms 704840 KB ans=YES N=8
15 Correct 358 ms 704888 KB ans=YES N=8
16 Correct 364 ms 705016 KB ans=NO N=2
# 결과 실행 시간 메모리 Grader output
1 Correct 363 ms 704976 KB ans=YES N=1
2 Correct 368 ms 704888 KB ans=YES N=4
3 Correct 362 ms 705016 KB ans=NO N=4
4 Correct 367 ms 704824 KB ans=YES N=5
5 Correct 358 ms 704892 KB ans=YES N=9
6 Correct 356 ms 704888 KB ans=YES N=5
7 Correct 362 ms 704888 KB ans=NO N=9
8 Correct 356 ms 704984 KB ans=NO N=10
9 Correct 362 ms 704888 KB ans=YES N=10
10 Correct 361 ms 704888 KB ans=YES N=10
11 Correct 358 ms 704888 KB ans=YES N=10
12 Correct 361 ms 705016 KB ans=YES N=9
13 Correct 361 ms 704888 KB ans=YES N=9
14 Correct 361 ms 704840 KB ans=YES N=8
15 Correct 358 ms 704888 KB ans=YES N=8
16 Correct 364 ms 705016 KB ans=NO N=2
17 Correct 361 ms 704888 KB ans=YES N=17
18 Correct 372 ms 705016 KB ans=YES N=25
19 Correct 361 ms 704888 KB ans=YES N=100
20 Correct 355 ms 704888 KB ans=YES N=185
21 Correct 364 ms 705016 KB ans=NO N=174
22 Correct 358 ms 704888 KB ans=YES N=90
23 Correct 369 ms 705060 KB ans=YES N=63
24 Correct 375 ms 704888 KB ans=YES N=87
25 Correct 367 ms 705016 KB ans=YES N=183
26 Correct 358 ms 705016 KB ans=YES N=188
27 Correct 360 ms 705016 KB ans=YES N=183
28 Correct 353 ms 704888 KB ans=YES N=189
29 Correct 375 ms 704880 KB ans=YES N=200
30 Correct 356 ms 705144 KB ans=YES N=190
31 Correct 369 ms 705016 KB ans=YES N=187
32 Correct 357 ms 705016 KB ans=YES N=187
33 Correct 371 ms 704952 KB ans=YES N=182
34 Correct 394 ms 705124 KB ans=YES N=184
35 Correct 388 ms 705256 KB ans=YES N=188
36 Correct 382 ms 704992 KB ans=YES N=181
37 Correct 390 ms 705064 KB ans=YES N=188
38 Correct 379 ms 705016 KB ans=YES N=191
39 Correct 391 ms 705144 KB ans=YES N=196
40 Correct 375 ms 705016 KB ans=YES N=196
41 Correct 393 ms 705088 KB ans=YES N=196
42 Correct 394 ms 705004 KB ans=YES N=196
43 Correct 386 ms 704952 KB ans=YES N=195
# 결과 실행 시간 메모리 Grader output
1 Correct 363 ms 704976 KB ans=YES N=1
2 Correct 368 ms 704888 KB ans=YES N=4
3 Correct 362 ms 705016 KB ans=NO N=4
4 Correct 367 ms 704824 KB ans=YES N=5
5 Correct 358 ms 704892 KB ans=YES N=9
6 Correct 356 ms 704888 KB ans=YES N=5
7 Correct 362 ms 704888 KB ans=NO N=9
8 Correct 356 ms 704984 KB ans=NO N=10
9 Correct 362 ms 704888 KB ans=YES N=10
10 Correct 361 ms 704888 KB ans=YES N=10
11 Correct 358 ms 704888 KB ans=YES N=10
12 Correct 361 ms 705016 KB ans=YES N=9
13 Correct 361 ms 704888 KB ans=YES N=9
14 Correct 361 ms 704840 KB ans=YES N=8
15 Correct 358 ms 704888 KB ans=YES N=8
16 Correct 364 ms 705016 KB ans=NO N=2
17 Correct 361 ms 704888 KB ans=YES N=17
18 Correct 372 ms 705016 KB ans=YES N=25
19 Correct 361 ms 704888 KB ans=YES N=100
20 Correct 355 ms 704888 KB ans=YES N=185
21 Correct 364 ms 705016 KB ans=NO N=174
22 Correct 358 ms 704888 KB ans=YES N=90
23 Correct 369 ms 705060 KB ans=YES N=63
24 Correct 375 ms 704888 KB ans=YES N=87
25 Correct 367 ms 705016 KB ans=YES N=183
26 Correct 358 ms 705016 KB ans=YES N=188
27 Correct 360 ms 705016 KB ans=YES N=183
28 Correct 353 ms 704888 KB ans=YES N=189
29 Correct 375 ms 704880 KB ans=YES N=200
30 Correct 356 ms 705144 KB ans=YES N=190
31 Correct 369 ms 705016 KB ans=YES N=187
32 Correct 357 ms 705016 KB ans=YES N=187
33 Correct 371 ms 704952 KB ans=YES N=182
34 Correct 394 ms 705124 KB ans=YES N=184
35 Correct 388 ms 705256 KB ans=YES N=188
36 Correct 382 ms 704992 KB ans=YES N=181
37 Correct 390 ms 705064 KB ans=YES N=188
38 Correct 379 ms 705016 KB ans=YES N=191
39 Correct 391 ms 705144 KB ans=YES N=196
40 Correct 375 ms 705016 KB ans=YES N=196
41 Correct 393 ms 705088 KB ans=YES N=196
42 Correct 394 ms 705004 KB ans=YES N=196
43 Correct 386 ms 704952 KB ans=YES N=195
44 Correct 397 ms 706044 KB ans=NO N=1934
45 Correct 404 ms 705344 KB ans=NO N=1965
46 Correct 396 ms 705412 KB ans=YES N=1824
47 Correct 411 ms 705388 KB ans=YES N=1981
48 Correct 404 ms 705448 KB ans=YES N=1814
49 Correct 406 ms 705528 KB ans=YES N=1854
50 Correct 415 ms 705472 KB ans=YES N=1831
51 Correct 398 ms 705500 KB ans=YES N=2000
52 Correct 414 ms 705656 KB ans=YES N=1847
53 Correct 451 ms 705812 KB ans=YES N=1819
54 Correct 409 ms 705528 KB ans=YES N=1986
55 Correct 423 ms 706144 KB ans=YES N=2000
56 Correct 423 ms 706296 KB ans=YES N=1834
57 Correct 433 ms 706232 KB ans=YES N=1860
58 Correct 461 ms 706296 KB ans=YES N=1898
59 Correct 422 ms 705984 KB ans=YES N=1832
60 Correct 415 ms 706708 KB ans=YES N=1929
61 Correct 450 ms 705648 KB ans=YES N=1919
62 Correct 399 ms 706176 KB ans=YES N=1882
63 Correct 415 ms 706656 KB ans=YES N=1922
64 Correct 414 ms 705736 KB ans=YES N=1989
65 Correct 394 ms 705888 KB ans=YES N=1978
66 Correct 399 ms 706068 KB ans=YES N=1867
67 Correct 457 ms 706064 KB ans=YES N=1942
# 결과 실행 시간 메모리 Grader output
1 Correct 374 ms 706168 KB ans=NO N=1934
2 Correct 380 ms 705272 KB ans=NO N=1965
3 Correct 412 ms 705544 KB ans=YES N=1824
4 Correct 402 ms 705492 KB ans=YES N=1981
5 Correct 428 ms 705400 KB ans=YES N=1814
6 Correct 396 ms 705528 KB ans=YES N=1854
7 Correct 405 ms 705400 KB ans=YES N=1831
8 Correct 408 ms 705532 KB ans=YES N=2000
9 Correct 402 ms 705656 KB ans=YES N=1847
10 Correct 407 ms 705744 KB ans=YES N=1819
11 Correct 430 ms 705552 KB ans=YES N=1986
12 Correct 406 ms 706168 KB ans=YES N=2000
13 Correct 448 ms 706428 KB ans=YES N=1834
14 Correct 419 ms 706308 KB ans=YES N=1860
15 Correct 427 ms 706344 KB ans=YES N=1898
16 Correct 426 ms 706164 KB ans=YES N=1832
17 Correct 408 ms 706564 KB ans=YES N=1929
18 Correct 403 ms 705548 KB ans=YES N=1919
19 Correct 415 ms 706168 KB ans=YES N=1882
20 Correct 427 ms 706568 KB ans=YES N=1922
21 Correct 526 ms 705656 KB ans=YES N=1989
22 Correct 406 ms 706004 KB ans=YES N=1978
23 Correct 409 ms 706172 KB ans=YES N=1867
# 결과 실행 시간 메모리 Grader output
1 Correct 363 ms 704976 KB ans=YES N=1
2 Correct 368 ms 704888 KB ans=YES N=4
3 Correct 362 ms 705016 KB ans=NO N=4
4 Correct 367 ms 704824 KB ans=YES N=5
5 Correct 358 ms 704892 KB ans=YES N=9
6 Correct 356 ms 704888 KB ans=YES N=5
7 Correct 362 ms 704888 KB ans=NO N=9
8 Correct 356 ms 704984 KB ans=NO N=10
9 Correct 362 ms 704888 KB ans=YES N=10
10 Correct 361 ms 704888 KB ans=YES N=10
11 Correct 358 ms 704888 KB ans=YES N=10
12 Correct 361 ms 705016 KB ans=YES N=9
13 Correct 361 ms 704888 KB ans=YES N=9
14 Correct 361 ms 704840 KB ans=YES N=8
15 Correct 358 ms 704888 KB ans=YES N=8
16 Correct 364 ms 705016 KB ans=NO N=2
17 Correct 361 ms 704888 KB ans=YES N=17
18 Correct 372 ms 705016 KB ans=YES N=25
19 Correct 361 ms 704888 KB ans=YES N=100
20 Correct 355 ms 704888 KB ans=YES N=185
21 Correct 364 ms 705016 KB ans=NO N=174
22 Correct 358 ms 704888 KB ans=YES N=90
23 Correct 369 ms 705060 KB ans=YES N=63
24 Correct 375 ms 704888 KB ans=YES N=87
25 Correct 367 ms 705016 KB ans=YES N=183
26 Correct 358 ms 705016 KB ans=YES N=188
27 Correct 360 ms 705016 KB ans=YES N=183
28 Correct 353 ms 704888 KB ans=YES N=189
29 Correct 375 ms 704880 KB ans=YES N=200
30 Correct 356 ms 705144 KB ans=YES N=190
31 Correct 369 ms 705016 KB ans=YES N=187
32 Correct 357 ms 705016 KB ans=YES N=187
33 Correct 371 ms 704952 KB ans=YES N=182
34 Correct 394 ms 705124 KB ans=YES N=184
35 Correct 388 ms 705256 KB ans=YES N=188
36 Correct 382 ms 704992 KB ans=YES N=181
37 Correct 390 ms 705064 KB ans=YES N=188
38 Correct 379 ms 705016 KB ans=YES N=191
39 Correct 391 ms 705144 KB ans=YES N=196
40 Correct 375 ms 705016 KB ans=YES N=196
41 Correct 393 ms 705088 KB ans=YES N=196
42 Correct 394 ms 705004 KB ans=YES N=196
43 Correct 386 ms 704952 KB ans=YES N=195
44 Correct 397 ms 706044 KB ans=NO N=1934
45 Correct 404 ms 705344 KB ans=NO N=1965
46 Correct 396 ms 705412 KB ans=YES N=1824
47 Correct 411 ms 705388 KB ans=YES N=1981
48 Correct 404 ms 705448 KB ans=YES N=1814
49 Correct 406 ms 705528 KB ans=YES N=1854
50 Correct 415 ms 705472 KB ans=YES N=1831
51 Correct 398 ms 705500 KB ans=YES N=2000
52 Correct 414 ms 705656 KB ans=YES N=1847
53 Correct 451 ms 705812 KB ans=YES N=1819
54 Correct 409 ms 705528 KB ans=YES N=1986
55 Correct 423 ms 706144 KB ans=YES N=2000
56 Correct 423 ms 706296 KB ans=YES N=1834
57 Correct 433 ms 706232 KB ans=YES N=1860
58 Correct 461 ms 706296 KB ans=YES N=1898
59 Correct 422 ms 705984 KB ans=YES N=1832
60 Correct 415 ms 706708 KB ans=YES N=1929
61 Correct 450 ms 705648 KB ans=YES N=1919
62 Correct 399 ms 706176 KB ans=YES N=1882
63 Correct 415 ms 706656 KB ans=YES N=1922
64 Correct 414 ms 705736 KB ans=YES N=1989
65 Correct 394 ms 705888 KB ans=YES N=1978
66 Correct 399 ms 706068 KB ans=YES N=1867
67 Correct 457 ms 706064 KB ans=YES N=1942
68 Correct 807 ms 712932 KB ans=NO N=66151
69 Correct 898 ms 734772 KB ans=NO N=64333
70 Correct 1409 ms 722052 KB ans=YES N=69316
71 Correct 1322 ms 721524 KB ans=YES N=66695
72 Correct 1357 ms 722112 KB ans=YES N=68436
73 Correct 1390 ms 722592 KB ans=YES N=70000
74 Correct 1376 ms 722540 KB ans=YES N=68501
75 Correct 1478 ms 723576 KB ans=YES N=70000
76 Correct 1473 ms 725156 KB ans=YES N=65009
77 Correct 1961 ms 740756 KB ans=YES N=67007
78 Correct 1914 ms 747888 KB ans=YES N=66357
79 Correct 1955 ms 752908 KB ans=YES N=65430
80 Correct 1956 ms 750824 KB ans=YES N=65790
81 Correct 2072 ms 747592 KB ans=YES N=66020
82 Correct 1831 ms 743364 KB ans=YES N=65809
83 Correct 1563 ms 729512 KB ans=YES N=65651
84 Correct 2280 ms 765296 KB ans=YES N=68040
85 Correct 2109 ms 757548 KB ans=YES N=66570
86 Correct 1363 ms 723696 KB ans=YES N=65421
87 Correct 1436 ms 726516 KB ans=YES N=68351
88 Correct 1257 ms 721364 KB ans=YES N=67027
89 Correct 1346 ms 735900 KB ans=YES N=68879
90 Correct 1466 ms 726600 KB ans=YES N=67256
91 Correct 2692 ms 743800 KB ans=YES N=148315
92 Correct 1562 ms 778540 KB ans=NO N=142745
93 Correct 1398 ms 794196 KB ans=NO N=148443
94 Correct 2716 ms 743148 KB ans=YES N=148328
95 Correct 2839 ms 743644 KB ans=YES N=147855
96 Correct 2741 ms 743956 KB ans=YES N=150000
97 Correct 2721 ms 742616 KB ans=YES N=144725
98 Correct 2936 ms 743732 KB ans=YES N=149445
99 Correct 2770 ms 743332 KB ans=YES N=144455
100 Correct 2572 ms 742676 KB ans=YES N=143487
101 Correct 2797 ms 744352 KB ans=YES N=149688
102 Execution timed out 3614 ms 784684 KB Time limit exceeded
103 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 765 ms 712952 KB ans=NO N=66151
2 Correct 834 ms 734712 KB ans=NO N=64333
3 Correct 1272 ms 722212 KB ans=YES N=69316
4 Correct 1230 ms 721512 KB ans=YES N=66695
5 Correct 1285 ms 722280 KB ans=YES N=68436
6 Correct 1322 ms 722680 KB ans=YES N=70000
7 Correct 1360 ms 722672 KB ans=YES N=68501
8 Correct 1357 ms 723696 KB ans=YES N=70000
9 Correct 1469 ms 725048 KB ans=YES N=65009
10 Correct 1761 ms 740612 KB ans=YES N=67007
11 Correct 2013 ms 747952 KB ans=YES N=66357
12 Correct 1928 ms 752828 KB ans=YES N=65430
13 Correct 1986 ms 750840 KB ans=YES N=65790
14 Correct 1927 ms 747424 KB ans=YES N=66020
15 Correct 1834 ms 743508 KB ans=YES N=65809
16 Correct 1534 ms 729544 KB ans=YES N=65651
17 Correct 2143 ms 765284 KB ans=YES N=68040
18 Correct 2045 ms 757568 KB ans=YES N=66570
19 Correct 1409 ms 723756 KB ans=YES N=65421
20 Correct 1555 ms 726532 KB ans=YES N=68351
21 Correct 1262 ms 721496 KB ans=YES N=67027
22 Correct 1341 ms 735572 KB ans=YES N=68879
23 Correct 1497 ms 726748 KB ans=YES N=67256
# 결과 실행 시간 메모리 Grader output
1 Correct 374 ms 706168 KB ans=NO N=1934
2 Correct 380 ms 705272 KB ans=NO N=1965
3 Correct 412 ms 705544 KB ans=YES N=1824
4 Correct 402 ms 705492 KB ans=YES N=1981
5 Correct 428 ms 705400 KB ans=YES N=1814
6 Correct 396 ms 705528 KB ans=YES N=1854
7 Correct 405 ms 705400 KB ans=YES N=1831
8 Correct 408 ms 705532 KB ans=YES N=2000
9 Correct 402 ms 705656 KB ans=YES N=1847
10 Correct 407 ms 705744 KB ans=YES N=1819
11 Correct 430 ms 705552 KB ans=YES N=1986
12 Correct 406 ms 706168 KB ans=YES N=2000
13 Correct 448 ms 706428 KB ans=YES N=1834
14 Correct 419 ms 706308 KB ans=YES N=1860
15 Correct 427 ms 706344 KB ans=YES N=1898
16 Correct 426 ms 706164 KB ans=YES N=1832
17 Correct 408 ms 706564 KB ans=YES N=1929
18 Correct 403 ms 705548 KB ans=YES N=1919
19 Correct 415 ms 706168 KB ans=YES N=1882
20 Correct 427 ms 706568 KB ans=YES N=1922
21 Correct 526 ms 705656 KB ans=YES N=1989
22 Correct 406 ms 706004 KB ans=YES N=1978
23 Correct 409 ms 706172 KB ans=YES N=1867
24 Correct 765 ms 712952 KB ans=NO N=66151
25 Correct 834 ms 734712 KB ans=NO N=64333
26 Correct 1272 ms 722212 KB ans=YES N=69316
27 Correct 1230 ms 721512 KB ans=YES N=66695
28 Correct 1285 ms 722280 KB ans=YES N=68436
29 Correct 1322 ms 722680 KB ans=YES N=70000
30 Correct 1360 ms 722672 KB ans=YES N=68501
31 Correct 1357 ms 723696 KB ans=YES N=70000
32 Correct 1469 ms 725048 KB ans=YES N=65009
33 Correct 1761 ms 740612 KB ans=YES N=67007
34 Correct 2013 ms 747952 KB ans=YES N=66357
35 Correct 1928 ms 752828 KB ans=YES N=65430
36 Correct 1986 ms 750840 KB ans=YES N=65790
37 Correct 1927 ms 747424 KB ans=YES N=66020
38 Correct 1834 ms 743508 KB ans=YES N=65809
39 Correct 1534 ms 729544 KB ans=YES N=65651
40 Correct 2143 ms 765284 KB ans=YES N=68040
41 Correct 2045 ms 757568 KB ans=YES N=66570
42 Correct 1409 ms 723756 KB ans=YES N=65421
43 Correct 1555 ms 726532 KB ans=YES N=68351
44 Correct 1262 ms 721496 KB ans=YES N=67027
45 Correct 1341 ms 735572 KB ans=YES N=68879
46 Correct 1497 ms 726748 KB ans=YES N=67256
47 Correct 2814 ms 743804 KB ans=YES N=148315
48 Correct 1553 ms 778428 KB ans=NO N=142745
49 Correct 1400 ms 794148 KB ans=NO N=148443
50 Correct 2692 ms 743228 KB ans=YES N=148328
51 Correct 2755 ms 743404 KB ans=YES N=147855
52 Correct 2745 ms 743960 KB ans=YES N=150000
53 Correct 2754 ms 742496 KB ans=YES N=144725
54 Correct 2638 ms 743540 KB ans=YES N=149445
55 Correct 2791 ms 743212 KB ans=YES N=144455
56 Correct 2712 ms 742544 KB ans=YES N=143487
57 Correct 2940 ms 744360 KB ans=YES N=149688
58 Execution timed out 3614 ms 784608 KB Time limit exceeded
59 Halted 0 ms 0 KB -