QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#337318 | #8004. Bit Component | ucup-team1209# | WA | 1ms | 3812kb | C++20 | 676b | 2024-02-25 10:37:06 | 2024-02-25 10:37:07 |
Judging History
answer
#include <bits/stdc++.h>
#define cs const
#define pb push_back
using namespace std;
cs int N = 2e5 + 5;
int n;
int main() {
#ifdef zqj
freopen("1.in", "r", stdin);
#endif
cin >> n;
if(n == 1) {
cout << "YES\n" << 1 << '\n';
return 0;
}
if((n & (n - 1)) == 0) {
cout << "NO\n";
return 0;
}
vector <int> a(n + 1);
for(int i = 1; i <= n; i++) a[i] = i;
a[1] = 2, a[2] = 3, a[3] = 1;
for(int i = 4; i <= n; i *= 2) {
swap(a[i], a[i + 1]);
}
cout << "YES\n";
for(int i = 1; i <= n; i++) cout << a[i] << ' ';
cout << '\n';
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 1ms
memory: 3812kb
input:
1
output:
YES 1
result:
ok answer is 1
Test #2:
score: 0
Accepted
time: 1ms
memory: 3504kb
input:
2
output:
NO
result:
ok answer is 0
Test #3:
score: 0
Accepted
time: 1ms
memory: 3572kb
input:
3
output:
YES 2 3 1
result:
ok answer is 1
Test #4:
score: 0
Accepted
time: 0ms
memory: 3508kb
input:
4
output:
NO
result:
ok answer is 0
Test #5:
score: -100
Wrong Answer
time: 1ms
memory: 3584kb
input:
5
output:
YES 2 3 1 5 4
result:
wrong answer Participant's answer is incorrect