QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#304651#8004. Bit Componentucup-team112#AC ✓10ms4192kbC++2012.4kb2024-01-13 22:46:302024-01-13 22:46:32

Judging History

你现在查看的是最新测评结果

  • [2024-01-13 22:46:32]
  • 评测
  • 测评结果:AC
  • 用时:10ms
  • 内存:4192kb
  • [2024-01-13 22:46:30]
  • 提交

answer

// #pragma GCC target("avx2")
// #pragma GCC optimize("O3")
// #pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;

namespace templates {
// type
using ll  = long long;
using ull = unsigned long long;
using Pii = pair<int, int>;
using Pil = pair<int, ll>;
using Pli = pair<ll, int>;
using Pll = pair<ll, ll>;
template <class T>
using pq = priority_queue<T>;
template <class T>
using qp = priority_queue<T, vector<T>, greater<T>>;
// clang-format off
#define vec(T, A, ...) vector<T> A(__VA_ARGS__);
#define vvec(T, A, h, ...) vector<vector<T>> A(h, vector<T>(__VA_ARGS__));
#define vvvec(T, A, h1, h2, ...) vector<vector<vector<T>>> A(h1, vector<vector<T>>(h2, vector<T>(__VA_ARGS__)));
// clang-format on

// for loop
#define fori1(a) for (ll _ = 0; _ < (a); _++)
#define fori2(i, a) for (ll i = 0; i < (a); i++)
#define fori3(i, a, b) for (ll i = (a); i < (b); i++)
#define fori4(i, a, b, c) for (ll i = (a); ((c) > 0 || i > (b)) && ((c) < 0 || i < (b)); i += (c))
#define overload4(a, b, c, d, e, ...) e
#define fori(...) overload4(__VA_ARGS__, fori4, fori3, fori2, fori1)(__VA_ARGS__)

// declare and input
// clang-format off
#define INT(...) int __VA_ARGS__; inp(__VA_ARGS__);
#define LL(...) ll __VA_ARGS__; inp(__VA_ARGS__);
#define STRING(...) string __VA_ARGS__; inp(__VA_ARGS__);
#define CHAR(...) char __VA_ARGS__; inp(__VA_ARGS__);
#define DOUBLE(...) double __VA_ARGS__; STRING(str___); __VA_ARGS__ = stod(str___);
#define VEC(T, A, n) vector<T> A(n); inp(A);
#define VVEC(T, A, n, m) vector<vector<T>> A(n, vector<T>(m)); inp(A);
// clang-format on

// const value
const ll MOD1   = 1000000007;
const ll MOD9   = 998244353;
const double PI = acos(-1);

// other macro
#ifndef RIN__LOCAL
#define endl "\n"
#endif
#define spa ' '
#define len(A) ll(A.size())
#define all(A) begin(A), end(A)

// function
vector<char> stoc(string &S) {
    int n = S.size();
    vector<char> ret(n);
    for (int i = 0; i < n; i++) ret[i] = S[i];
    return ret;
}
string ctos(vector<char> &S) {
    int n      = S.size();
    string ret = "";
    for (int i = 0; i < n; i++) ret += S[i];
    return ret;
}

template <class T>
auto min(const T &a) {
    return *min_element(all(a));
}
template <class T>
auto max(const T &a) {
    return *max_element(all(a));
}
template <class T, class S>
auto clamp(T &a, const S &l, const S &r) {
    return (a > r ? r : a < l ? l : a);
}
template <class T, class S>
inline bool chmax(T &a, const S &b) {
    return (a < b ? a = b, 1 : 0);
}
template <class T, class S>
inline bool chmin(T &a, const S &b) {
    return (a > b ? a = b, 1 : 0);
}
template <class T, class S>
inline bool chclamp(T &a, const S &l, const S &r) {
    auto b = clamp(a, l, r);
    return (a != b ? a = b, 1 : 0);
}

template <typename T>
T sum(vector<T> &A) {
    T tot = 0;
    for (auto a : A) tot += a;
    return tot;
}

template <typename T>
vector<T> compression(vector<T> X) {
    sort(all(X));
    X.erase(unique(all(X)), X.end());
    return X;
}

// input and output
namespace io {

// vector<T>
template <typename T>
istream &operator>>(istream &is, vector<T> &A) {
    for (auto &a : A) is >> a;
    return is;
}
template <typename T>
ostream &operator<<(ostream &os, vector<T> &A) {
    for (size_t i = 0; i < A.size(); i++) {
        os << A[i];
        if (i != A.size() - 1) os << ' ';
    }
    return os;
}

// vector<vector<T>>
template <typename T>
istream &operator>>(istream &is, vector<vector<T>> &A) {
    for (auto &a : A) is >> a;
    return is;
}
template <typename T>
ostream &operator<<(ostream &os, vector<vector<T>> &A) {
    for (size_t i = 0; i < A.size(); i++) {
        os << A[i];
        if (i != A.size() - 1) os << endl;
    }
    return os;
}

// pair<S, T>
template <typename S, typename T>
istream &operator>>(istream &is, pair<S, T> &A) {
    is >> A.first >> A.second;
    return is;
}
template <typename S, typename T>
ostream &operator<<(ostream &os, pair<S, T> &A) {
    os << A.first << ' ' << A.second;
    return os;
}

// vector<pair<S, T>>
template <typename S, typename T>
istream &operator>>(istream &is, vector<pair<S, T>> &A) {
    for (size_t i = 0; i < A.size(); i++) {
        is >> A[i];
    }
    return is;
}
template <typename S, typename T>
ostream &operator<<(ostream &os, vector<pair<S, T>> &A) {
    for (size_t i = 0; i < A.size(); i++) {
        os << A[i];
        if (i != A.size() - 1) os << endl;
    }
    return os;
}

// tuple
template <typename T, size_t N>
struct TuplePrint {
    static ostream &print(ostream &os, const T &t) {
        TuplePrint<T, N - 1>::print(os, t);
        os << ' ' << get<N - 1>(t);
        return os;
    }
};
template <typename T>
struct TuplePrint<T, 1> {
    static ostream &print(ostream &os, const T &t) {
        os << get<0>(t);
        return os;
    }
};
template <typename... Args>
ostream &operator<<(ostream &os, const tuple<Args...> &t) {
    TuplePrint<decltype(t), sizeof...(Args)>::print(os, t);
    return os;
}

// io functions
void FLUSH() {
    cout << flush;
}

void print() {
    cout << endl;
}
template <class Head, class... Tail>
void print(Head &&head, Tail &&...tail) {
    cout << head;
    if (sizeof...(Tail)) cout << spa;
    print(std::forward<Tail>(tail)...);
}

template <typename T, typename S>
void prisep(vector<T> &A, S sep) {
    int n = A.size();
    for (int i = 0; i < n; i++) {
        cout << A[i];
        if (i != n - 1) cout << sep;
    }
    cout << endl;
}
template <typename T, typename S>
void priend(T A, S end) {
    cout << A << end;
}
template <typename T>
void prispa(T A) {
    priend(A, spa);
}
template <typename T, typename S>
bool printif(bool f, T A, S B) {
    if (f)
        print(A);
    else
        print(B);
    return f;
}

template <class... T>
void inp(T &...a) {
    (cin >> ... >> a);
}

} // namespace io
using namespace io;

// read graph
vector<vector<int>> read_edges(int n, int m, bool direct = false, int indexed = 1) {
    vector<vector<int>> edges(n, vector<int>());
    for (int i = 0; i < m; i++) {
        INT(u, v);
        u -= indexed;
        v -= indexed;
        edges[u].push_back(v);
        if (!direct) edges[v].push_back(u);
    }
    return edges;
}
vector<vector<int>> read_tree(int n, int indexed = 1) {
    return read_edges(n, n - 1, false, indexed);
}

template <typename T = long long>
vector<vector<pair<int, T>>> read_wedges(int n, int m, bool direct = false, int indexed = 1) {
    vector<vector<pair<int, T>>> edges(n, vector<pair<int, T>>());
    for (int i = 0; i < m; i++) {
        INT(u, v);
        T w;
        inp(w);
        u -= indexed;
        v -= indexed;
        edges[u].push_back({v, w});
        if (!direct) edges[v].push_back({u, w});
    }
    return edges;
}
template <typename T = long long>
vector<vector<pair<int, T>>> read_wtree(int n, int indexed = 1) {
    return read_wedges<T>(n, n - 1, false, indexed);
}

// yes / no
namespace yesno {

// yes
inline bool yes(bool f = true) {
    cout << (f ? "yes" : "no") << endl;
    return f;
}
inline bool Yes(bool f = true) {
    cout << (f ? "Yes" : "No") << endl;
    return f;
}
inline bool YES(bool f = true) {
    cout << (f ? "YES" : "NO") << endl;
    return f;
}

// no
inline bool no(bool f = true) {
    cout << (!f ? "yes" : "no") << endl;
    return f;
}
inline bool No(bool f = true) {
    cout << (!f ? "Yes" : "No") << endl;
    return f;
}
inline bool NO(bool f = true) {
    cout << (!f ? "YES" : "NO") << endl;
    return f;
}

// possible
inline bool possible(bool f = true) {
    cout << (f ? "possible" : "impossible") << endl;
    return f;
}
inline bool Possible(bool f = true) {
    cout << (f ? "Possible" : "Impossible") << endl;
    return f;
}
inline bool POSSIBLE(bool f = true) {
    cout << (f ? "POSSIBLE" : "IMPOSSIBLE") << endl;
    return f;
}

// impossible
inline bool impossible(bool f = true) {
    cout << (!f ? "possible" : "impossible") << endl;
    return f;
}
inline bool Impossible(bool f = true) {
    cout << (!f ? "Possible" : "Impossible") << endl;
    return f;
}
inline bool IMPOSSIBLE(bool f = true) {
    cout << (!f ? "POSSIBLE" : "IMPOSSIBLE") << endl;
    return f;
}

// Alice Bob
inline bool Alice(bool f = true) {
    cout << (f ? "Alice" : "Bob") << endl;
    return f;
}
inline bool Bob(bool f = true) {
    cout << (f ? "Bob" : "Alice") << endl;
    return f;
}

// Takahashi Aoki
inline bool Takahashi(bool f = true) {
    cout << (f ? "Takahashi" : "Aoki") << endl;
    return f;
}
inline bool Aoki(bool f = true) {
    cout << (f ? "Aoki" : "Takahashi") << endl;
    return f;
}

} // namespace yesno
using namespace yesno;

} // namespace templates
using namespace templates;

