QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#307133 | #8004. Bit Component | ucup-team139 | WA | 0ms | 3824kb | C++23 | 720b | 2024-01-18 00:32:21 | 2024-01-18 00:32:23 |
Judging History
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