QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#307354 | #8004. Bit Component | ucup_team_qiuly# | WA | 0ms | 3944kb | C++14 | 421b | 2024-01-18 14:28:22 | 2024-01-18 14:28:23 |
Judging History
answer
#include <iostream>
#include <cstdio>
using namespace std;
int n;
int ans[1048576];
int main(){
cin>>n;
int w=1;
while((1<<w)<=n)w++;
if ((1<<w)!=n+1){
puts("NO");
return 0;
}
else{
puts("YES");
ans[0]=0,ans[1]=1;
for (int i=1;i<w;i++){
for (int j=0;j<(1<<i);j++)ans[(1<<(i+1))-1-j]=ans[j]+(1<<i);
}
for (int i=1;i<=n;i++)printf("%d ",ans[i]);
printf("\n");
}
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3796kb
input:
1
output:
YES 1
result:
ok answer is 1
Test #2:
score: 0
Accepted
time: 0ms
memory: 3500kb
input:
2
output:
NO
result:
ok answer is 0
Test #3:
score: 0
Accepted
time: 0ms
memory: 3944kb
input:
3
output:
YES 1 3 2
result:
ok answer is 1
Test #4:
score: 0
Accepted
time: 0ms
memory: 3544kb
input:
4
output:
NO
result:
ok answer is 0
Test #5:
score: 0
Accepted
time: 0ms
memory: 3632kb
input:
5
output:
NO
result:
ok answer is 0
Test #6:
score: 0
Accepted
time: 0ms
memory: 3636kb
input:
6
output:
NO
result:
ok answer is 0
Test #7:
score: 0
Accepted
time: 0ms
memory: 3748kb
input:
7
output:
YES 1 3 2 6 7 5 4
result:
ok answer is 1
Test #8:
score: 0
Accepted
time: 0ms
memory: 3504kb
input:
8
output:
NO
result:
ok answer is 0
Test #9:
score: 0
Accepted
time: 0ms
memory: 3600kb
input:
9
output:
NO
result:
ok answer is 0
Test #10:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
10
output:
NO
result:
ok answer is 0
Test #11:
score: 0
Accepted
time: 0ms
memory: 3604kb
input:
11
output:
NO
result:
ok answer is 0
Test #12:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
12
output:
NO
result:
ok answer is 0
Test #13:
score: -100
Wrong Answer
time: 0ms
memory: 3608kb
input:
13
output:
NO
result:
wrong answer Jury has the answer, participant doesn't