struct UnionFind {
    int n;
    std::vector<int> par;
    int group;

    UnionFind() = default;
    UnionFind(int n) : n(n) {
        par.assign(n, -1);
        group = n;
    }

    int find(int x) {
        if (par[x] < 0) return x;
        par[x] = find(par[x]);
        return par[x];
    }

    bool unite(int x, int y) {
        x = find(x);
        y = find(y);
        if (x == y) return false;
        if (par[x] > par[y]) std::swap(x, y);
        group--;
        par[x] += par[y];
        par[y] = x;
        return true;
    }

    bool same(int x, int y) {
        return find(x) == find(y);
    }

    int size(int x) {
        return -par[find(x)];
    }

    std::vector<int> roots() {
        std::vector<int> ret;
        for (int i = 0; i < n; i++) {
            if (i == find(i)) ret.push_back(i);
        }
        return ret;
    }

    bool isroot(int x) {
        return x == find(x);
    }
};

void solve() {
    LL(n);
    if (n <= 8) {
        if (n == 1) {
            YES();
            print(1);
            return;
        } else if (n == 3) {
            YES();
            print(2, 3, 1);
            return;
        } else if (n == 7) {
            YES();
            print(1, 3, 2, 6, 4, 5, 7);
            return;
        }
        NO();
        return;
    }
    int le = 0;
    while ((1 << le) <= n) le++;
    le--;
    assert(le >= 1);
    ll x = (1 << le) + (1 << (le - 1));
    x++;
    if (x > n) {
        NO();
        return;
    }
    vector<int> A = {1, 3, 2, 6, 4, 5, 7};
    int shift     = 8;
    fori(le - 3) {
        int le = len(A);
        fori(i, le) {
            A.push_back(A[i] + shift);
        }
        A.push_back(shift);
        le = len(A);
        swap(A[le - 3], A[le - 1]);
        swap(A[le - 2], A[le - 1]);
        shift <<= 1;
    }

    A.push_back(x);
    {
        int y      = 1 << (le - 1);
        int shift  = 1 << le;
        int shift2 = 1 << (le - 1);
        fori(i, y - 1) {
            A.push_back(shift + A[i]);
            int p = shift + shift2 + A[i];
            if (p <= n and p != x) A.push_back(p);
        }
        A.push_back(shift);
        if (shift + shift2 <= n) A.push_back(shift + shift2);
    }

    YES();
    print(A);

#ifdef RIN__LOCAL
    {
        assert(len(A) == n);
        vector<bool> used(n, false);
        int c = 0;

        vector<vector<int>> G(n, vector<int>(le + 1, 0));
        fori(i, n) {
            int a       = A[i];
            used[a - 1] = true;
            for (int j = le; j >= 0; j--) {
                cout << ((a >> j) & 1);
                G[i][j] = ((a >> j) & 1);
                c += G[i][j];
            }
            cout << endl;
        }
        fori(i, n) {
            assert(used[i]);
        }

        le++;
        UnionFind UF(n * le);
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < le; j++) {
                if (G[i][j] != 1) continue;
                if (i + 1 < n and G[i + 1][j] == 1) {
                    if (UF.unite(i * le + j, (i + 1) * le + j)) c--;
                }
                if (j + 1 < le and G[i][j + 1] == 1) {
                    if (UF.unite(i * le + j, i * le + j + 1)) c--;
                }
            }
        }
        print(G);
        print(c);
        assert(c == 1);
    }
