Submission #566157

# Submission time Handle Problem Language Result Execution time Memory
566157 2022-05-21T23:01:19 Z shrimb Building Skyscrapers (CEOI19_skyscrapers) C++17
100 / 100
2576 ms 320740 KB
// #pragma GCC optimize ("Ofast")
// #pragma GCC target ("avx,avx2,fma")

#include"bits/stdc++.h"
using namespace std;

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

template<class x>
using ordered_set = tree<x, null_type,less<x>, rb_tree_tag,tree_order_statistics_node_update>;

#define int long long
#define endl '\n'
#define mod 1000000007
//\
#define mod 1686876991

const int maxn = 150001;
const int dx[] = {1, 1, 0, -1, -1, -1,  0,  1};
const int dy[] = {0, 1, 1,  1,  0, -1, -1, -1};
const int inv[] = {4, 5, 6, 7, 0, 1, 2, 3};
struct cell;

int n, t, ID;
cell* Find (cell *x);
void check (cell *c);
void Union (cell *a, cell *b);
bitset<maxn> deleted;

map<pair<int,int>, cell*> cells;

struct cell {
    bool full = 0, out = 0;
    int x, y, ind;
    cell* adj[8], *parent = this, *prev = nullptr;
    vector<cell*> vec;
    cell(int a, int b, bool f) {
        // cerr << endl << a <<  " " << b << endl;
        full = f;
        x = a, y = b;
        cells[{x, y}] = this;
        if (f == 0) vec = {this};
        else ind = ID;
        for (int d = 0 ; d < 8 ; d++) {
            int u = x + dx[d];
            int v = y + dy[d];
            auto it = cells.find({u, v});
            if (it != cells.end()) {
                adj[d] = it -> second;
                it -> second -> adj[inv[d]] = this;
            }
            else  adj[d] = nullptr;
        }
        if (f == 0) {
            for (int d = 0 ; d < 8 ; d += 2) {
                if (adj[d]) {
                    if (!adj[d] -> full) Union(this, adj[d]);
                }
            }
            for (int d = 0 ; d < 8 ; d++) {
                if (adj[d] and adj[d] -> full) check(adj[d]);
            }
        }
    }
};
cell* inp[maxn];

struct cmp {
    bool operator () (cell *a, cell *b) const {
        return a -> ind > b -> ind;
    }
};

set<cell*,cmp> expendable;


cell* Find (cell *x) {
    return x == x -> parent ? x : x -> parent = Find(x -> parent);
}

void check (cell *c) {
    bool articulation = 0, isout = 0, sep = 0;
    // cerr << c -> ind << " " << articulation <<  endl;
    for (int i = 0 ; i < 8 ; i++) if (!c -> adj[i]) return;
    for (int i = 0 ; i < 8 ; i+=2) {
        if (!c -> adj[i] -> full) isout |= Find(c -> adj[i]) -> out;
    }
    if (!isout) {
        expendable.erase(c);
        return;
    }
    // cerr << c -> x << " " << c -> y << endl;
    for (int _d = 0 ; _d < 9 ; _d++) {
        int d = (_d == 8 ? 0 : _d);
        if (c -> adj[d] -> full) {
            sep = 1;
            continue;
        }
        if (d & 1) continue;
        auto cmp = Find(c -> adj[d]);
        // cerr << "kfdjasdd: " << d << " " << cmp -> out << " | ";
        if (cmp -> prev and sep == 1) {
            // cerr << cmp -> prev -> x << " " << cmp -> prev -> y << endl;
            bool bad = 0;
            for (int __d = _d ; !bad ; __d++) {
                int d2 = __d % 8;
                if (c -> adj[d2] == cmp -> prev) break;
                if (c -> adj[d2] -> full) bad = 1;
            }
            if (bad) {
                articulation = 1;
                break;
            }
        }
        // cerr << endl;
        cmp -> prev = c -> adj[d];
        sep = 0;
    }
    // cerr << articulation << endl;
    for (int d = 0 ; d < 8 ; d++) {
        if (!c -> adj[d] -> full) {
            Find(c -> adj[d]) -> prev = nullptr;
            // cerr << Find(c -> adj[d]) -> prev << endl;
        }
    }
    // cerr << c -> x << " " << c -> y << " " << isout << " ..." << articulation << endl;
    if (!articulation) expendable.insert(c);
    else expendable.erase(c);
}

