QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#307133#8004. Bit Componentucup-team139WA 0ms3824kbC++23720b2024-01-18 00:32:212024-01-18 00:32:23

Judging History

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

  • [2024-01-18 00:32:23]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3824kb
  • [2024-01-18 00:32:21]
  • 提交

answer

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

void solve(int t){
    int n;
    cin>>n;
    
    int pot=1;
    while(pot<=n)pot*=2ll;
    
    if(pot-1!=n)cout<<"NO\n";
    else{
        cout<<"YES\n";
        vector<int> ans = {0};
        
        while(ans.size()!=pot){
            vector<int> tmp;
            for(auto i : ans)tmp.push_back(i+ans.size());
            reverse(tmp.begin(),tmp.end());
            for(auto i : tmp)ans.push_back(i);
        }
        
        for(int i=1;i<ans.size();i++)cout<<ans[i]<<" ";
    }
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int t=1;
    //cin>>t;
    for(int i=1;i<=t;i++)solve(i);
    
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

1

output:

YES
1 

result:

ok answer is 1

Test #2:

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

input:

2

output:

NO

result:

ok answer is 0

Test #3:

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

input:

3

output:

YES
1 3 2 

result:

ok answer is 1

Test #4:

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

input:

4

output:

NO

result:

ok answer is 0

Test #5:

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

input:

5

output:

NO

result:

ok answer is 0

Test #6:

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

input:

6

output:

NO

result:

ok answer is 0

Test #7:

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

input:

7

output:

YES
1 3 2 6 7 5 4 

result:

ok answer is 1

Test #8:

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

input:

8

output:

NO

result:

ok answer is 0

Test #9:

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

input:

9

output:

NO

result:

ok answer is 0

Test #10:

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

input:

10

output:

NO

result:

ok answer is 0

Test #11:

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

input:

11

output:

NO

result:

ok answer is 0

Test #12:

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

input:

12

output:

NO

result:

ok answer is 0

Test #13:

score: -100
Wrong Answer
time: 0ms
memory: 3548kb

input:

13

output:

NO

result:

wrong answer Jury has the answer, participant doesn't