#endif
}

int main() {
    cin.tie(0)->sync_with_stdio(0);
    // cout << fixed << setprecision(12);
    int t;
    t = 1;
    // cin >> t;
    while (t--) solve();
    return 0;
}

这程序好像有点Bug,我给组数据试试?

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3836kb

input:

1

output:

YES
1

result:

ok answer is 1

Test #2:

score: 0
Accepted
time: 0ms
memory: 3576kb

input:

2

output:

NO

result:

ok answer is 0

Test #3:

score: 0
Accepted
time: 0ms
memory: 3552kb

input:

3

output:

YES
2 3 1

result:

ok answer is 1

Test #4:

score: 0
Accepted
time: 0ms
memory: 3636kb

input:

4

output:

NO

result:

ok answer is 0

Test #5:

score: 0
Accepted
time: 0ms
memory: 3608kb

input:

5

output:

NO

result:

ok answer is 0

Test #6:

score: 0
Accepted
time: 0ms
memory: 3552kb

input:

6

output:

NO

result:

ok answer is 0

Test #7:

score: 0
Accepted
time: 0ms
memory: 3552kb

input:

7

output:

YES
1 3 2 6 4 5 7

result:

ok answer is 1

Test #8:

score: 0
Accepted
time: 0ms
memory: 3764kb

