답안 #259855

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
259855 2020-08-08T17:20:20 Z MarcoMeijer Building Skyscrapers (CEOI19_skyscrapers) C++14
100 / 100
2284 ms 152824 KB
#include <bits/stdc++.h>
using namespace std;

// macros
typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;
typedef pair<ll, ll> lll;
typedef tuple<int, int, int> iii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<iii> viii;
typedef vector<ll> vll;
typedef vector<lll> vlll;
#define REP(a,b,c) for(int a=int(b); a<int(c); a++)
#define RE(a,c) REP(a,0,c)
#define RE1(a,c) REP(a,1,c+1)
#define REI(a,b,c) REP(a,b,c+1)
#define REV(a,b,c) for(int a=int(c-1); a>=int(b); a--)
#define FOR(a,b) for(auto& a : b)
#define all(a) a.begin(), a.end()
#define INF 1e9
#define EPS 1e-9
#define pb push_back
#define popb pop_back
#define fi first
#define se second
#define sz size()

// input
template<class T> void IN(T& x) {cin >> x;}
template<class H, class... T> void IN(H& h, T&... t) {IN(h); IN(t...); }

// output
template<class T1, class T2> void OUT(const pair<T1,T2>& x);
template<class T> void OUT(const T& x) {cout << x;}
template<class H, class... T> void OUT(const H& h, const T&... t) {OUT(h); OUT(t...); }
template<class T1, class T2> void OUT(const pair<T1,T2>& x) {OUT(x.fi," ",x.se);}
template<class... T> void OUTL(const T&... t) {OUT(t..., "\n"); }

//===================//
//  Added libraries  //
//===================//

//===================//
//end added libraries//
//===================//

void program();
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    program();
}


//===================//
//   begin program   //
//===================//

const int MX = 14e5;

int dx8[]={ 0, 1, 1, 1, 0,-1,-1,-1};
int dy8[]={ 1, 1, 0,-1,-1,-1, 0, 1};

int n, t, m=0;
int R[MX], C[MX];
int OR[MX], OC[MX];
int adj[MX][8];
int F[MX];
bitset<MX> visited, build, out, hasEmptyConnected;
map<ii,int> f;
map<ii,int> posID;
set<int> pq;
vi ans;
int outside;
set<int> updateDestroy;

int p[MX], r[MX];
void buildDSU(int dsuSize) {
    RE(i,dsuSize) p[i]=i, r[i]=0;
}
int getSet(int i) {return i==p[i]?i:p[i]=getSet(p[i]);}
bool isSameSet(int i, int j) {return getSet(i)==getSet(j);}
void unionSet(int i, int j) {
    if(!isSameSet(i,j)) {
        i=p[i], j=p[j];
        if(r[i] > r[j]) {
            p[j] = i;
        } else {
            p[i] = j;
            if(r[i] == r[j]) r[j]++;
        }
    }
}

bool canDestroy(int p) {
    if(!hasEmptyConnected[p]) return 0;

    int start=0;
    bitset<8> isBuild;
    RE(d,8) {
        isBuild[d] = build[adj[p][d]];
        if(isBuild[d])
            start = d;
    }
    RE(d,4) {
        int cd=d*2;
        int nd=(cd+2)%8;
        if(isBuild[cd] && isBuild[nd])
            isBuild[(cd+1)%8]=1;
    }

    set<int> curRegions;
    bool last=1;
    int pos=(start+1)%8;
    while(pos != start) {
        if(last && !isBuild[pos]) {
            int reg = getSet(adj[p][pos]);
            if(curRegions.count(reg)) return 0;
            curRegions.insert(reg);
        }
        last = isBuild[pos];
        pos=(pos+1)%8;
    }

    return 1;
}
void updateBuild(int p) {
    if(p == -1) return;
    if(canDestroy(p)) {
        pq.insert(F[p]);
    } else {
        pq.erase(F[p]);
    }
}
void addOutside(int p) {
    if(p == -1) return;
    if(out[p]) return;

    bitset<8> isBuild; isBuild.reset();
    RE(d,8)
        if(adj[p][d] != -1)
            isBuild[d] = build[adj[p][d]];
    if(!isBuild.count()) return;

    out[p] = 1;
    RE(d,4) {
        if(!isBuild[d*2])
            addOutside(adj[p][d*2]);
        else
            hasEmptyConnected[adj[p][d*2]] = 1;
    }
    RE(d,8)
        if(isBuild[d])
            updateDestroy.insert(adj[p][d]);
}

