QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#337318#8004. Bit Componentucup-team1209#WA 1ms3812kbC++20676b2024-02-25 10:37:062024-02-25 10:37:07

Judging History

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

  • [2024-02-25 10:37:07]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3812kb
  • [2024-02-25 10:37:06]
  • 提交

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; 
}

Details

Tip: Click on the bar to expand more detailed information

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