input:

8

output:

NO

result:

ok answer is 0

Test #9:

score: 0
Accepted
time: 0ms
memory: 3556kb

input:

9

output:

NO

result:

ok answer is 0

Test #10:

score: 0
Accepted
time: 0ms
memory: 3556kb

input:

10

output:

NO

result:

ok answer is 0

Test #11:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

11

output:

NO

result:

ok answer is 0

Test #12:

score: 0
Accepted
time: 0ms
memory: 3608kb

input:

12

output:

NO

result:

ok answer is 0

Test #13:

score: 0
Accepted
time: 0ms
memory: 3576kb

input:

13

output:

YES
1 3 2 6 4 5 7 13 9 11 10 8 12

result:

ok answer is 1

Test #14:

score: 0
Accepted
time: 0ms
memory: 3548kb

input:

14

output:

YES
1 3 2 6 4 5 7 13 9 11 10 14 8 12

result:

ok answer is 1

Test #15:

score: 0
Accepted
time: 0ms
memory: 3636kb

input:

15

output:

YES
1 3 2 6 4 5 7 13 9 11 15 10 14 8 12

result:

ok answer is 1

Test #16:

score: 0
Accepted
time: 0ms
memory: 3556kb

input:

16

output:

NO

result:

ok answer is 0

Test #17:

