Submission #563569

# Submission time Handle Problem Language Result Execution time Memory
563569 2022-05-17T14:46:12 Z balbit Building Skyscrapers (CEOI19_skyscrapers) C++14
100 / 100
3130 ms 214264 KB
#include <bits/stdc++.h>
//#define int ll
#pragma GCC optimize("O3", "unroll-loops")
using namespace std;
#define ll long long
#define y1 zck_is_king
#define pii pair<ll, ll>
#define ull unsigned ll
#define f first
#define s second
#define ALL(x) x.begin(),x.end()
#define SZ(x) (int)x.size()
#define SQ(x) (x)*(x)
#define MN(a,b) a = min(a,(__typeof__(a))(b))
#define MX(a,b) a = max(a,(__typeof__(a))(b))
#define pb push_back
#define REP(i,n) for (int i = 0; i<n; ++i)
#define RREP(i,n) for (int i = n-1; i>=0; --i)
#define REP1(i,n) for (int i = 1; i<=n; ++i)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#ifdef BALBIT
#define IOS()
#define bug(...) fprintf(stderr,"#%d (%s) = ",__LINE__,#__VA_ARGS__),_do(__VA_ARGS__);
template<typename T> void _do(T &&x){cerr<<x<<endl;}
template<typename T, typename ...S> void _do(T &&x, S &&...y){cerr<<x<<", ";_do(y...);}
#else
#define IOS() ios_base::sync_with_stdio(0);cin.tie(0);
#define endl '\n'
#define bug(...)
#endif

const int iinf = 1e9+10;
const ll inf = 0x3f3f3f3f3f3f3f3f;
const ll mod = 1e9+7 ;


void GG(){cout<<"0\n"; exit(0);}

ll mpow(ll a, ll n, ll mo = mod){ // a^n % mod
    ll re=1;
    while (n>0){
        if (n&1) re = re*a %mo;
        a = a*a %mo;
        n>>=1;
    }
    return re;
}

ll inv (ll b, ll mo = mod){
    if (b==1) return b;
    return (mo-mo/b) * inv(mo%b,mo) % mo;
}

const int maxn = 150000+5;

bool full[maxn*9]; // is the block at this index full
bool canout[maxn]; // can be connected to the outside!
int id[maxn*9];
int X[maxn*9], Y[maxn*9]; // coordinates of this
vector<int> adj[maxn*9];
vector<int> adj4[maxn*9];
// adj blocks in clockwise order starting from <0, 1>
int par[maxn*9];
vector<int> here[maxn*9];

//int NOWROUND=-1;
//int lasttouch[maxn*9];

const vector<pii> DIR = {{0,1}, {1,1}, {1,0}, {1, -1}, {0, -1}, {-1, -1}, {-1, 0}, {-1, 1}};
const vector<pii> D4 = {{0,1}, {1,0}, {0, -1}, {-1, 0}};

int find(int x) {return par[x] == x? x : par[x] = find(par[x]);}

void ASS(bool x) {
    if (!x) {
        cout<<"BRUH"<<endl; exit(0);
    }
}

int NOWOUT; // head of the outside

bool ISAP(int at) {
    static bool TMP[8];
    bug(at, full[at]);
    ASS(full[at]);
    int totfull = 0;
    vector<int>FND(4);
    REP(j, 8) {
        totfull += (TMP[j] = full[adj[at][j]]);
        if (j%2==0) {
            FND[j/2] = find(adj[at][j]);
        }
    }
    if (totfull > 1) {
        REP(i,4) {
            if (FND[i] == FND[(i+1)&3]) {
                if (TMP[i*2+1]) {
                    // found!
                    return 1;
                }
            }
        }
    }else return 0;
    // case 2: the equal zones wrap around
    if (FND[0] == FND[2]) {
        int r = TMP[1]+TMP[2]+TMP[3];
        if (r && r != totfull) return 1;
    }
    if (FND[1] == FND[3]) {
        int r = TMP[4]+TMP[5]+TMP[3];
        if (r && r != totfull) return 1;
    }
    return 0;
}

set<int>canrem;