void Union (cell *a, cell *b) {
    cell *x = Find(a), *y = Find(b);
    if (x == y) return;
    if (x -> vec.size() > y -> vec.size()) swap(x, y);
    x -> parent = y;
    y -> out |= x -> out;
    for (auto &i : x -> vec) {
        y -> vec.push_back(i);
        for (int d = 0 ; d < 8 ; d++) if (i -> adj[d] and i -> adj[d] -> full) check(i -> adj[d]);
    }
    x -> vec.clear();
}

signed main () {
    cin.tie(0)->sync_with_stdio(0);
    cin >> n >> t;
    for (int i = 0 ; i < n ; i++) {
        ID = i;
        int x, y;
        cin >> x >> y;
        inp[i] = new cell(x, y, 1);
    }
    int idx = 0;
    for (int i = 0 ; i < n ; i++) {
        if (inp[i] -> x < inp[idx] -> x) idx = i;
        else if (inp[i] -> x == inp[idx] -> x and inp[i] -> y < inp[idx] -> y) idx = i;
    }
    inp[idx] -> adj[4] = new cell(inp[idx] -> x + dx[4], inp[idx] -> y + dy[4], 0);
    inp[idx] -> adj[4] -> out = 1;
    // cerr << idx << endl;
    for (int i = 0 ; i < n ; i++) {
        // cerr << i << ": ";
        for (int d = 0 ; d < 8 ; d++) {
            // cerr << d << " ";
            if (!inp[i] -> adj[d]) {
                new cell(inp[i] -> x + dx[d], inp[i] -> y + dy[d], 0);
            }
        }
    }
    // assert(0);
    if (n > 1) {
        for (int i = 0 ; i < n ; i++) {
            bool good = 0;
            for (int d = 0 ; d < 8 ; d++) {
                if (inp[i] -> adj[d] -> full) good = 1;
            }
            if (!good) {
                cout << "NO\n";
                return 0;
            }
        }
    }

    // for (int i = 0 ; i < n ; i++) {
    //     for (auto j : inp[i] -> adj) {
    //         if (!j -> full)
    //         for (auto k : j -> adj) {
    //             if (k and !k -> full) Union(j, k);
    //         }
    //     }
    // }

    for (int i = 0 ; i < n ; i++) check(inp[i]);
    cout << "YES\n";
    vector<int> ans;
    // cerr << "alkjdaskldjaslkjlkadjlkasjdlkasj\n";
    while (expendable.size()) { 
        auto cur = *expendable.begin();
        expendable.erase(expendable.begin());
        ans.push_back(cur -> ind + 1);
        deleted[cur -> ind] = 1;
        new cell(cur -> x, cur -> y, 0);
    }
    reverse(ans.begin(), ans.end());
    for (int i:  ans) cout << i << endl;
}

/*
9
2
0 0 0 1
1 -1 2 -1
3 0 3 1
1 2 2 2
1 0
*/

Compilation message