score: 0
Accepted
time: 0ms
memory: 3552kb

input:

17

output:

NO

result:

ok answer is 0

Test #18:

score: 0
Accepted
time: 0ms
memory: 3548kb

input:

23

output:

NO

result:

ok answer is 0

Test #19:

score: 0
Accepted
time: 0ms
memory: 3560kb

input:

24

output:

NO

result:

ok answer is 0

Test #20:

score: 0
Accepted
time: 0ms
memory: 3544kb

input:

25

output:

YES
1 3 2 6 4 5 7 9 11 10 14 12 8 13 15 25 17 19 18 22 20 21 23 16 24

result:

ok answer is 1

Test #21:

score: 0
Accepted
time: 0ms
memory: 3580kb

input:

26

output:

YES
1 3 2 6 4 5 7 9 11 10 14 12 8 13 15 25 17 19 18 26 22 20 21 23 16 24

result:

ok answer is 1

Test #22:

score: 0
Accepted
time: 0ms
memory: 3560kb

input:

27

output:

YES
1 3 2 6 4 5 7 9 11 10 14 12 8 13 15 25 17 19 27 18 26 22 20 21 23 16 24

result:

ok answer is 1

Test #23:

score: 0
Accepted
time: 0ms
memory: 3788kb

input:

40

output:

NO

result:

ok answer is 0

Test #24:

score: 0
Accepted
time: 0ms
memory: 3588kb

input:

53

output:

YES
1 3 2 6 4 5 7 9 11 10 14 12 8 13 15 17 19 18 22 20 21 23 25 27 26 30 28 24 16 29 31 49 33 35 51 34 50 38 36 52 37 53 39 41 43 42 46 44 40 45 47 32 48

result:

ok answer is 1

Test #25:

score: 0
Accepted
time: 0ms
memory: 3640kb

input:

93

output:

NO

result:

ok answer is 0

Test #26:

score: 0
Accepted
time: 0ms
memory: 3544kb

input:

105

output:

YES
1 3 2 6 4 5 7 9 11 10 14 12 8 13 15 17 19 18 22 20 21 23 25 27 26 30 28 24 16 29 31 33 35 34 38 36 37 39 41 43 42 46 44 40 45 47 49 51 50 54 52 53 55 57 59 58 62 60 56 48 32 61 63 97 65 67 99 66 98 70 102 68 100 69 101 71 103 73 105 75 74 78 76 72 104 77 79 81 83 82 86 84 85 87 89 91 90 94 92 88...

result:

ok answer is 1

Test #27:

score: 0
Accepted
time: 0ms
memory: 3820kb

input:

132

output:

NO

result:

ok answer is 0

Test #28:

score: 0
Accepted
time: 0ms
memory: 3608kb

input:

221

output:

YES
1 3 2 6 4 5 7 9 11 10 14 12 8 13 15 17 19 18 22 20 21 23 25 27 26 30 28 24 16 29 31 33 35 34 38 36 37 39 41 43 42 46 44 40 45 47 49 51 50 54 52 53 55 57 59 58 62 60 56 48 32 61 63 65 67 66 70 68 69 71 73 75 74 78 76 72 77 79 81 83 82 86 84 85 87 89 91 90 94 92 88 80 93 95 97 99 98 102 100 101 10...

result:

ok answer is 1

Test #29:

score: 0
Accepted
time: 0ms
memory: 3760kb

input:

373

output:

NO

result:

ok answer is 0

Test #30:

score: 0
Accepted
time: 0ms
memory: 3616kb

input:

473

output:

YES
1 3 2 6 4 5 7 9 11 10 14 12 8 13 15 17 19 18 22 20 21 23 25 27 26 30 28 24 16 29 31 33 35 34 38 36 37 39 41 43 42 46 44 40 45 47 49 51 50 54 52 53 55 57 59 58 62 60 56 48 32 61 63 65 67 66 70 68 69 71 73 75 74 78 76 72 77 79 81 83 82 86 84 85 87 89 91 90 94 92 88 80 93 95 97 99 98 102 100 101 10...

result:

ok answer is 1

Test #31:

score: 0
Accepted
time: 0ms
memory: 3504kb

input:

513

output:

NO

result:

ok answer is 0

Test #32:

score: 0
Accepted
time: 0ms
memory: 3572kb

input:

934

output:

YES
1 3 2 6 4 5 7 9 11 10 14 12 8 13 15 17 19 18 22 20 21 23 25 27 26 30 28 24 16 29 31 33 35 34 38 36 37 39 41 43 42 46 44 40 45 47 49 51 50 54 52 53 55 57 59 58 62 60 56 48 32 61 63 65 67 66 70 68 69 71 73 75 74 78 76 72 77 79 81 83 82 86 84 85 87 89 91 90 94 92 88 80 93 95 97 99 98 102 100 101 10...

result:

ok answer is 1

Test #33:

score: 0
Accepted
time: 0ms
memory: 3624kb

input:

1356

output:

NO

result:

ok answer is 0

Test #34:

score: 0
Accepted
time: 0ms
memory: 3520kb

input:

1651

output:

YES
1 3 2 6 4 5 7 9 11 10 14 12 8 13 15 17 19 18 22 20 21 23 25 27 26 30 28 24 16 29 31 33 35 34 38 36 37 39 41 43 42 46 44 40 45 47 49 51 50 54 52 53 55 57 59 58 62 60 56 48 32 61 63 65 67 66 70 68 69 71 73 75 74 78 76 72 77 79 81 83 82 86 84 85 87 89 91 90 94 92 88 80 93 95 97 99 98 102 100 101 10...

result:

ok answer is 1

Test #35:

score: 0
Accepted
time: 0ms
memory: 3608kb

input:

2263

output:

NO

result:

ok answer is 0

Test #36:

score: 0
Accepted
time: 0ms
memory: 3604kb

input:

3330

output:

YES
1 3 2 6 4 5 7 9 11 10 14 12 8 13 15 17 19 18 22 20 21 23 25 27 26 30 28 24 16 29 31 33 35 34 38 36 37 39 41 43 42 46 44 40 45 47 49 51 50 54 52 53 55 57 59 58 62 60 56 48 32 61 63 65 67 66 70 68 69 71 73 75 74 78 76 72 77 79 81 83 82 86 84 85 87 89 91 90 94 92 88 80 93 95 97 99 98 102 100 101 10...

result:

ok answer is 1

Test #37:

score: 0
Accepted
time: 0ms
memory: 3600kb

input:

4375

output:

NO

result:

ok answer is 0

Test #38:

score: 0
Accepted
time: 1ms
memory: 3932kb

input:

7989

output:

YES
1 3 2 6 4 5 7 9 11 10 14 12 8 13 15 17 19 18 22 20 21 23 25 27 26 30 28 24 16 29 31 33 35 34 38 36 37 39 41 43 42 46 44 40 45 47 49 51 50 54 52 53 55 57 59 58 62 60 56 48 32 61 63 65 67 66 70 68 69 71 73 75 74 78 76 72 77 79 81 83 82 86 84 85 87 89 91 90 94 92 88 80 93 95 97 99 98 102 100 101 10...

result:

ok answer is 1

Test #39:

score: 0
Accepted
time: 0ms
memory: 3768kb

input:

10925

output:

NO

result:

ok answer is 0

Test #40:

score: 0
Accepted
time: 1ms
memory: 3692kb

input:

14097

output:

YES
1 3 2 6 4 5 7 9 11 10 14 12 8 13 15 17 19 18 22 20 21 23 25 27 26 30 28 24 16 29 31 33 35 34 38 36 37 39 41 43 42 46 44 40 45 47 49 51 50 54 52 53 55 57 59 58 62 60 56 48 32 61 63 65 67 66 70 68 69 71 73 75 74 78 76 72 77 79 81 83 82 86 84 85 87 89 91 90 94 92 88 80 93 95 97 99 98 102 100 101 10...

result:

ok answer is 1

Test #41:

score: 0
Accepted
time: 0ms
memory: 3552kb

input:

16893

output:

NO

result:

ok answer is 0

Test #42:

score: 0
Accepted
time: 2ms
memory: 3896kb

input:

28913

output:

YES
1 3 2 6 4 5 7 9 11 10 14 12 8 13 15 17 19 18 22 20 21 23 25 27 26 30 28 24 16 29 31 33 35 34 38 36 37 39 41 43 42 46 44 40 45 47 49 51 50 54 52 53 55 57 59 58 62 60 56 48 32 61 63 65 67 66 70 68 69 71 73 75 74 78 76 72 77 79 81 83 82 86 84 85 87 89 91 90 94 92 88 80 93 95 97 99 98 102 100 101 10...

result:

ok answer is 1

Test #43:

score: 0
Accepted
time: 0ms
memory: 3596kb

input:

40092

output:

NO

result:

ok answer is 0

Test #44:

score: 0
Accepted
time: 0ms
memory: 3688kb

input:

54980

output:

YES
1 3 2 6 4 5 7 9 11 10 14 12 8 13 15 17 19 18 22 20 21 23 25 27 26 30 28 24 16 29 31 33 35 34 38 36 37 39 41 43 42 46 44 40 45 47 49 51 50 54 52 53 55 57 59 58 62 60 56 48 32 61 63 65 67 66 70 68 69 71 73 75 74 78 76 72 77 79 81 83 82 86 84 85 87 89 91 90 94 92 88 80 93 95 97 99 98 102 100 101 10...

result:

ok answer is 1

Test #45:

score: 0
Accepted
time: 0ms
memory: 3544kb

input:

88104

output:

NO

result:

ok answer is 0

Test #46:

score: 0
Accepted
time: 5ms
memory: 3740kb

input:

106284

output:

YES
1 3 2 6 4 5 7 9 11 10 14 12 8 13 15 17 19 18 22 20 21 23 25 27 26 30 28 24 16 29 31 33 35 34 38 36 37 39 41 43 42 46 44 40 45 47 49 51 50 54 52 53 55 57 59 58 62 60 56 48 32 61 63 65 67 66 70 68 69 71 73 75 74 78 76 72 77 79 81 83 82 86 84 85 87 89 91 90 94 92 88 80 93 95 97 99 98 102 100 101 10...

result:

ok answer is 1

Test #47:

score: 0
Accepted
time: 0ms
memory: 3636kb

input:

152797

output:

NO

result:

ok answer is 0

Test #48:

score: 0
Accepted
time: 10ms
memory: 4192kb

input:

200000

output:

YES
1 3 2 6 4 5 7 9 11 10 14 12 8 13 15 17 19 18 22 20 21 23 25 27 26 30 28 24 16 29 31 33 35 34 38 36 37 39 41 43 42 46 44 40 45 47 49 51 50 54 52 53 55 57 59 58 62 60 56 48 32 61 63 65 67 66 70 68 69 71 73 75 74 78 76 72 77 79 81 83 82 86 84 85 87 89 91 90 94 92 88 80 93 95 97 99 98 102 100 101 10...

result:

ok answer is 1

Test #49:

score: 0
Accepted
time: 0ms
memory: 3820kb

input:

3073

output:

YES
1 3 2 6 4 5 7 9 11 10 14 12 8 13 15 17 19 18 22 20 21 23 25 27 26 30 28 24 16 29 31 33 35 34 38 36 37 39 41 43 42 46 44 40 45 47 49 51 50 54 52 53 55 57 59 58 62 60 56 48 32 61 63 65 67 66 70 68 69 71 73 75 74 78 76 72 77 79 81 83 82 86 84 85 87 89 91 90 94 92 88 80 93 95 97 99 98 102 100 101 10...

result:

ok answer is 1

Test #50:

score: 0
Accepted
time: 1ms
memory: 3672kb

input:

16383

output:

YES
1 3 2 6 4 5 7 9 11 10 14 12 8 13 15 17 19 18 22 20 21 23 25 27 26 30 28 24 16 29 31 33 35 34 38 36 37 39 41 43 42 46 44 40 45 47 49 51 50 54 52 53 55 57 59 58 62 60 56 48 32 61 63 65 67 66 70 68 69 71 73 75 74 78 76 72 77 79 81 83 82 86 84 85 87 89 91 90 94 92 88 80 93 95 97 99 98 102 100 101 10...

result:

ok answer is 1

Test #51:

score: 0
Accepted
time: 0ms
memory: 3760kb

input:

32767

output:

YES
1 3 2 6 4 5 7 9 11 10 14 12 8 13 15 17 19 18 22 20 21 23 25 27 26 30 28 24 16 29 31 33 35 34 38 36 37 39 41 43 42 46 44 40 45 47 49 51 50 54 52 53 55 57 59 58 62 60 56 48 32 61 63 65 67 66 70 68 69 71 73 75 74 78 76 72 77 79 81 83 82 86 84 85 87 89 91 90 94 92 88 80 93 95 97 99 98 102 100 101 10...

result:

ok answer is 1

Test #52:

score: 0
Accepted
time: 0ms
memory: 3556kb

input:

399

output:

YES
1 3 2 6 4 5 7 9 11 10 14 12 8 13 15 17 19 18 22 20 21 23 25 27 26 30 28 24 16 29 31 33 35 34 38 36 37 39 41 43 42 46 44 40 45 47 49 51 50 54 52 53 55 57 59 58 62 60 56 48 32 61 63 65 67 66 70 68 69 71 73 75 74 78 76 72 77 79 81 83 82 86 84 85 87 89 91 90 94 92 88 80 93 95 97 99 98 102 100 101 10...

result:

ok answer is 1

Test #53:

score: 0
Accepted
time: 0ms
memory: 3552kb

input:

5757

output:

NO

result:

ok answer is 0

Test #54:

score: 0
Accepted
time: 0ms
memory: 3540kb

input:

179

output:

NO

result:

ok answer is 0

Test #55:

score: 0
Accepted
time: 0ms
memory: 3508kb

input:

228

output:

YES
1 3 2 6 4 5 7 9 11 10 14 12 8 13 15 17 19 18 22 20 21 23 25 27 26 30 28 24 16 29 31 33 35 34 38 36 37 39 41 43 42 46 44 40 45 47 49 51 50 54 52 53 55 57 59 58 62 60 56 48 32 61 63 65 67 66 70 68 69 71 73 75 74 78 76 72 77 79 81 83 82 86 84 85 87 89 91 90 94 92 88 80 93 95 97 99 98 102 100 101 10...

result:

ok answer is 1

Extra Test:

score: 0
Extra Test Passed