bool inset[maxn*9];

bool markedtodo[maxn];
vector<int> todo;

inline void RUN(int x) {
    if (!canout[x] || !full[x]) return;
    bool shouldbein = !ISAP(x);
    if (inset[x] != shouldbein) {
        if (shouldbein) {
            canrem.insert(x);
            inset[x] = 1;
        }else{
            canrem.erase(x);
            inset[x] = 0;
        }
    }
}

inline void UPD(int x) {
    if (markedtodo[x] || !full[x]) return;
    markedtodo[x] = 1;
    todo.pb(x);
}

void GOGO(){
    for (int x : todo) {
        RUN(x); markedtodo[x] = 0;
    }
    todo.clear();
}

void markout(vector<int> &v) {
    for (int x : v) {
        for (int y : adj4[x]) {
            if (full[y] && !canout[y]) {
                canout[y] = 1;
                UPD(y);
            }
        }
    }
}


void mrg(int a, int b) {
    a = find(a); b = find(b);
    if (a == b) return;
    if (SZ(here[a]) > SZ(here[b])) swap(a,b);
    if (a == NOWOUT) swap(a,b);
    if (b == NOWOUT) {
        markout(here[a]);
    }
    par[a] = b;
    here[b].insert(here[b].end(), ALL(here[a]));
//    vector<int> todo;
    for (int x : here[a]) {
        for (int y : adj4[x]) {
            if (full[y]) {
                UPD(y);
            }
        }
    }
//    SORT_UNIQUE(todo);
//    for (int x : todo) {
//        UPD(x);
//    }
    vector<int> () .swap(here[a]);
}

void mrg1(int a, int b) {
    a = find(a); b = find(b);
    if (SZ(here[a]) > SZ(here[b])) swap(a,b);
    par[a] = b;
    here[b].insert(here[b].end(), ALL(here[a]));
    vector<int> () .swap(here[a]);
}

vector<int> ret;

void rem(int at) {
    bug("removing", at, full[at]);
    ASS(full[at]);
    // this shouldn't be an AP
    full[at] = 0;
    ret.pb(at);
    for (int i = 0; i<8; i+=2) {
        if (!full[adj[at][i]]) mrg(at, adj[at][i]);
    }
    bug(SZ(todo));
    for (int x : adj[at]) {
        if (full[x]) UPD(x);
    }
    GOGO();
}