skyscrapers.cpp:17:1: warning: multi-line comment [-Wcomment]
   17 | //\
      | ^
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB ans=YES N=1
2 Correct 0 ms 212 KB ans=YES N=4
3 Correct 0 ms 212 KB ans=NO N=4
4 Correct 0 ms 212 KB ans=YES N=5
5 Correct 0 ms 340 KB ans=YES N=9
6 Correct 0 ms 340 KB ans=YES N=5
7 Correct 1 ms 340 KB ans=NO N=9
8 Correct 1 ms 340 KB ans=NO N=10
9 Correct 0 ms 340 KB ans=YES N=10
10 Correct 0 ms 340 KB ans=YES N=10
11 Correct 0 ms 340 KB ans=YES N=10
12 Correct 0 ms 340 KB ans=YES N=9
13 Correct 0 ms 340 KB ans=YES N=9
14 Correct 0 ms 212 KB ans=YES N=8
15 Correct 0 ms 340 KB ans=YES N=8
16 Correct 0 ms 340 KB ans=NO N=2
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB ans=YES N=1
2 Correct 0 ms 212 KB ans=YES N=4
3 Correct 0 ms 212 KB ans=NO N=4
4 Correct 0 ms 212 KB ans=YES N=5
5 Correct 0 ms 340 KB ans=YES N=9
6 Correct 0 ms 340 KB ans=YES N=5
7 Correct 1 ms 340 KB ans=NO N=9
8 Correct 1 ms 340 KB ans=NO N=10
9 Correct 0 ms 340 KB ans=YES N=10
10 Correct 0 ms 340 KB ans=YES N=10
11 Correct 0 ms 340 KB ans=YES N=10
12 Correct 0 ms 340 KB ans=YES N=9
13 Correct 0 ms 340 KB ans=YES N=9
14 Correct 0 ms 212 KB ans=YES N=8
15 Correct 0 ms 340 KB ans=YES N=8
16 Correct 0 ms 340 KB ans=NO N=2
17 Correct 0 ms 340 KB ans=YES N=17
18 Correct 1 ms 340 KB ans=YES N=25
19 Correct 1 ms 340 KB ans=YES N=100
20 Correct 1 ms 340 KB ans=YES N=185
21 Correct 2 ms 596 KB ans=NO N=174
22 Correct 1 ms 340 KB ans=YES N=90
23 Correct 1 ms 340 KB ans=YES N=63
24 Correct 1 ms 340 KB ans=YES N=87
25 Correct 1 ms 340 KB ans=YES N=183
26 Correct 1 ms 340 KB ans=YES N=188
27 Correct 1 ms 340 KB ans=YES N=183
28 Correct 1 ms 340 KB ans=YES N=189
29 Correct 2 ms 340 KB ans=YES N=200
30 Correct 1 ms 468 KB ans=YES N=190
31 Correct 1 ms 340 KB ans=YES N=187
32 Correct 1 ms 468 KB ans=YES N=187
33 Correct 1 ms 468 KB ans=YES N=182
34 Correct 2 ms 468 KB ans=YES N=184
35 Correct 2 ms 468 KB ans=YES N=188
36 Correct 2 ms 468 KB ans=YES N=181
37 Correct 2 ms 468 KB ans=YES N=188
38 Correct 2 ms 468 KB ans=YES N=191
39 Correct 1 ms 468 KB ans=YES N=196
40 Correct 1 ms 468 KB ans=YES N=196
41 Correct 1 ms 468 KB ans=YES N=196
42 Correct 1 ms 468 KB ans=YES N=196
43 Correct 1 ms 468 KB ans=YES N=195
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB ans=YES N=1
2 Correct 0 ms 212 KB ans=YES N=4
3 Correct 0 ms 212 KB ans=NO N=4
4 Correct 0 ms 212 KB ans=YES N=5
5 Correct 0 ms 340 KB ans=YES N=9
6 Correct 0 ms 340 KB ans=YES N=5
7 Correct 1 ms 340 KB ans=NO N=9
8 Correct 1 ms 340 KB ans=NO N=10
9 Correct 0 ms 340 KB ans=YES N=10
10 Correct 0 ms 340 KB ans=YES N=10
11 Correct 0 ms 340 KB ans=YES N=10
12 Correct 0 ms 340 KB ans=YES N=9
13 Correct 0 ms 340 KB ans=YES N=9
14 Correct 0 ms 212 KB ans=YES N=8
15 Correct 0 ms 340 KB ans=YES N=8
16 Correct 0 ms 340 KB ans=NO N=2
17 Correct 0 ms 340 KB ans=YES N=17
18 Correct 1 ms 340 KB ans=YES N=25
19 Correct 1 ms 340 KB ans=YES N=100
20 Correct 1 ms 340 KB ans=YES N=185
21 Correct 2 ms 596 KB ans=NO N=174
22 Correct 1 ms 340 KB ans=YES N=90
23 Correct 1 ms 340 KB ans=YES N=63
24 Correct 1 ms 340 KB ans=YES N=87
25 Correct 1 ms 340 KB ans=YES N=183
26 Correct 1 ms 340 KB ans=YES N=188
27 Correct 1 ms 340 KB ans=YES N=183
28 Correct 1 ms 340 KB ans=YES N=189
29 Correct 2 ms 340 KB ans=YES N=200
30 Correct 1 ms 468 KB ans=YES N=190
31 Correct 1 ms 340 KB ans=YES N=187
32 Correct 1 ms 468 KB ans=YES N=187
33 Correct 1 ms 468 KB ans=YES N=182
34 Correct 2 ms 468 KB ans=YES N=184
35 Correct 2 ms 468 KB ans=YES N=188
36 Correct 2 ms 468 KB ans=YES N=181
37 Correct 2 ms 468 KB ans=YES N=188
38 Correct 2 ms 468 KB ans=YES N=191
39 Correct 1 ms 468 KB ans=YES N=196
40 Correct 1 ms 468 KB ans=YES N=196
41 Correct 1 ms 468 KB ans=YES N=196
42 Correct 1 ms 468 KB ans=YES N=196
43 Correct 1 ms 468 KB ans=YES N=195
44 Correct 16 ms 4388 KB ans=NO N=1934
45 Correct 9 ms 1748 KB ans=NO N=1965
46 Correct 7 ms 1108 KB ans=YES N=1824
47 Correct 8 ms 1180 KB ans=YES N=1981
48 Correct 8 ms 1108 KB ans=YES N=1814
49 Correct 9 ms 1364 KB ans=YES N=1854
50 Correct 9 ms 1108 KB ans=YES N=1831
51 Correct 9 ms 1228 KB ans=YES N=2000
52 Correct 11 ms 1364 KB ans=YES N=1847
53 Correct 11 ms 1492 KB ans=YES N=1819
54 Correct 8 ms 1236 KB ans=YES N=1986
55 Correct 14 ms 1948 KB ans=YES N=2000
56 Correct 16 ms 2112 KB ans=YES N=1834
57 Correct 14 ms 2132 KB ans=YES N=1860
58 Correct 16 ms 2260 KB ans=YES N=1898
59 Correct 13 ms 1836 KB ans=YES N=1832
60 Correct 16 ms 2644 KB ans=YES N=1929
61 Correct 11 ms 1368 KB ans=YES N=1919
62 Correct 14 ms 2000 KB ans=YES N=1882
63 Correct 17 ms 2764 KB ans=YES N=1922
64 Correct 9 ms 1492 KB ans=YES N=1989
65 Correct 11 ms 1904 KB ans=YES N=1978
66 Correct 11 ms 1992 KB ans=YES N=1867
67 Correct 14 ms 1876 KB ans=YES N=1942
# Verdict Execution time Memory Grader output
1 Correct 16 ms 4436 KB ans=NO N=1934
2 Correct 9 ms 1748 KB ans=NO N=1965
3 Correct 7 ms 1068 KB ans=YES N=1824
4 Correct 9 ms 1236 KB ans=YES N=1981
5 Correct 8 ms 1108 KB ans=YES N=1814
6 Correct 9 ms 1192 KB ans=YES N=1854
7 Correct 8 ms 1108 KB ans=YES N=1831
8 Correct 9 ms 1288 KB ans=YES N=2000
9 Correct 10 ms 1364 KB ans=YES N=1847
10 Correct 11 ms 1492 KB ans=YES N=1819
11 Correct 9 ms 1236 KB ans=YES N=1986
12 Correct 16 ms 2020 KB ans=YES N=2000
13 Correct 15 ms 2132 KB ans=YES N=1834
14 Correct 15 ms 2132 KB ans=YES N=1860
15 Correct 16 ms 2252 KB ans=YES N=1898
16 Correct 14 ms 1904 KB ans=YES N=1832
17 Correct 15 ms 2612 KB ans=YES N=1929
18 Correct 10 ms 1364 KB ans=YES N=1919
19 Correct 14 ms 2004 KB ans=YES N=1882
20 Correct 17 ms 2688 KB ans=YES N=1922
21 Correct 9 ms 1492 KB ans=YES N=1989
22 Correct 11 ms 1876 KB ans=YES N=1978
23 Correct 14 ms 1876 KB ans=YES N=1867
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB ans=YES N=1
2 Correct 0 ms 212 KB ans=YES N=4
3 Correct 0 ms 212 KB ans=NO N=4
4 Correct 0 ms 212 KB ans=YES N=5
5 Correct 0 ms 340 KB ans=YES N=9
6 Correct 0 ms 340 KB ans=YES N=5
7 Correct 1 ms 340 KB ans=NO N=9
8 Correct 1 ms 340 KB ans=NO N=10
9 Correct 0 ms 340 KB ans=YES N=10
10 Correct 0 ms 340 KB ans=YES N=10
11 Correct 0 ms 340 KB ans=YES N=10
12 Correct 0 ms 340 KB ans=YES N=9
13 Correct 0 ms 340 KB ans=YES N=9
14 Correct 0 ms 212 KB ans=YES N=8
15 Correct 0 ms 340 KB ans=YES N=8
16 Correct 0 ms 340 KB ans=NO N=2
17 Correct 0 ms 340 KB ans=YES N=17
18 Correct 1 ms 340 KB ans=YES N=25
19 Correct 1 ms 340 KB ans=YES N=100
20 Correct 1 ms 340 KB ans=YES N=185
21 Correct 2 ms 596 KB ans=NO N=174
22 Correct 1 ms 340 KB ans=YES N=90
23 Correct 1 ms 340 KB ans=YES N=63
24 Correct 1 ms 340 KB ans=YES N=87
25 Correct 1 ms 340 KB ans=YES N=183
26 Correct 1 ms 340 KB ans=YES N=188
27 Correct 1 ms 340 KB ans=YES N=183
28 Correct 1 ms 340 KB ans=YES N=189
29 Correct 2 ms 340 KB ans=YES N=200
30 Correct 1 ms 468 KB ans=YES N=190
31 Correct 1 ms 340 KB ans=YES N=187
32 Correct 1 ms 468 KB ans=YES N=187
33 Correct 1 ms 468 KB ans=YES N=182
34 Correct 2 ms 468 KB ans=YES N=184
35 Correct 2 ms 468 KB ans=YES N=188
36 Correct 2 ms 468 KB ans=YES N=181
37 Correct 2 ms 468 KB ans=YES N=188
38 Correct 2 ms 468 KB ans=YES N=191
39 Correct 1 ms 468 KB ans=YES N=196
40 Correct 1 ms 468 KB ans=YES N=196
41 Correct 1 ms 468 KB ans=YES N=196
42 Correct 1 ms 468 KB ans=YES N=196
43 Correct 1 ms 468 KB ans=YES N=195
44 Correct 16 ms 4388 KB ans=NO N=1934
45 Correct 9 ms 1748 KB ans=NO N=1965
46 Correct 7 ms 1108 KB ans=YES N=1824
47 Correct 8 ms 1180 KB ans=YES N=1981
48 Correct 8 ms 1108 KB ans=YES N=1814
49 Correct 9 ms 1364 KB ans=YES N=1854
50 Correct 9 ms 1108 KB ans=YES N=1831
51 Correct 9 ms 1228 KB ans=YES N=2000
52 Correct 11 ms 1364 KB ans=YES N=1847
53 Correct 11 ms 1492 KB ans=YES N=1819
54 Correct 8 ms 1236 KB ans=YES N=1986
55 Correct 14 ms 1948 KB ans=YES N=2000
56 Correct 16 ms 2112 KB ans=YES N=1834
57 Correct 14 ms 2132 KB ans=YES N=1860
58 Correct 16 ms 2260 KB ans=YES N=1898
59 Correct 13 ms 1836 KB ans=YES N=1832
60 Correct 16 ms 2644 KB ans=YES N=1929
61 Correct 11 ms 1368 KB ans=YES N=1919
62 Correct 14 ms 2000 KB ans=YES N=1882
63 Correct 17 ms 2764 KB ans=YES N=1922
64 Correct 9 ms 1492 KB ans=YES N=1989
65 Correct 11 ms 1904 KB ans=YES N=1978
66 Correct 11 ms 1992 KB ans=YES N=1867
67 Correct 14 ms 1876 KB ans=YES N=1942
68 Correct 233 ms 23576 KB ans=NO N=66151
69 Correct 882 ms 110996 KB ans=NO N=64333
70 Correct 462 ms 29264 KB ans=YES N=69316
71 Correct 419 ms 28672 KB ans=YES N=66695
72 Correct 438 ms 29632 KB ans=YES N=68436
73 Correct 476 ms 30556 KB ans=YES N=70000
74 Correct 479 ms 30144 KB ans=YES N=68501
75 Correct 490 ms 31576 KB ans=YES N=70000
76 Correct 516 ms 32596 KB ans=YES N=65009
77 Correct 818 ms 51440 KB ans=YES N=67007
78 Correct 987 ms 61748 KB ans=YES N=66357
79 Correct 1008 ms 68348 KB ans=YES N=65430
80 Correct 971 ms 65252 KB ans=YES N=65790
81 Correct 921 ms 60388 KB ans=YES N=66020
82 Correct 835 ms 54988 KB ans=YES N=65809
83 Correct 616 ms 38428 KB ans=YES N=65651
84 Correct 1117 ms 84256 KB ans=YES N=68040
85 Correct 1004 ms 75268 KB ans=YES N=66570
86 Correct 501 ms 30952 KB ans=YES N=65421
87 Correct 536 ms 34748 KB ans=YES N=68351
88 Correct 418 ms 28596 KB ans=YES N=67027
89 Correct 720 ms 48780 KB ans=YES N=68879
90 Correct 563 ms 34780 KB ans=YES N=67256
91 Correct 1215 ms 65596 KB ans=YES N=148315
92 Correct 2245 ms 271264 KB ans=NO N=142745
93 Correct 1706 ms 320740 KB ans=NO N=148443
94 Correct 1133 ms 64788 KB ans=YES N=148328
95 Correct 1172 ms 65080 KB ans=YES N=147855
96 Correct 1122 ms 65832 KB ans=YES N=150000
97 Correct 1066 ms 63264 KB ans=YES N=144725
98 Correct 1119 ms 65400 KB ans=YES N=149445
99 Correct 1113 ms 63980 KB ans=YES N=144455
100 Correct 1099 ms 63356 KB ans=YES N=143487
101 Correct 1142 ms 66296 KB ans=YES N=149688
102 Correct 2058 ms 113980 KB ans=YES N=141481
103 Correct 2554 ms 170924 KB ans=YES N=147430
104 Correct 1663 ms 90720 KB ans=YES N=142247
105 Correct 1986 ms 108888 KB ans=YES N=149941
106 Correct 2427 ms 160040 KB ans=YES N=141635
107 Correct 2383 ms 141820 KB ans=YES N=142896
108 Correct 2340 ms 156448 KB ans=YES N=142069
109 Correct 1348 ms 73804 KB ans=YES N=142378
110 Correct 2057 ms 131484 KB ans=YES N=150000
111 Correct 2524 ms 190652 KB ans=YES N=141452
112 Correct 2116 ms 183952 KB ans=YES N=134453
113 Correct 2289 ms 191652 KB ans=YES N=144172
# Verdict Execution time Memory Grader output
1 Correct 258 ms 23588 KB ans=NO N=66151
2 Correct 888 ms 111120 KB ans=NO N=64333
3 Correct 443 ms 29104 KB ans=YES N=69316
4 Correct 416 ms 28592 KB ans=YES N=66695
5 Correct 430 ms 29604 KB ans=YES N=68436
6 Correct 434 ms 30348 KB ans=YES N=70000
7 Correct 431 ms 30152 KB ans=YES N=68501
8 Correct 470 ms 31576 KB ans=YES N=70000
9 Correct 482 ms 32676 KB ans=YES N=65009
10 Correct 779 ms 51284 KB ans=YES N=67007
11 Correct 918 ms 61792 KB ans=YES N=66357
12 Correct 948 ms 68268 KB ans=YES N=65430
13 Correct 917 ms 65320 KB ans=YES N=65790
14 Correct 882 ms 60372 KB ans=YES N=66020
15 Correct 820 ms 54984 KB ans=YES N=65809
16 Correct 568 ms 38208 KB ans=YES N=65651
17 Correct 1031 ms 84368 KB ans=YES N=68040
18 Correct 986 ms 75088 KB ans=YES N=66570
19 Correct 452 ms 30968 KB ans=YES N=65421
20 Correct 527 ms 34708 KB ans=YES N=68351
21 Correct 392 ms 28472 KB ans=YES N=67027
22 Correct 698 ms 48676 KB ans=YES N=68879
23 Correct 511 ms 34744 KB ans=YES N=67256
# Verdict Execution time Memory Grader output
1 Correct 16 ms 4436 KB ans=NO N=1934
2 Correct 9 ms 1748 KB ans=NO N=1965
3 Correct 7 ms 1068 KB ans=YES N=1824
4 Correct 9 ms 1236 KB ans=YES N=1981
5 Correct 8 ms 1108 KB ans=YES N=1814
6 Correct 9 ms 1192 KB ans=YES N=1854
7 Correct 8 ms 1108 KB ans=YES N=1831
8 Correct 9 ms 1288 KB ans=YES N=2000
9 Correct 10 ms 1364 KB ans=YES N=1847
10 Correct 11 ms 1492 KB ans=YES N=1819
11 Correct 9 ms 1236 KB ans=YES N=1986
12 Correct 16 ms 2020 KB ans=YES N=2000
13 Correct 15 ms 2132 KB ans=YES N=1834
14 Correct 15 ms 2132 KB ans=YES N=1860
15 Correct 16 ms 2252 KB ans=YES N=1898
16 Correct 14 ms 1904 KB ans=YES N=1832
17 Correct 15 ms 2612 KB ans=YES N=1929
18 Correct 10 ms 1364 KB ans=YES N=1919
19 Correct 14 ms 2004 KB ans=YES N=1882
20 Correct 17 ms 2688 KB ans=YES N=1922
21 Correct 9 ms 1492 KB ans=YES N=1989
22 Correct 11 ms 1876 KB ans=YES N=1978
23 Correct 14 ms 1876 KB ans=YES N=1867
24 Correct 258 ms 23588 KB ans=NO N=66151
25 Correct 888 ms 111120 KB ans=NO N=64333
26 Correct 443 ms 29104 KB ans=YES N=69316
27 Correct 416 ms 28592 KB ans=YES N=66695
28 Correct 430 ms 29604 KB ans=YES N=68436
29 Correct 434 ms 30348 KB ans=YES N=70000
30 Correct 431 ms 30152 KB ans=YES N=68501
31 Correct 470 ms 31576 KB ans=YES N=70000
32 Correct 482 ms 32676 KB ans=YES N=65009
33 Correct 779 ms 51284 KB ans=YES N=67007
34 Correct 918 ms 61792 KB ans=YES N=66357
35 Correct 948 ms 68268 KB ans=YES N=65430
36 Correct 917 ms 65320 KB ans=YES N=65790
37 Correct 882 ms 60372 KB ans=YES N=66020
38 Correct 820 ms 54984 KB ans=YES N=65809
39 Correct 568 ms 38208 KB ans=YES N=65651
40 Correct 1031 ms 84368 KB ans=YES N=68040
41 Correct 986 ms 75088 KB ans=YES N=66570
42 Correct 452 ms 30968 KB ans=YES N=65421
43 Correct 527 ms 34708 KB ans=YES N=68351
44 Correct 392 ms 28472 KB ans=YES N=67027
45 Correct 698 ms 48676 KB ans=YES N=68879
46 Correct 511 ms 34744 KB ans=YES N=67256
47 Correct 1148 ms 65712 KB ans=YES N=148315
48 Correct 2216 ms 271280 KB ans=NO N=142745
49 Correct 1674 ms 320540 KB ans=NO N=148443
50 Correct 1080 ms 64756 KB ans=YES N=148328
51 Correct 1086 ms 65100 KB ans=YES N=147855
52 Correct 1117 ms 65708 KB ans=YES N=150000
53 Correct 1065 ms 63384 KB ans=YES N=144725
54 Correct 1071 ms 65424 KB ans=YES N=149445
55 Correct 1061 ms 64052 KB ans=YES N=144455
56 Correct 1034 ms 63200 KB ans=YES N=143487
57 Correct 1109 ms 66268 KB ans=YES N=149688
58 Correct 1918 ms 113932 KB ans=YES N=141481
59 Correct 2576 ms 170864 KB ans=YES N=147430
60 Correct 1592 ms 90712 KB ans=YES N=142247
61 Correct 1919 ms 108860 KB ans=YES N=149941
62 Correct 2404 ms 160044 KB ans=YES N=141635
63 Correct 2274 ms 141760 KB ans=YES N=142896
64 Correct 2283 ms 156496 KB ans=YES N=142069
65 Correct 1383 ms 73760 KB ans=YES N=142378
66 Correct 1942 ms 131452 KB ans=YES N=150000
67 Correct 2530 ms 190684 KB ans=YES N=141452
68 Correct 2102 ms 183968 KB ans=YES N=134453
69 Correct 2223 ms 191544 KB ans=YES N=144172