void dfsPossible(int u) {
    if(u == -1) return;
    if(!build[u]) return;
    if(visited[F[u]]) return;
    visited[F[u]] = 1;
    RE(d,8)
        dfsPossible(adj[u][d]);
}
bool isPossible() {
    visited.reset();
    dfsPossible(0);
    RE1(i,n) if(!visited[i]) return 0;
    return 1;
}

void addPossible(ii p) {
    if(posID.count(p)) return;
    posID[p] = m++;
}

void program() {
    IN(n,t);
    RE1(i,n) IN(R[i],C[i]);
    RE1(i,n) OR[i]=R[i], OC[i]=C[i];
    RE1(i,n) f[{R[i],C[i]}] = i;

    build.reset();
    out.reset();
    hasEmptyConnected.reset();

    // coördinate compression
    RE1(i,n) {
        int x=R[i], y=C[i];
        addPossible({x,y});
        RE(d,8) {
            int nx=x+dx8[d];
            int ny=y+dy8[d];
            addPossible({nx,ny});
        }
    }
    FOR(p,posID) {
        int x = p.fi.fi;
        int y = p.fi.se;
        RE(d,8) {
            int nx=x+dx8[d];
            int ny=y+dy8[d];
            if(posID.count({nx,ny})) adj[p.se][d] = posID[{nx,ny}];
            else adj[p.se][d] = -1;
        }
        R[p.se] = x;
        C[p.se] = y;
        if(f.count({x,y})) F[p.se] = f[{x,y}], build[p.se] = 1;
    }

    if(!isPossible()) {
        OUTL("NO");
        return;
    }

    // create dsu
    buildDSU(m);
    FOR(p,posID) {
        int u=p.se;
        if(build[u]) continue;
        RE(d,4) {
            int v=adj[u][d*2];
            if(v == -1) continue;
            if(build[v]) continue;
            unionSet(u, v);
        }
    }

    // set outside
    ii start = {OR[1],OC[1]};
    RE1(i,n) start = min(start, {OR[i],OC[i]});
    start.fi--;
    outside = posID[start];
    addOutside(outside);
    FOR(p,updateDestroy) updateBuild(p);
    updateDestroy.clear();

    // find solution
    while(!pq.empty()) {
        int p = *(--pq.end()); pq.erase(p);
        int x = OR[p];
        int y = OC[p];
        int u = posID[{x,y}];
        build[u] = 0;

        // update dsu
        RE(d,4) {
            int v = adj[u][d*2];
            if(v == -1) continue;
            if(build[v]) continue;
            unionSet(u, v);
        }

        addOutside(u);
        FOR(p,updateDestroy) updateBuild(p);
        updateDestroy.clear();

        ans.pb(p);
    }

    OUTL("YES");
    reverse(all(ans));
    FOR(i,ans) OUTL(i);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 1024 KB ans=YES N=1
2 Correct 1 ms 1024 KB ans=YES N=4
3 Correct 1 ms 1024 KB ans=NO N=4
4 Correct 1 ms 1024 KB ans=YES N=5
5 Correct 1 ms 1024 KB ans=YES N=9
6 Correct 1 ms 1024 KB ans=YES N=5
7 Correct 1 ms 1024 KB ans=NO N=9
8 Correct 1 ms 1024 KB ans=NO N=10
9 Correct 1 ms 1024 KB ans=YES N=10
10 Correct 1 ms 1024 KB ans=YES N=10
11 Correct 1 ms 1024 KB ans=YES N=10
12 Correct 1 ms 1024 KB ans=YES N=9
13 Correct 1 ms 1024 KB ans=YES N=9
14 Correct 1 ms 1024 KB ans=YES N=8
15 Correct 1 ms 1024 KB ans=YES N=8
16 Correct 1 ms 1024 KB ans=NO N=2
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 1024 KB ans=YES N=1
2 Correct 1 ms 1024 KB ans=YES N=4
3 Correct 1 ms 1024 KB ans=NO N=4
4 Correct 1 ms 1024 KB ans=YES N=5
5 Correct 1 ms 1024 KB ans=YES N=9
6 Correct 1 ms 1024 KB ans=YES N=5
7 Correct 1 ms 1024 KB ans=NO N=9
8 Correct 1 ms 1024 KB ans=NO N=10
9 Correct 1 ms 1024 KB ans=YES N=10
10 Correct 1 ms 1024 KB ans=YES N=10
11 Correct 1 ms 1024 KB ans=YES N=10
12 Correct 1 ms 1024 KB ans=YES N=9
13 Correct 1 ms 1024 KB ans=YES N=9
14 Correct 1 ms 1024 KB ans=YES N=8
15 Correct 1 ms 1024 KB ans=YES N=8
16 Correct 1 ms 1024 KB ans=NO N=2
17 Correct 1 ms 1024 KB ans=YES N=17
18 Correct 1 ms 1024 KB ans=YES N=25
19 Correct 1 ms 1152 KB ans=YES N=100
20 Correct 2 ms 1152 KB ans=YES N=185
21 Correct 3 ms 1152 KB ans=NO N=174
22 Correct 1 ms 1152 KB ans=YES N=90
23 Correct 1 ms 1152 KB ans=YES N=63
24 Correct 1 ms 1152 KB ans=YES N=87
25 Correct 2 ms 1152 KB ans=YES N=183
26 Correct 2 ms 1152 KB ans=YES N=188
27 Correct 2 ms 1152 KB ans=YES N=183
28 Correct 2 ms 1152 KB ans=YES N=189
29 Correct 2 ms 1152 KB ans=YES N=200
30 Correct 2 ms 1152 KB ans=YES N=190
31 Correct 2 ms 1152 KB ans=YES N=187
32 Correct 2 ms 1152 KB ans=YES N=187
33 Correct 2 ms 1152 KB ans=YES N=182
34 Correct 2 ms 1152 KB ans=YES N=184
35 Correct 2 ms 1152 KB ans=YES N=188
36 Correct 2 ms 1152 KB ans=YES N=181
37 Correct 2 ms 1152 KB ans=YES N=188
38 Correct 2 ms 1152 KB ans=YES N=191
39 Correct 2 ms 1152 KB ans=YES N=196
40 Correct 2 ms 1152 KB ans=YES N=196
41 Correct 2 ms 1152 KB ans=YES N=196
42 Correct 2 ms 1152 KB ans=YES N=196
43 Correct 2 ms 1152 KB ans=YES N=195
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 1024 KB ans=YES N=1
2 Correct 1 ms 1024 KB ans=YES N=4
3 Correct 1 ms 1024 KB ans=NO N=4
4 Correct 1 ms 1024 KB ans=YES N=5
5 Correct 1 ms 1024 KB ans=YES N=9
6 Correct 1 ms 1024 KB ans=YES N=5
7 Correct 1 ms 1024 KB ans=NO N=9
8 Correct 1 ms 1024 KB ans=NO N=10
9 Correct 1 ms 1024 KB ans=YES N=10
10 Correct 1 ms 1024 KB ans=YES N=10
11 Correct 1 ms 1024 KB ans=YES N=10
12 Correct 1 ms 1024 KB ans=YES N=9
13 Correct 1 ms 1024 KB ans=YES N=9
14 Correct 1 ms 1024 KB ans=YES N=8
15 Correct 1 ms 1024 KB ans=YES N=8
16 Correct 1 ms 1024 KB ans=NO N=2
17 Correct 1 ms 1024 KB ans=YES N=17
18 Correct 1 ms 1024 KB ans=YES N=25
19 Correct 1 ms 1152 KB ans=YES N=100
20 Correct 2 ms 1152 KB ans=YES N=185
21 Correct 3 ms 1152 KB ans=NO N=174
22 Correct 1 ms 1152 KB ans=YES N=90
23 Correct 1 ms 1152 KB ans=YES N=63
24 Correct 1 ms 1152 KB ans=YES N=87
25 Correct 2 ms 1152 KB ans=YES N=183
26 Correct 2 ms 1152 KB ans=YES N=188
27 Correct 2 ms 1152 KB ans=YES N=183
28 Correct 2 ms 1152 KB ans=YES N=189
29 Correct 2 ms 1152 KB ans=YES N=200
30 Correct 2 ms 1152 KB ans=YES N=190
31 Correct 2 ms 1152 KB ans=YES N=187
32 Correct 2 ms 1152 KB ans=YES N=187
33 Correct 2 ms 1152 KB ans=YES N=182
34 Correct 2 ms 1152 KB ans=YES N=184
35 Correct 2 ms 1152 KB ans=YES N=188
36 Correct 2 ms 1152 KB ans=YES N=181
37 Correct 2 ms 1152 KB ans=YES N=188
38 Correct 2 ms 1152 KB ans=YES N=191
39 Correct 2 ms 1152 KB ans=YES N=196
40 Correct 2 ms 1152 KB ans=YES N=196
41 Correct 2 ms 1152 KB ans=YES N=196
42 Correct 2 ms 1152 KB ans=YES N=196
43 Correct 2 ms 1152 KB ans=YES N=195
44 Correct 21 ms 3072 KB ans=NO N=1934
45 Correct 11 ms 1792 KB ans=NO N=1965
46 Correct 9 ms 1536 KB ans=YES N=1824
47 Correct 10 ms 1536 KB ans=YES N=1981
48 Correct 9 ms 1536 KB ans=YES N=1814
49 Correct 10 ms 1536 KB ans=YES N=1854
50 Correct 10 ms 1536 KB ans=YES N=1831
51 Correct 11 ms 1536 KB ans=YES N=2000
52 Correct 12 ms 1664 KB ans=YES N=1847
53 Correct 12 ms 1792 KB ans=YES N=1819
54 Correct 10 ms 1664 KB ans=YES N=1986
55 Correct 16 ms 1920 KB ans=YES N=2000
56 Correct 16 ms 2048 KB ans=YES N=1834
57 Correct 16 ms 2048 KB ans=YES N=1860
58 Correct 17 ms 2176 KB ans=YES N=1898
59 Correct 14 ms 1920 KB ans=YES N=1832
60 Correct 18 ms 2432 KB ans=YES N=1929
61 Correct 11 ms 1664 KB ans=YES N=1919
62 Correct 15 ms 2048 KB ans=YES N=1882
63 Correct 17 ms 2560 KB ans=YES N=1922
64 Correct 12 ms 1792 KB ans=YES N=1989
65 Correct 13 ms 2048 KB ans=YES N=1978
66 Correct 13 ms 2048 KB ans=YES N=1867
67 Correct 14 ms 1920 KB ans=YES N=1942
# 결과 실행 시간 메모리 Grader output
1 Correct 24 ms 3064 KB ans=NO N=1934
2 Correct 13 ms 1920 KB ans=NO N=1965
3 Correct 9 ms 1536 KB ans=YES N=1824
4 Correct 10 ms 1536 KB ans=YES N=1981
5 Correct 9 ms 1536 KB ans=YES N=1814
6 Correct 10 ms 1536 KB ans=YES N=1854
7 Correct 9 ms 1536 KB ans=YES N=1831
8 Correct 10 ms 1536 KB ans=YES N=2000
9 Correct 12 ms 1664 KB ans=YES N=1847
10 Correct 13 ms 1792 KB ans=YES N=1819
11 Correct 12 ms 1536 KB ans=YES N=1986
12 Correct 16 ms 1920 KB ans=YES N=2000
13 Correct 16 ms 2048 KB ans=YES N=1834
14 Correct 16 ms 2048 KB ans=YES N=1860
15 Correct 16 ms 2176 KB ans=YES N=1898
16 Correct 14 ms 1920 KB ans=YES N=1832
17 Correct 20 ms 2432 KB ans=YES N=1929
18 Correct 13 ms 1664 KB ans=YES N=1919
19 Correct 17 ms 2048 KB ans=YES N=1882
20 Correct 18 ms 2560 KB ans=YES N=1922
21 Correct 11 ms 1792 KB ans=YES N=1989
22 Correct 12 ms 2048 KB ans=YES N=1978
23 Correct 13 ms 2048 KB ans=YES N=1867
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 1024 KB ans=YES N=1
2 Correct 1 ms 1024 KB ans=YES N=4
3 Correct 1 ms 1024 KB ans=NO N=4
4 Correct 1 ms 1024 KB ans=YES N=5
5 Correct 1 ms 1024 KB ans=YES N=9
6 Correct 1 ms 1024 KB ans=YES N=5
7 Correct 1 ms 1024 KB ans=NO N=9
8 Correct 1 ms 1024 KB ans=NO N=10
9 Correct 1 ms 1024 KB ans=YES N=10
10 Correct 1 ms 1024 KB ans=YES N=10
11 Correct 1 ms 1024 KB ans=YES N=10
12 Correct 1 ms 1024 KB ans=YES N=9
13 Correct 1 ms 1024 KB ans=YES N=9
14 Correct 1 ms 1024 KB ans=YES N=8
15 Correct 1 ms 1024 KB ans=YES N=8
16 Correct 1 ms 1024 KB ans=NO N=2
17 Correct 1 ms 1024 KB ans=YES N=17
18 Correct 1 ms 1024 KB ans=YES N=25
19 Correct 1 ms 1152 KB ans=YES N=100
20 Correct 2 ms 1152 KB ans=YES N=185
21 Correct 3 ms 1152 KB ans=NO N=174
22 Correct 1 ms 1152 KB ans=YES N=90
23 Correct 1 ms 1152 KB ans=YES N=63
24 Correct 1 ms 1152 KB ans=YES N=87
25 Correct 2 ms 1152 KB ans=YES N=183
26 Correct 2 ms 1152 KB ans=YES N=188
27 Correct 2 ms 1152 KB ans=YES N=183
28 Correct 2 ms 1152 KB ans=YES N=189
29 Correct 2 ms 1152 KB ans=YES N=200
30 Correct 2 ms 1152 KB ans=YES N=190
31 Correct 2 ms 1152 KB ans=YES N=187
32 Correct 2 ms 1152 KB ans=YES N=187
33 Correct 2 ms 1152 KB ans=YES N=182
34 Correct 2 ms 1152 KB ans=YES N=184
35 Correct 2 ms 1152 KB ans=YES N=188
36 Correct 2 ms 1152 KB ans=YES N=181
37 Correct 2 ms 1152 KB ans=YES N=188
38 Correct 2 ms 1152 KB ans=YES N=191
39 Correct 2 ms 1152 KB ans=YES N=196
40 Correct 2 ms 1152 KB ans=YES N=196
41 Correct 2 ms 1152 KB ans=YES N=196
42 Correct 2 ms 1152 KB ans=YES N=196
43 Correct 2 ms 1152 KB ans=YES N=195
44 Correct 21 ms 3072 KB ans=NO N=1934
45 Correct 11 ms 1792 KB ans=NO N=1965
46 Correct 9 ms 1536 KB ans=YES N=1824
47 Correct 10 ms 1536 KB ans=YES N=1981
48 Correct 9 ms 1536 KB ans=YES N=1814
49 Correct 10 ms 1536 KB ans=YES N=1854
50 Correct 10 ms 1536 KB ans=YES N=1831
51 Correct 11 ms 1536 KB ans=YES N=2000
52 Correct 12 ms 1664 KB ans=YES N=1847
53 Correct 12 ms 1792 KB ans=YES N=1819
54 Correct 10 ms 1664 KB ans=YES N=1986
55 Correct 16 ms 1920 KB ans=YES N=2000
56 Correct 16 ms 2048 KB ans=YES N=1834
57 Correct 16 ms 2048 KB ans=YES N=1860
58 Correct 17 ms 2176 KB ans=YES N=1898
59 Correct 14 ms 1920 KB ans=YES N=1832
60 Correct 18 ms 2432 KB ans=YES N=1929
61 Correct 11 ms 1664 KB ans=YES N=1919
62 Correct 15 ms 2048 KB ans=YES N=1882
63 Correct 17 ms 2560 KB ans=YES N=1922
64 Correct 12 ms 1792 KB ans=YES N=1989
65 Correct 13 ms 2048 KB ans=YES N=1978
66 Correct 13 ms 2048 KB ans=YES N=1867
67 Correct 14 ms 1920 KB ans=YES N=1942
68 Correct 343 ms 18168 KB ans=NO N=66151
69 Correct 895 ms 53340 KB ans=NO N=64333
70 Correct 455 ms 17648 KB ans=YES N=69316
71 Correct 420 ms 17268 KB ans=YES N=66695
72 Correct 428 ms 17648 KB ans=YES N=68436
73 Correct 444 ms 18164 KB ans=YES N=70000
74 Correct 458 ms 17776 KB ans=YES N=68501
75 Correct 538 ms 18544 KB ans=YES N=70000
76 Correct 497 ms 18672 KB ans=YES N=65009
77 Correct 705 ms 26436 KB ans=YES N=67007
78 Correct 768 ms 30704 KB ans=YES N=66357
79 Correct 816 ms 35840 KB ans=YES N=65430
80 Correct 867 ms 31916 KB ans=YES N=65790
81 Correct 757 ms 29716 KB ans=YES N=66020
82 Correct 715 ms 27568 KB ans=YES N=65809
83 Correct 535 ms 20080 KB ans=YES N=65651
84 Correct 922 ms 39988 KB ans=YES N=68040
85 Correct 958 ms 36984 KB ans=YES N=66570
86 Correct 473 ms 17780 KB ans=YES N=65421
87 Correct 508 ms 18500 KB ans=YES N=68351
88 Correct 408 ms 17040 KB ans=YES N=67027
89 Correct 569 ms 26732 KB ans=YES N=68879
90 Correct 555 ms 20224 KB ans=YES N=67256
91 Correct 1304 ms 37664 KB ans=YES N=148315
92 Correct 2284 ms 129144 KB ans=NO N=142745
93 Correct 2139 ms 152824 KB ans=NO N=148443
94 Correct 1204 ms 36456 KB ans=YES N=148328
95 Correct 1162 ms 36368 KB ans=YES N=147855
96 Correct 1174 ms 36844 KB ans=YES N=150000
97 Correct 1250 ms 35524 KB ans=YES N=144725
98 Correct 1222 ms 36904 KB ans=YES N=149445
99 Correct 1169 ms 35692 KB ans=YES N=144455
100 Correct 1120 ms 35356 KB ans=YES N=143487
101 Correct 1249 ms 37100 KB ans=YES N=149688
102 Correct 1799 ms 56428 KB ans=YES N=141481
103 Correct 2218 ms 91244 KB ans=YES N=147430
104 Correct 1575 ms 50284 KB ans=YES N=142247
105 Correct 1790 ms 58344 KB ans=YES N=149941
106 Correct 2035 ms 86808 KB ans=YES N=141635
107 Correct 2001 ms 70400 KB ans=YES N=142896
108 Correct 2090 ms 75556 KB ans=YES N=142069
109 Correct 1450 ms 41936 KB ans=YES N=142378
110 Correct 1763 ms 74760 KB ans=YES N=150000
111 Correct 2167 ms 104428 KB ans=YES N=141452
112 Correct 1942 ms 107856 KB ans=YES N=134453
113 Correct 2032 ms 114428 KB ans=YES N=144172
# 결과 실행 시간 메모리 Grader output
1 Correct 380 ms 18296 KB ans=NO N=66151
2 Correct 888 ms 53316 KB ans=NO N=64333
3 Correct 447 ms 17648 KB ans=YES N=69316
4 Correct 420 ms 17140 KB ans=YES N=66695
5 Correct 468 ms 17688 KB ans=YES N=68436
6 Correct 441 ms 18164 KB ans=YES N=70000
7 Correct 439 ms 17648 KB ans=YES N=68501
8 Correct 483 ms 18336 KB ans=YES N=70000
9 Correct 508 ms 18676 KB ans=YES N=65009
10 Correct 782 ms 26408 KB ans=YES N=67007
11 Correct 769 ms 30576 KB ans=YES N=66357
12 Correct 842 ms 35844 KB ans=YES N=65430
13 Correct 813 ms 31836 KB ans=YES N=65790
14 Correct 761 ms 29844 KB ans=YES N=66020
15 Correct 713 ms 27824 KB ans=YES N=65809
16 Correct 567 ms 20208 KB ans=YES N=65651
17 Correct 953 ms 40080 KB ans=YES N=68040
18 Correct 838 ms 36984 KB ans=YES N=66570
19 Correct 470 ms 17652 KB ans=YES N=65421
20 Correct 501 ms 18500 KB ans=YES N=68351
21 Correct 428 ms 17012 KB ans=YES N=67027
22 Correct 616 ms 27000 KB ans=YES N=68879
23 Correct 537 ms 19952 KB ans=YES N=67256
# 결과 실행 시간 메모리 Grader output
1 Correct 24 ms 3064 KB ans=NO N=1934
2 Correct 13 ms 1920 KB ans=NO N=1965
3 Correct 9 ms 1536 KB ans=YES N=1824
4 Correct 10 ms 1536 KB ans=YES N=1981
5 Correct 9 ms 1536 KB ans=YES N=1814
6 Correct 10 ms 1536 KB ans=YES N=1854
7 Correct 9 ms 1536 KB ans=YES N=1831
8 Correct 10 ms 1536 KB ans=YES N=2000
9 Correct 12 ms 1664 KB ans=YES N=1847
10 Correct 13 ms 1792 KB ans=YES N=1819
11 Correct 12 ms 1536 KB ans=YES N=1986
12 Correct 16 ms 1920 KB ans=YES N=2000
13 Correct 16 ms 2048 KB ans=YES N=1834
14 Correct 16 ms 2048 KB ans=YES N=1860
15 Correct 16 ms 2176 KB ans=YES N=1898
16 Correct 14 ms 1920 KB ans=YES N=1832
17 Correct 20 ms 2432 KB ans=YES N=1929
18 Correct 13 ms 1664 KB ans=YES N=1919
19 Correct 17 ms 2048 KB ans=YES N=1882
20 Correct 18 ms 2560 KB ans=YES N=1922
21 Correct 11 ms 1792 KB ans=YES N=1989
22 Correct 12 ms 2048 KB ans=YES N=1978
23 Correct 13 ms 2048 KB ans=YES N=1867
24 Correct 380 ms 18296 KB ans=NO N=66151
25 Correct 888 ms 53316 KB ans=NO N=64333
26 Correct 447 ms 17648 KB ans=YES N=69316
27 Correct 420 ms 17140 KB ans=YES N=66695
28 Correct 468 ms 17688 KB ans=YES N=68436
29 Correct 441 ms 18164 KB ans=YES N=70000
30 Correct 439 ms 17648 KB ans=YES N=68501
31 Correct 483 ms 18336 KB ans=YES N=70000
32 Correct 508 ms 18676 KB ans=YES N=65009
33 Correct 782 ms 26408 KB ans=YES N=67007
34 Correct 769 ms 30576 KB ans=YES N=66357
35 Correct 842 ms 35844 KB ans=YES N=65430
36 Correct 813 ms 31836 KB ans=YES N=65790
37 Correct 761 ms 29844 KB ans=YES N=66020
38 Correct 713 ms 27824 KB ans=YES N=65809
39 Correct 567 ms 20208 KB ans=YES N=65651
40 Correct 953 ms 40080 KB ans=YES N=68040
41 Correct 838 ms 36984 KB ans=YES N=66570
42 Correct 470 ms 17652 KB ans=YES N=65421
43 Correct 501 ms 18500 KB ans=YES N=68351
44 Correct 428 ms 17012 KB ans=YES N=67027
45 Correct 616 ms 27000 KB ans=YES N=68879
46 Correct 537 ms 19952 KB ans=YES N=67256
47 Correct 1224 ms 37756 KB ans=YES N=148315
48 Correct 2275 ms 129244 KB ans=NO N=142745
49 Correct 2023 ms 152696 KB ans=NO N=148443
50 Correct 1184 ms 36332 KB ans=YES N=148328
51 Correct 1143 ms 36456 KB ans=YES N=147855
52 Correct 1147 ms 36836 KB ans=YES N=150000
53 Correct 1105 ms 35620 KB ans=YES N=144725
54 Correct 1175 ms 36600 KB ans=YES N=149445
55 Correct 1167 ms 35800 KB ans=YES N=144455
56 Correct 1113 ms 35720 KB ans=YES N=143487
57 Correct 1234 ms 37076 KB ans=YES N=149688
58 Correct 1927 ms 56424 KB ans=YES N=141481
59 Correct 2243 ms 91264 KB ans=YES N=147430
60 Correct 1493 ms 50408 KB ans=YES N=142247
61 Correct 1817 ms 58472 KB ans=YES N=149941
62 Correct 2052 ms 87032 KB ans=YES N=141635
63 Correct 1979 ms 70652 KB ans=YES N=142896
64 Correct 2122 ms 75816 KB ans=YES N=142069
65 Correct 1294 ms 41964 KB ans=YES N=142378
66 Correct 1707 ms 74660 KB ans=YES N=150000
67 Correct 2150 ms 104392 KB ans=YES N=141452
68 Correct 1881 ms 107716 KB ans=YES N=134453
69 Correct 1837 ms 114428 KB ans=YES N=144172