signed main(){
    IOS();

    map<pii, int> mp;
    int n; cin>>n;
    int subt; cin>>subt;

    REP(i,n) {
        cin>>X[i]>>Y[i];
        mp[{X[i], Y[i]}] = i;
        full[i] = 1;
    }

    int IT = SZ(mp);



    REP(i, n*9) {
        par[i] = i;
    }
    REP(i,n) {
        here[i].pb(i);
    }

    REP(i,n) {

        for (auto pp : DIR) {
            int j = pp.f, k = pp.s;
            pii P = {X[i] + j, Y[i] + k};
            if (!mp.count(P)) {
                tie(X[IT], Y[IT]) = P;
                mp[P] = IT++;
            }
            adj[i].pb(mp[P]);
            if (abs(j) + abs(k) == 1) {
                adj4[i].pb(mp[P]);
            }
        }

        for (int x : adj[i]) {
            if (full[x]) {
                mrg1(x, i);
            }
        }
    }

    REP(i,n) {
        if (find(i) != find(0)) {
            // death!
            cout<<"NO"<<endl;
            return 0;
        }
    }

    ASS(SZ(mp) == IT);

    REP(i,IT) {
        here[i] = {i};
        par[i] = i;
    }

    for (int i = n; i<IT; ++i) {
        for (auto pp : DIR) {
            int j = pp.f, k = pp.s;
            pii P = {X[i] + j, Y[i] + k};
            if (mp.count(P)) {
                adj[i].pb(mp[P]);
            }
        }
        for (auto pp : D4) {
            int j = pp.f, k = pp.s;
            pii P = {X[i] + j, Y[i] + k};
            if (mp.count(P)) {
                int to = mp[P];
                adj4[i].pb(to);
            }
        }
    }
    NOWOUT = mp.begin()->s;
    bug(X[NOWOUT], Y[NOWOUT]);
    ASS(!full[NOWOUT]);
    markout(here[NOWOUT]);

    for (int i = n; i<IT; ++i) {
        for (int to : adj4[i]) {
            if (!full[to]) {
                mrg(i, to);
            }
        }
    }

    GOGO();
//    for (int e : here[NOWOUT]) {
//        bug(e);
//    }
//    REP(i,IT) {
//        bug(i, X[i], Y[i], full[i]);
//        bug(find(i), canout[i]);
//    }

    REP(round, n) {
//        NOWROUND = round;
        #ifdef BALBIT
        bug(round);
        for (int x : canrem) cout<<x<<' ';
        cout<<endl;
        #endif // BALBIT
        if (SZ(canrem) == 0) {
            cout<<"DIE "<<round<<endl;
            return 0;
        }
        int e = *prev(canrem.end());
        canrem.erase(e);
        inset[e] = 0;
        rem(e);
    }

    cout<<"YES"<<endl;
    reverse(ALL(ret));
    for (int x : ret) cout<<x+1<<endl;

}
# Verdict Execution time Memory Grader output
1 Correct 43 ms 95436 KB ans=YES N=1
2 Correct 45 ms 95460 KB ans=YES N=4
3 Correct 43 ms 95440 KB ans=NO N=4
4 Correct 44 ms 95384 KB ans=YES N=5
5 Correct 43 ms 95364 KB ans=YES N=9
6 Correct 44 ms 95452 KB ans=YES N=5
7 Correct 43 ms 95448 KB ans=NO N=9
8 Correct 45 ms 95404 KB ans=NO N=10
9 Correct 46 ms 95440 KB ans=YES N=10
10 Correct 44 ms 95384 KB ans=YES N=10
11 Correct 45 ms 95552 KB ans=YES N=10
12 Correct 43 ms 95380 KB ans=YES N=9
13 Correct 44 ms 95436 KB ans=YES N=9
14 Correct 46 ms 95464 KB ans=YES N=8
15 Correct 44 ms 95452 KB ans=YES N=8
16 Correct 44 ms 95456 KB ans=NO N=2
# Verdict Execution time Memory Grader output
1 Correct 43 ms 95436 KB ans=YES N=1
2 Correct 45 ms 95460 KB ans=YES N=4
3 Correct 43 ms 95440 KB ans=NO N=4
4 Correct 44 ms 95384 KB ans=YES N=5
5 Correct 43 ms 95364 KB ans=YES N=9
6 Correct 44 ms 95452 KB ans=YES N=5
7 Correct 43 ms 95448 KB ans=NO N=9
8 Correct 45 ms 95404 KB ans=NO N=10
9 Correct 46 ms 95440 KB ans=YES N=10
10 Correct 44 ms 95384 KB ans=YES N=10
11 Correct 45 ms 95552 KB ans=YES N=10
12 Correct 43 ms 95380 KB ans=YES N=9
13 Correct 44 ms 95436 KB ans=YES N=9
14 Correct 46 ms 95464 KB ans=YES N=8
15 Correct 44 ms 95452 KB ans=YES N=8
16 Correct 44 ms 95456 KB ans=NO N=2
17 Correct 43 ms 95456 KB ans=YES N=17
18 Correct 44 ms 95444 KB ans=YES N=25
19 Correct 44 ms 95376 KB ans=YES N=100
20 Correct 46 ms 95532 KB ans=YES N=185
21 Correct 45 ms 95564 KB ans=NO N=174
22 Correct 44 ms 95460 KB ans=YES N=90
23 Correct 45 ms 95504 KB ans=YES N=63
24 Correct 45 ms 95452 KB ans=YES N=87
25 Correct 45 ms 95444 KB ans=YES N=183
26 Correct 47 ms 95532 KB ans=YES N=188
27 Correct 47 ms 95456 KB ans=YES N=183
28 Correct 45 ms 95440 KB ans=YES N=189
29 Correct 47 ms 95436 KB ans=YES N=200
30 Correct 50 ms 95536 KB ans=YES N=190
31 Correct 44 ms 95436 KB ans=YES N=187
32 Correct 45 ms 95456 KB ans=YES N=187
33 Correct 45 ms 95480 KB ans=YES N=182
34 Correct 46 ms 95544 KB ans=YES N=184
35 Correct 44 ms 95484 KB ans=YES N=188
36 Correct 46 ms 95560 KB ans=YES N=181
37 Correct 45 ms 95580 KB ans=YES N=188
38 Correct 46 ms 95616 KB ans=YES N=191
39 Correct 50 ms 95556 KB ans=YES N=196
40 Correct 45 ms 95500 KB ans=YES N=196
41 Correct 45 ms 95464 KB ans=YES N=196
42 Correct 44 ms 95556 KB ans=YES N=196
43 Correct 49 ms 95592 KB ans=YES N=195
# Verdict Execution time Memory Grader output
1 Correct 43 ms 95436 KB ans=YES N=1
2 Correct 45 ms 95460 KB ans=YES N=4
3 Correct 43 ms 95440 KB ans=NO N=4
4 Correct 44 ms 95384 KB ans=YES N=5
5 Correct 43 ms 95364 KB ans=YES N=9
6 Correct 44 ms 95452 KB ans=YES N=5
7 Correct 43 ms 95448 KB ans=NO N=9
8 Correct 45 ms 95404 KB ans=NO N=10
9 Correct 46 ms 95440 KB ans=YES N=10
10 Correct 44 ms 95384 KB ans=YES N=10
11 Correct 45 ms 95552 KB ans=YES N=10
12 Correct 43 ms 95380 KB ans=YES N=9
13 Correct 44 ms 95436 KB ans=YES N=9
14 Correct 46 ms 95464 KB ans=YES N=8
15 Correct 44 ms 95452 KB ans=YES N=8
16 Correct 44 ms 95456 KB ans=NO N=2
17 Correct 43 ms 95456 KB ans=YES N=17
18 Correct 44 ms 95444 KB ans=YES N=25
19 Correct 44 ms 95376 KB ans=YES N=100
20 Correct 46 ms 95532 KB ans=YES N=185
21 Correct 45 ms 95564 KB ans=NO N=174
22 Correct 44 ms 95460 KB ans=YES N=90
23 Correct 45 ms 95504 KB ans=YES N=63
24 Correct 45 ms 95452 KB ans=YES N=87
25 Correct 45 ms 95444 KB ans=YES N=183
26 Correct 47 ms 95532 KB ans=YES N=188
27 Correct 47 ms 95456 KB ans=YES N=183
28 Correct 45 ms 95440 KB ans=YES N=189
29 Correct 47 ms 95436 KB ans=YES N=200
30 Correct 50 ms 95536 KB ans=YES N=190
31 Correct 44 ms 95436 KB ans=YES N=187
32 Correct 45 ms 95456 KB ans=YES N=187
33 Correct 45 ms 95480 KB ans=YES N=182
34 Correct 46 ms 95544 KB ans=YES N=184
35 Correct 44 ms 95484 KB ans=YES N=188
36 Correct 46 ms 95560 KB ans=YES N=181
37 Correct 45 ms 95580 KB ans=YES N=188
38 Correct 46 ms 95616 KB ans=YES N=191
39 Correct 50 ms 95556 KB ans=YES N=196
40 Correct 45 ms 95500 KB ans=YES N=196
41 Correct 45 ms 95464 KB ans=YES N=196
42 Correct 44 ms 95556 KB ans=YES N=196
43 Correct 49 ms 95592 KB ans=YES N=195
44 Correct 54 ms 97008 KB ans=NO N=1934
45 Correct 50 ms 96024 KB ans=NO N=1965
46 Correct 51 ms 96024 KB ans=YES N=1824
47 Correct 52 ms 95944 KB ans=YES N=1981
48 Correct 49 ms 95976 KB ans=YES N=1814
49 Correct 53 ms 96116 KB ans=YES N=1854
50 Correct 52 ms 96016 KB ans=YES N=1831
51 Correct 54 ms 96096 KB ans=YES N=2000
52 Correct 54 ms 96196 KB ans=YES N=1847
53 Correct 55 ms 96340 KB ans=YES N=1819
54 Correct 56 ms 96048 KB ans=YES N=1986
55 Correct 66 ms 96556 KB ans=YES N=2000
56 Correct 64 ms 96696 KB ans=YES N=1834
57 Correct 61 ms 96588 KB ans=YES N=1860
58 Correct 64 ms 96716 KB ans=YES N=1898
59 Correct 59 ms 96420 KB ans=YES N=1832
60 Correct 66 ms 97032 KB ans=YES N=1929
61 Correct 60 ms 96068 KB ans=YES N=1919
62 Correct 66 ms 96476 KB ans=YES N=1882
63 Correct 67 ms 97024 KB ans=YES N=1922
64 Correct 54 ms 96284 KB ans=YES N=1989
65 Correct 62 ms 96492 KB ans=YES N=1978
66 Correct 58 ms 96540 KB ans=YES N=1867
67 Correct 62 ms 96468 KB ans=YES N=1942
# Verdict Execution time Memory Grader output
1 Correct 53 ms 96904 KB ans=NO N=1934
2 Correct 53 ms 96076 KB ans=NO N=1965
3 Correct 50 ms 95900 KB ans=YES N=1824
4 Correct 52 ms 96000 KB ans=YES N=1981
5 Correct 51 ms 95972 KB ans=YES N=1814
6 Correct 52 ms 96076 KB ans=YES N=1854
7 Correct 51 ms 96088 KB ans=YES N=1831
8 Correct 52 ms 95980 KB ans=YES N=2000
9 Correct 56 ms 96224 KB ans=YES N=1847
10 Correct 56 ms 96228 KB ans=YES N=1819
11 Correct 53 ms 96024 KB ans=YES N=1986
12 Correct 61 ms 96624 KB ans=YES N=2000
13 Correct 65 ms 96668 KB ans=YES N=1834
14 Correct 63 ms 96648 KB ans=YES N=1860
15 Correct 64 ms 96748 KB ans=YES N=1898
16 Correct 59 ms 96460 KB ans=YES N=1832
17 Correct 65 ms 96920 KB ans=YES N=1929
18 Correct 54 ms 96204 KB ans=YES N=1919
19 Correct 62 ms 96520 KB ans=YES N=1882
20 Correct 67 ms 97060 KB ans=YES N=1922
21 Correct 54 ms 96204 KB ans=YES N=1989
22 Correct 55 ms 96496 KB ans=YES N=1978
23 Correct 57 ms 96484 KB ans=YES N=1867
# Verdict Execution time Memory Grader output
1 Correct 43 ms 95436 KB ans=YES N=1
2 Correct 45 ms 95460 KB ans=YES N=4
3 Correct 43 ms 95440 KB ans=NO N=4
4 Correct 44 ms 95384 KB ans=YES N=5
5 Correct 43 ms 95364 KB ans=YES N=9
6 Correct 44 ms 95452 KB ans=YES N=5
7 Correct 43 ms 95448 KB ans=NO N=9
8 Correct 45 ms 95404 KB ans=NO N=10
9 Correct 46 ms 95440 KB ans=YES N=10
10 Correct 44 ms 95384 KB ans=YES N=10
11 Correct 45 ms 95552 KB ans=YES N=10
12 Correct 43 ms 95380 KB ans=YES N=9
13 Correct 44 ms 95436 KB ans=YES N=9
14 Correct 46 ms 95464 KB ans=YES N=8
15 Correct 44 ms 95452 KB ans=YES N=8
16 Correct 44 ms 95456 KB ans=NO N=2
17 Correct 43 ms 95456 KB ans=YES N=17
18 Correct 44 ms 95444 KB ans=YES N=25
19 Correct 44 ms 95376 KB ans=YES N=100
20 Correct 46 ms 95532 KB ans=YES N=185
21 Correct 45 ms 95564 KB ans=NO N=174
22 Correct 44 ms 95460 KB ans=YES N=90
23 Correct 45 ms 95504 KB ans=YES N=63
24 Correct 45 ms 95452 KB ans=YES N=87
25 Correct 45 ms 95444 KB ans=YES N=183
26 Correct 47 ms 95532 KB ans=YES N=188
27 Correct 47 ms 95456 KB ans=YES N=183
28 Correct 45 ms 95440 KB ans=YES N=189
29 Correct 47 ms 95436 KB ans=YES N=200
30 Correct 50 ms 95536 KB ans=YES N=190
31 Correct 44 ms 95436 KB ans=YES N=187
32 Correct 45 ms 95456 KB ans=YES N=187
33 Correct 45 ms 95480 KB ans=YES N=182
34 Correct 46 ms 95544 KB ans=YES N=184
35 Correct 44 ms 95484 KB ans=YES N=188
36 Correct 46 ms 95560 KB ans=YES N=181
37 Correct 45 ms 95580 KB ans=YES N=188
38 Correct 46 ms 95616 KB ans=YES N=191
39 Correct 50 ms 95556 KB ans=YES N=196
40 Correct 45 ms 95500 KB ans=YES N=196
41 Correct 45 ms 95464 KB ans=YES N=196
42 Correct 44 ms 95556 KB ans=YES N=196
43 Correct 49 ms 95592 KB ans=YES N=195
44 Correct 54 ms 97008 KB ans=NO N=1934
45 Correct 50 ms 96024 KB ans=NO N=1965
46 Correct 51 ms 96024 KB ans=YES N=1824
47 Correct 52 ms 95944 KB ans=YES N=1981
48 Correct 49 ms 95976 KB ans=YES N=1814
49 Correct 53 ms 96116 KB ans=YES N=1854
50 Correct 52 ms 96016 KB ans=YES N=1831
51 Correct 54 ms 96096 KB ans=YES N=2000
52 Correct 54 ms 96196 KB ans=YES N=1847
53 Correct 55 ms 96340 KB ans=YES N=1819
54 Correct 56 ms 96048 KB ans=YES N=1986
55 Correct 66 ms 96556 KB ans=YES N=2000
56 Correct 64 ms 96696 KB ans=YES N=1834
57 Correct 61 ms 96588 KB ans=YES N=1860
58 Correct 64 ms 96716 KB ans=YES N=1898
59 Correct 59 ms 96420 KB ans=YES N=1832
60 Correct 66 ms 97032 KB ans=YES N=1929
61 Correct 60 ms 96068 KB ans=YES N=1919
62 Correct 66 ms 96476 KB ans=YES N=1882
63 Correct 67 ms 97024 KB ans=YES N=1922
64 Correct 54 ms 96284 KB ans=YES N=1989
65 Correct 62 ms 96492 KB ans=YES N=1978
66 Correct 58 ms 96540 KB ans=YES N=1867
67 Correct 62 ms 96468 KB ans=YES N=1942
68 Correct 346 ms 110880 KB ans=NO N=66151
69 Correct 461 ms 136232 KB ans=NO N=64333
70 Correct 431 ms 113128 KB ans=YES N=69316
71 Correct 441 ms 112136 KB ans=YES N=66695
72 Correct 426 ms 113232 KB ans=YES N=68436
73 Correct 437 ms 113572 KB ans=YES N=70000
74 Correct 439 ms 113656 KB ans=YES N=68501
75 Correct 514 ms 114424 KB ans=YES N=70000
76 Correct 494 ms 115648 KB ans=YES N=65009
77 Correct 839 ms 128820 KB ans=YES N=67007
78 Correct 977 ms 134220 KB ans=YES N=66357
79 Correct 1069 ms 138448 KB ans=YES N=65430
80 Correct 1027 ms 136872 KB ans=YES N=65790
81 Correct 995 ms 134016 KB ans=YES N=66020
82 Correct 895 ms 130892 KB ans=YES N=65809
83 Correct 592 ms 119060 KB ans=YES N=65651
84 Correct 1310 ms 149364 KB ans=YES N=68040
85 Correct 1152 ms 142840 KB ans=YES N=66570
86 Correct 452 ms 114236 KB ans=YES N=65421
87 Correct 513 ms 116484 KB ans=YES N=68351
88 Correct 386 ms 112108 KB ans=YES N=67027
89 Correct 697 ms 125848 KB ans=YES N=68879
90 Correct 520 ms 117044 KB ans=YES N=67256
91 Correct 1124 ms 134828 KB ans=YES N=148315
92 Correct 1150 ms 194996 KB ans=NO N=142745
93 Correct 936 ms 212668 KB ans=NO N=148443
94 Correct 1041 ms 133060 KB ans=YES N=148328
95 Correct 1040 ms 133004 KB ans=YES N=147855
96 Correct 1056 ms 133504 KB ans=YES N=150000
97 Correct 1006 ms 132376 KB ans=YES N=144725
98 Correct 1065 ms 133128 KB ans=YES N=149445
99 Correct 1081 ms 132616 KB ans=YES N=144455
100 Correct 1044 ms 132144 KB ans=YES N=143487
101 Correct 1147 ms 133968 KB ans=YES N=149688
102 Correct 2207 ms 168680 KB ans=YES N=141481
103 Correct 2991 ms 200952 KB ans=YES N=147430
104 Correct 1734 ms 152212 KB ans=YES N=142247
105 Correct 2070 ms 165020 KB ans=YES N=149941
106 Correct 2720 ms 194388 KB ans=YES N=141635
107 Correct 2700 ms 185500 KB ans=YES N=142896
108 Correct 2886 ms 196732 KB ans=YES N=142069
109 Correct 1447 ms 140304 KB ans=YES N=142378
110 Correct 2109 ms 175168 KB ans=YES N=150000
111 Correct 3068 ms 212040 KB ans=YES N=141452
112 Correct 2793 ms 206368 KB ans=YES N=134453
113 Correct 2648 ms 211588 KB ans=YES N=144172
# Verdict Execution time Memory Grader output
1 Correct 351 ms 110932 KB ans=NO N=66151
2 Correct 488 ms 136336 KB ans=NO N=64333
3 Correct 428 ms 113044 KB ans=YES N=69316
4 Correct 406 ms 112132 KB ans=YES N=66695
5 Correct 431 ms 113256 KB ans=YES N=68436
6 Correct 439 ms 113708 KB ans=YES N=70000
7 Correct 445 ms 113500 KB ans=YES N=68501
8 Correct 468 ms 114444 KB ans=YES N=70000
9 Correct 502 ms 115680 KB ans=YES N=65009
10 Correct 852 ms 128792 KB ans=YES N=67007
11 Correct 1020 ms 134320 KB ans=YES N=66357
12 Correct 1362 ms 138504 KB ans=YES N=65430
13 Correct 1374 ms 136788 KB ans=YES N=65790
14 Correct 1267 ms 133956 KB ans=YES N=66020
15 Correct 1202 ms 130892 KB ans=YES N=65809
16 Correct 822 ms 118920 KB ans=YES N=65651
17 Correct 1510 ms 149296 KB ans=YES N=68040
18 Correct 1215 ms 142924 KB ans=YES N=66570
19 Correct 469 ms 114212 KB ans=YES N=65421
20 Correct 529 ms 116448 KB ans=YES N=68351
21 Correct 415 ms 112024 KB ans=YES N=67027
22 Correct 710 ms 125996 KB ans=YES N=68879
23 Correct 559 ms 117040 KB ans=YES N=67256
# Verdict Execution time Memory Grader output
1 Correct 53 ms 96904 KB ans=NO N=1934
2 Correct 53 ms 96076 KB ans=NO N=1965
3 Correct 50 ms 95900 KB ans=YES N=1824
4 Correct 52 ms 96000 KB ans=YES N=1981
5 Correct 51 ms 95972 KB ans=YES N=1814
6 Correct 52 ms 96076 KB ans=YES N=1854
7 Correct 51 ms 96088 KB ans=YES N=1831
8 Correct 52 ms 95980 KB ans=YES N=2000
9 Correct 56 ms 96224 KB ans=YES N=1847
10 Correct 56 ms 96228 KB ans=YES N=1819
11 Correct 53 ms 96024 KB ans=YES N=1986
12 Correct 61 ms 96624 KB ans=YES N=2000
13 Correct 65 ms 96668 KB ans=YES N=1834
14 Correct 63 ms 96648 KB ans=YES N=1860
15 Correct 64 ms 96748 KB ans=YES N=1898
16 Correct 59 ms 96460 KB ans=YES N=1832
17 Correct 65 ms 96920 KB ans=YES N=1929
18 Correct 54 ms 96204 KB ans=YES N=1919
19 Correct 62 ms 96520 KB ans=YES N=1882
20 Correct 67 ms 97060 KB ans=YES N=1922
21 Correct 54 ms 96204 KB ans=YES N=1989
22 Correct 55 ms 96496 KB ans=YES N=1978
23 Correct 57 ms 96484 KB ans=YES N=1867
24 Correct 351 ms 110932 KB ans=NO N=66151
25 Correct 488 ms 136336 KB ans=NO N=64333
26 Correct 428 ms 113044 KB ans=YES N=69316
27 Correct 406 ms 112132 KB ans=YES N=66695
28 Correct 431 ms 113256 KB ans=YES N=68436
29 Correct 439 ms 113708 KB ans=YES N=70000
30 Correct 445 ms 113500 KB ans=YES N=68501
31 Correct 468 ms 114444 KB ans=YES N=70000
32 Correct 502 ms 115680 KB ans=YES N=65009
33 Correct 852 ms 128792 KB ans=YES N=67007
34 Correct 1020 ms 134320 KB ans=YES N=66357
35 Correct 1362 ms 138504 KB ans=YES N=65430
36 Correct 1374 ms 136788 KB ans=YES N=65790
37 Correct 1267 ms 133956 KB ans=YES N=66020
38 Correct 1202 ms 130892 KB ans=YES N=65809
39 Correct 822 ms 118920 KB ans=YES N=65651
40 Correct 1510 ms 149296 KB ans=YES N=68040
41 Correct 1215 ms 142924 KB ans=YES N=66570
42 Correct 469 ms 114212 KB ans=YES N=65421
43 Correct 529 ms 116448 KB ans=YES N=68351
44 Correct 415 ms 112024 KB ans=YES N=67027
45 Correct 710 ms 125996 KB ans=YES N=68879
46 Correct 559 ms 117040 KB ans=YES N=67256
47 Correct 1163 ms 134888 KB ans=YES N=148315
48 Correct 1152 ms 195064 KB ans=NO N=142745
49 Correct 959 ms 214264 KB ans=NO N=148443
50 Correct 1086 ms 134268 KB ans=YES N=148328
51 Correct 1077 ms 134644 KB ans=YES N=147855
52 Correct 1054 ms 135048 KB ans=YES N=150000
53 Correct 1028 ms 133568 KB ans=YES N=144725
54 Correct 1066 ms 134824 KB ans=YES N=149445
55 Correct 1035 ms 134172 KB ans=YES N=144455
56 Correct 1047 ms 133976 KB ans=YES N=143487
57 Correct 1098 ms 135620 KB ans=YES N=149688
58 Correct 2144 ms 170196 KB ans=YES N=141481
59 Correct 2924 ms 202364 KB ans=YES N=147430
60 Correct 1674 ms 153868 KB ans=YES N=142247
61 Correct 2067 ms 166740 KB ans=YES N=149941
62 Correct 2709 ms 196100 KB ans=YES N=141635
63 Correct 2564 ms 187096 KB ans=YES N=142896
64 Correct 2851 ms 197992 KB ans=YES N=142069
65 Correct 1360 ms 141132 KB ans=YES N=142378
66 Correct 2131 ms 176516 KB ans=YES N=150000
67 Correct 3130 ms 213208 KB ans=YES N=141452
68 Correct 2807 ms 207596 KB ans=YES N=134453
69 Correct 2596 ms 212980 KB ans=YES N=144172