QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#304885 | #8004. Bit Component | ucup-team088# | AC ✓ | 10ms | 13440kb | C++17 | 8.2kb | 2024-01-14 05:09:34 | 2024-01-14 05:09:34 |
Judging History
answer
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<unordered_set>
#include<utility>
#include<cassert>
#include<complex>
#include<numeric>
#include<array>
#include<chrono>
using namespace std;
//#define int long long
typedef long long ll;
typedef unsigned long long ul;
typedef unsigned int ui;
//ll mod = 1;
constexpr ll mod = 998244353;
//constexpr ll mod = 1000000007;
const int mod17 = 1000000007;
const ll INF = (ll)mod17 * mod17;
typedef pair<int, int>P;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
#define all(v) (v).begin(),(v).end()
typedef pair<ll, ll> LP;
using ld = double;
typedef pair<ld, ld> LDP;
const ld eps = 1e-10;
const ld pi = acosl(-1.0);
template<typename T>
void chmin(T& a, T b) {
a = min(a, b);
}
template<typename T>
void chmax(T& a, T b) {
a = max(a, b);
}
template<typename T>
vector<T> vmerge(vector<T>& a, vector<T>& b) {
vector<T> res;
int ida = 0, idb = 0;
while (ida < a.size() || idb < b.size()) {
if (idb == b.size()) {
res.push_back(a[ida]); ida++;
}
else if (ida == a.size()) {
res.push_back(b[idb]); idb++;
}
else {
if (a[ida] < b[idb]) {
res.push_back(a[ida]); ida++;
}
else {
res.push_back(b[idb]); idb++;
}
}
}
return res;
}
template<typename T>
void cinarray(vector<T>& v) {
rep(i, v.size())cin >> v[i];
}
template<typename T>
void coutarray(vector<T>& v) {
rep(i, v.size()) {
if (i > 0)cout << " "; cout << v[i];
}
cout << "\n";
}
ll mod_pow(ll x, ll n, ll m = mod) {
if (n < 0) {
ll res = mod_pow(x, -n, m);
return mod_pow(res, m - 2, m);
}
if (abs(x) >= m)x %= m;
if (x < 0)x += m;
//if (x == 0)return 0;
ll res = 1;
while (n) {
if (n & 1)res = res * x % m;
x = x * x % m; n >>= 1;
}
return res;
}
//mod should be <2^31
struct modint {
int n;
modint() :n(0) { ; }
modint(ll m) {
if (m < 0 || mod <= m) {
m %= mod; if (m < 0)m += mod;
}
n = m;
}
operator int() { return n; }
};
bool operator==(modint a, modint b) { return a.n == b.n; }
bool operator<(modint a, modint b) { return a.n < b.n; }
modint operator+=(modint& a, modint b) { a.n += b.n; if (a.n >= mod)a.n -= (int)mod; return a; }
modint operator-=(modint& a, modint b) { a.n -= b.n; if (a.n < 0)a.n += (int)mod; return a; }
modint operator*=(modint& a, modint b) { a.n = ((ll)a.n * b.n) % mod; return a; }
modint operator+(modint a, modint b) { return a += b; }
modint operator-(modint a, modint b) { return a -= b; }
modint operator*(modint a, modint b) { return a *= b; }
modint operator^(modint a, ll n) {
if (n == 0)return modint(1);
modint res = (a * a) ^ (n / 2);
if (n % 2)res = res * a;
return res;
}
ll inv(ll a, ll p) {
return (a == 1 ? 1 : (1 - p * inv(p % a, a)) / a + p);
}
modint operator/(modint a, modint b) { return a * modint(inv(b, mod)); }
modint operator/=(modint& a, modint b) { a = a / b; return a; }
const int max_n = 1 << 20;
modint fact[max_n], factinv[max_n];
void init_f() {
fact[0] = modint(1);
for (int i = 0; i < max_n - 1; i++) {
fact[i + 1] = fact[i] * modint(i + 1);
}
factinv[max_n - 1] = modint(1) / fact[max_n - 1];
for (int i = max_n - 2; i >= 0; i--) {
factinv[i] = factinv[i + 1] * modint(i + 1);
}
}
modint comb(int a, int b) {
if (a < 0 || b < 0 || a < b)return 0;
return fact[a] * factinv[b] * factinv[a - b];
}
modint combP(int a, int b) {
if (a < 0 || b < 0 || a < b)return 0;
return fact[a] * factinv[a - b];
}
ll gcd(ll a, ll b) {
a = abs(a); b = abs(b);
if (a < b)swap(a, b);
while (b) {
ll r = a % b; a = b; b = r;
}
return a;
}
template<typename T>
void addv(vector<T>& v, int loc, T val) {
if (loc >= v.size())v.resize(loc + 1, 0);
v[loc] += val;
}
/*const int mn = 2000005;
bool isp[mn];
vector<int> ps;
void init() {
fill(isp + 2, isp + mn, true);
for (int i = 2; i < mn; i++) {
if (!isp[i])continue;
ps.push_back(i);
for (int j = 2 * i; j < mn; j += i) {
isp[j] = false;
}
}
}*/
//[,val)
template<typename T>
auto prev_itr(set<T>& st, T val) {
auto res = st.lower_bound(val);
if (res == st.begin())return st.end();
res--; return res;
}
//[val,)
template<typename T>
auto next_itr(set<T>& st, T val) {
auto res = st.lower_bound(val);
return res;
}
using mP = pair<modint, modint>;
mP operator+(mP a, mP b) {
return { a.first + b.first,a.second + b.second };
}
mP operator+=(mP& a, mP b) {
a = a + b; return a;
}
mP operator-(mP a, mP b) {
return { a.first - b.first,a.second - b.second };
}
mP operator-=(mP& a, mP b) {
a = a - b; return a;
}
LP operator+(LP a, LP b) {
return { a.first + b.first,a.second + b.second };
}
LP operator+=(LP& a, LP b) {
a = a + b; return a;
}
LP operator-(LP a, LP b) {
return { a.first - b.first,a.second - b.second };
}
LP operator-=(LP& a, LP b) {
a = a - b; return a;
}
mt19937 mt(time(0));
const string drul = "DRUL";
string senw = "SENW";
//DRUL,or SENW
//int dx[4] = { 1,0,-1,0 };
//int dy[4] = { 0,1,0,-1 };
int dx[4] = { 1,0,-1,0 };
int dy[4] = { 0,1,0,-1 };
//------------------------------------
bool isok(vector<int> v) {
int n = v.size();
int sz = 0;
int t = 1;
while (t <= n) {
sz++; t *= 2;
}
vector<vector<int>> b(n, vector<int>(sz));
rep(i, n) {
rep(j, sz) {
if (v[i] & (1 << j))b[i][j] = 1;
}
}
auto isok = [&](int i, int j) {
if (0 <= i && i < n && 0 <= j && j < sz) {
if (b[i][j])return true;
}
return false;
};
vector<vector<bool>> used(n, vector<bool>(sz));
int num = 0;
rep(i, n)rep(j, sz) {
if (used[i][j])continue;
if (!b[i][j])continue;
queue<P> que;
que.push({ i,j });
num++;
while (!que.empty()) {
P p = que.front(); que.pop();
rep(d, 4) {
int ni = p.first + dx[d];
int nj = p.second + dy[d];
if (isok(ni, nj) && !used[ni][nj]) {
used[ni][nj] = true;
que.push({ ni,nj });
}
}
}
}
return num == 1;
}
vector<int> mkspe(int len) {
vector<int> res = { 4,6,2,3,1,5,7 };
rep(_, len - 3) {
int ad = res.back() + 1;
int sz = res.size();
rep(i, sz)res.push_back(res[i] + ad);
res.pop_back();
res.push_back(ad);
res.push_back(2 * ad - 1);
}
return res;
}
vector<int> mk(int n) {
if (n <= 7) {
vector<int> v(n);
rep(i, n)v[i] = i + 1;
do {
if (isok(v))return v;
} while (next_permutation(all(v)));
return {};
}
else if (n <= 15) {
if (n <= 12)return {};
if (n == 13) {
vector<int> res = mkspe(3);
res.push_back(13);
res.push_back(9);
res.push_back(11);
res.push_back(10);
res.push_back(12);
res.push_back(8);
return res;
}
if (n == 15) {
return mkspe(4);
}
if (n == 14) {
auto res = mkspe(4); res.pop_back();
return res;
}
}
else {
int sz = 0;
int t = 1;
while (t <= n) {
sz++; t *= 2;
}
int bb = 1;
while (2 * bb <= n)bb *= 2;
assert(t / 2 == bb);
if (bb + bb / 2 >= n)return {};
vector<int> res;
res.push_back(bb);
res.push_back(bb + bb / 2);
vector<int> pre = mkspe(sz - 2);
rep(i, pre.size()) {
res.push_back(pre[i] + bb);
if (pre[i] + bb + bb / 2 <= n && pre[i] != 1) {
res.push_back(pre[i] + bb + bb / 2);
}
}
res.push_back(bb + bb / 2 + 1);
vector<int> ad = mkspe(sz - 1);
reverse(all(ad));
for (int val : ad)res.push_back(val);
return res;
}
}
void solve() {
int n; cin >> n;
auto ans = mk(n);
if (ans.empty()) {
cout << "NO\n";
}
else {
cout << "YES\n";
//coutarray(ans);
assert(ans.size() == n);
//assert(isok(ans));
coutarray(ans);
}
}
signed main() {
ios::sync_with_stdio(false);
cin.tie(0);
//cout << fixed<<setprecision(10);
//init_f();
//init();
//while(true)
//expr();
//int t; cin >> t; rep(i, t)
solve();
return 0;
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 5ms
memory: 12104kb
input:
1
output:
YES 1
result:
ok answer is 1
Test #2:
score: 0
Accepted
time: 0ms
memory: 12000kb
input:
2
output:
NO
result:
ok answer is 0
Test #3:
score: 0
Accepted
time: 2ms
memory: 11840kb
input:
3
output:
YES 1 3 2
result:
ok answer is 1
Test #4:
score: 0
Accepted
time: 0ms
memory: 11776kb
input:
4
output:
NO
result:
ok answer is 0
Test #5:
score: 0
Accepted
time: 5ms
memory: 11864kb
input:
5
output:
NO
result:
ok answer is 0
Test #6:
score: 0
Accepted
time: 5ms
memory: 11868kb
input:
6
output:
NO
result:
ok answer is 0
Test #7:
score: 0
Accepted
time: 0ms
memory: 11800kb
input:
7
output:
YES 1 3 2 6 4 5 7
result:
ok answer is 1
Test #8:
score: 0
Accepted
time: 4ms
memory: 12000kb
input:
8
output:
NO
result:
ok answer is 0
Test #9:
score: 0
Accepted
time: 5ms
memory: 12084kb
input:
9
output:
NO
result:
ok answer is 0
Test #10:
score: 0
Accepted
time: 5ms
memory: 12068kb
input:
10
output:
NO
result:
ok answer is 0
Test #11:
score: 0
Accepted
time: 4ms
memory: 11916kb
input:
11
output:
NO
result:
ok answer is 0
Test #12:
score: 0
Accepted
time: 5ms
memory: 11812kb
input:
12
output:
NO
result:
ok answer is 0
Test #13:
score: 0
Accepted
time: 2ms
memory: 11852kb
input:
13
output:
YES 4 6 2 3 1 5 7 13 9 11 10 12 8
result:
ok answer is 1
Test #14:
score: 0
Accepted
time: 0ms
memory: 11868kb
input:
14
output:
YES 4 6 2 3 1 5 7 12 14 10 11 9 13 8
result:
ok answer is 1
Test #15:
score: 0
Accepted
time: 4ms
memory: 11848kb
input:
15
output:
YES 4 6 2 3 1 5 7 12 14 10 11 9 13 8 15
result:
ok answer is 1
Test #16:
score: 0
Accepted
time: 4ms
memory: 11916kb
input:
16
output:
NO
result:
ok answer is 0
Test #17:
score: 0
Accepted
time: 4ms
memory: 12084kb
input:
17
output:
NO
result:
ok answer is 0
Test #18:
score: 0
Accepted
time: 0ms
memory: 11876kb
input:
23
output:
NO
result:
ok answer is 0
Test #19:
score: 0
Accepted
time: 5ms
memory: 11916kb
input:
24
output:
NO
result:
ok answer is 0
Test #20:
score: 0
Accepted
time: 4ms
memory: 11804kb
input:
25
output:
YES 16 24 20 22 18 19 17 21 23 25 15 8 13 9 11 10 14 12 7 5 1 3 2 6 4
result:
ok answer is 1
Test #21:
score: 0
Accepted
time: 0ms
memory: 12064kb
input:
26
output:
YES 16 24 20 22 18 26 19 17 21 23 25 15 8 13 9 11 10 14 12 7 5 1 3 2 6 4
result:
ok answer is 1
Test #22:
score: 0
Accepted
time: 5ms
memory: 11852kb
input:
27
output:
YES 16 24 20 22 18 26 19 27 17 21 23 25 15 8 13 9 11 10 14 12 7 5 1 3 2 6 4
result:
ok answer is 1
Test #23:
score: 0
Accepted
time: 2ms
memory: 11848kb
input:
40
output:
NO
result:
ok answer is 0
Test #24:
score: 0
Accepted
time: 2ms
memory: 11812kb
input:
53
output:
YES 32 48 36 52 38 34 50 35 51 33 37 53 39 44 46 42 43 41 45 40 47 49 31 16 24 29 25 27 26 30 28 23 21 17 19 18 22 20 15 8 13 9 11 10 14 12 7 5 1 3 2 6 4
result:
ok answer is 1
Test #25:
score: 0
Accepted
time: 0ms
memory: 11760kb
input:
93
output:
NO
result:
ok answer is 0
Test #26:
score: 0
Accepted
time: 5ms
memory: 11852kb
input:
105
output:
YES 64 96 68 100 70 102 66 98 67 99 65 69 101 71 103 76 78 74 75 73 105 77 72 104 79 84 86 82 83 81 85 87 92 94 90 91 89 93 88 80 95 97 63 32 48 56 61 57 59 58 62 60 55 53 49 51 50 54 52 47 40 45 41 43 42 46 44 39 37 33 35 34 38 36 31 16 24 29 25 27 26 30 28 23 21 17 19 18 22 20 15 8 13 9 11 10 14 1...
result:
ok answer is 1
Test #27:
score: 0
Accepted
time: 5ms
memory: 11840kb
input:
132
output:
NO
result:
ok answer is 0
Test #28:
score: 0
Accepted
time: 4ms
memory: 11872kb
input:
221
output:
YES 128 192 132 196 134 198 130 194 131 195 129 133 197 135 199 140 204 142 206 138 202 139 203 137 201 141 205 136 200 143 207 148 212 150 214 146 210 147 211 145 209 149 213 151 215 156 220 158 154 218 155 219 153 217 157 221 152 216 144 208 159 164 166 162 163 161 165 167 172 174 170 171 169 173 ...
result:
ok answer is 1
Test #29:
score: 0
Accepted
time: 5ms
memory: 11876kb
input:
373
output:
NO
result:
ok answer is 0
Test #30:
score: 0
Accepted
time: 4ms
memory: 12008kb
input:
473
output:
YES 256 384 260 388 262 390 258 386 259 387 257 261 389 263 391 268 396 270 398 266 394 267 395 265 393 269 397 264 392 271 399 276 404 278 406 274 402 275 403 273 401 277 405 279 407 284 412 286 414 282 410 283 411 281 409 285 413 280 408 272 400 287 415 292 420 294 422 290 418 291 419 289 417 293 ...
result:
ok answer is 1
Test #31:
score: 0
Accepted
time: 4ms
memory: 11916kb
input:
513
output:
NO
result:
ok answer is 0
Test #32:
score: 0
Accepted
time: 5ms
memory: 11896kb
input:
934
output:
YES 512 768 516 772 518 774 514 770 515 771 513 517 773 519 775 524 780 526 782 522 778 523 779 521 777 525 781 520 776 527 783 532 788 534 790 530 786 531 787 529 785 533 789 535 791 540 796 542 798 538 794 539 795 537 793 541 797 536 792 528 784 543 799 548 804 550 806 546 802 547 803 545 801 549 ...
result:
ok answer is 1
Test #33:
score: 0
Accepted
time: 2ms
memory: 11864kb
input:
1356
output:
NO
result:
ok answer is 0
Test #34:
score: 0
Accepted
time: 5ms
memory: 12136kb
input:
1651
output:
YES 1024 1536 1028 1540 1030 1542 1026 1538 1027 1539 1025 1029 1541 1031 1543 1036 1548 1038 1550 1034 1546 1035 1547 1033 1545 1037 1549 1032 1544 1039 1551 1044 1556 1046 1558 1042 1554 1043 1555 1041 1553 1045 1557 1047 1559 1052 1564 1054 1566 1050 1562 1051 1563 1049 1561 1053 1565 1048 1560 1...
result:
ok answer is 1
Test #35:
score: 0
Accepted
time: 5ms
memory: 11812kb
input:
2263
output:
NO
result:
ok answer is 0
Test #36:
score: 0
Accepted
time: 0ms
memory: 12136kb
input:
3330
output:
YES 2048 3072 2052 3076 2054 3078 2050 3074 2051 3075 2049 2053 3077 2055 3079 2060 3084 2062 3086 2058 3082 2059 3083 2057 3081 2061 3085 2056 3080 2063 3087 2068 3092 2070 3094 2066 3090 2067 3091 2065 3089 2069 3093 2071 3095 2076 3100 2078 3102 2074 3098 2075 3099 2073 3097 2077 3101 2072 3096 2...
result:
ok answer is 1
Test #37:
score: 0
Accepted
time: 5ms
memory: 11868kb
input:
4375
output:
NO
result:
ok answer is 0
Test #38:
score: 0
Accepted
time: 2ms
memory: 11980kb
input:
7989
output:
YES 4096 6144 4100 6148 4102 6150 4098 6146 4099 6147 4097 4101 6149 4103 6151 4108 6156 4110 6158 4106 6154 4107 6155 4105 6153 4109 6157 4104 6152 4111 6159 4116 6164 4118 6166 4114 6162 4115 6163 4113 6161 4117 6165 4119 6167 4124 6172 4126 6174 4122 6170 4123 6171 4121 6169 4125 6173 4120 6168 4...
result:
ok answer is 1
Test #39:
score: 0
Accepted
time: 5ms
memory: 12064kb
input:
10925
output:
NO
result:
ok answer is 0
Test #40:
score: 0
Accepted
time: 6ms
memory: 12224kb
input:
14097
output:
YES 8192 12288 8196 12292 8198 12294 8194 12290 8195 12291 8193 8197 12293 8199 12295 8204 12300 8206 12302 8202 12298 8203 12299 8201 12297 8205 12301 8200 12296 8207 12303 8212 12308 8214 12310 8210 12306 8211 12307 8209 12305 8213 12309 8215 12311 8220 12316 8222 12318 8218 12314 8219 12315 8217 ...
result:
ok answer is 1
Test #41:
score: 0
Accepted
time: 5ms
memory: 12000kb
input:
16893
output:
NO
result:
ok answer is 0
Test #42:
score: 0
Accepted
time: 3ms
memory: 11932kb
input:
28913
output:
YES 16384 24576 16388 24580 16390 24582 16386 24578 16387 24579 16385 16389 24581 16391 24583 16396 24588 16398 24590 16394 24586 16395 24587 16393 24585 16397 24589 16392 24584 16399 24591 16404 24596 16406 24598 16402 24594 16403 24595 16401 24593 16405 24597 16407 24599 16412 24604 16414 24606 16...
result:
ok answer is 1
Test #43:
score: 0
Accepted
time: 5ms
memory: 12096kb
input:
40092
output:
NO
result:
ok answer is 0
Test #44:
score: 0
Accepted
time: 2ms
memory: 12380kb
input:
54980
output:
YES 32768 49152 32772 49156 32774 49158 32770 49154 32771 49155 32769 32773 49157 32775 49159 32780 49164 32782 49166 32778 49162 32779 49163 32777 49161 32781 49165 32776 49160 32783 49167 32788 49172 32790 49174 32786 49170 32787 49171 32785 49169 32789 49173 32791 49175 32796 49180 32798 49182 32...
result:
ok answer is 1
Test #45:
score: 0
Accepted
time: 5ms
memory: 11856kb
input:
88104
output:
NO
result:
ok answer is 0
Test #46:
score: 0
Accepted
time: 10ms
memory: 12588kb
input:
106284
output:
YES 65536 98304 65540 98308 65542 98310 65538 98306 65539 98307 65537 65541 98309 65543 98311 65548 98316 65550 98318 65546 98314 65547 98315 65545 98313 65549 98317 65544 98312 65551 98319 65556 98324 65558 98326 65554 98322 65555 98323 65553 98321 65557 98325 65559 98327 65564 98332 65566 98334 65...
result:
ok answer is 1
Test #47:
score: 0
Accepted
time: 2ms
memory: 11816kb
input:
152797
output:
NO
result:
ok answer is 0
Test #48:
score: 0
Accepted
time: 7ms
memory: 13440kb
input:
200000
output:
YES 131072 196608 131076 196612 131078 196614 131074 196610 131075 196611 131073 131077 196613 131079 196615 131084 196620 131086 196622 131082 196618 131083 196619 131081 196617 131085 196621 131080 196616 131087 196623 131092 196628 131094 196630 131090 196626 131091 196627 131089 196625 131093 19...
result:
ok answer is 1
Test #49:
score: 0
Accepted
time: 0ms
memory: 11908kb
input:
3073
output:
YES 2048 3072 2052 2054 2050 2051 2049 2053 2055 2060 2062 2058 2059 2057 2061 2056 2063 2068 2070 2066 2067 2065 2069 2071 2076 2078 2074 2075 2073 2077 2072 2064 2079 2084 2086 2082 2083 2081 2085 2087 2092 2094 2090 2091 2089 2093 2088 2095 2100 2102 2098 2099 2097 2101 2103 2108 2110 2106 2107 2...
result:
ok answer is 1
Test #50:
score: 0
Accepted
time: 6ms
memory: 12236kb
input:
16383
output:
YES 8192 12288 8196 12292 8198 12294 8194 12290 8195 12291 8193 8197 12293 8199 12295 8204 12300 8206 12302 8202 12298 8203 12299 8201 12297 8205 12301 8200 12296 8207 12303 8212 12308 8214 12310 8210 12306 8211 12307 8209 12305 8213 12309 8215 12311 8220 12316 8222 12318 8218 12314 8219 12315 8217 ...
result:
ok answer is 1
Test #51:
score: 0
Accepted
time: 6ms
memory: 11964kb
input:
32767
output:
YES 16384 24576 16388 24580 16390 24582 16386 24578 16387 24579 16385 16389 24581 16391 24583 16396 24588 16398 24590 16394 24586 16395 24587 16393 24585 16397 24589 16392 24584 16399 24591 16404 24596 16406 24598 16402 24594 16403 24595 16401 24593 16405 24597 16407 24599 16412 24604 16414 24606 16...
result:
ok answer is 1
Test #52:
score: 0
Accepted
time: 0ms
memory: 11864kb
input:
399
output:
YES 256 384 260 388 262 390 258 386 259 387 257 261 389 263 391 268 396 270 398 266 394 267 395 265 393 269 397 264 392 271 399 276 278 274 275 273 277 279 284 286 282 283 281 285 280 272 287 292 294 290 291 289 293 295 300 302 298 299 297 301 296 303 308 310 306 307 305 309 311 316 318 314 315 313 ...
result:
ok answer is 1
Test #53:
score: 0
Accepted
time: 0ms
memory: 11852kb
input:
5757
output:
NO
result:
ok answer is 0
Test #54:
score: 0
Accepted
time: 5ms
memory: 12000kb
input:
179
output:
NO
result:
ok answer is 0
Test #55:
score: 0
Accepted
time: 4ms
memory: 12008kb
input:
228
output:
YES 128 192 132 196 134 198 130 194 131 195 129 133 197 135 199 140 204 142 206 138 202 139 203 137 201 141 205 136 200 143 207 148 212 150 214 146 210 147 211 145 209 149 213 151 215 156 220 158 222 154 218 155 219 153 217 157 221 152 216 144 208 159 223 164 228 166 162 226 163 227 161 225 165 167 ...
result:
ok answer is 1
Extra Test:
score: 0
Extra Test Passed