QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#580841 | #9378. Strange Binary | tzw | WA | 1ms | 3676kb | C++14 | 516b | 2024-09-22 00:18:14 | 2024-09-22 00:18:22 |
Judging History
answer
#include<iostream>
using namespace std;
int a[40];
int main(){
int t;
cin>>t;
while(t--){
int n;
cin>>n;
int k=1;
for(int i=0;i<32;i++){
if(k&n) a[i]=1;
else a[i]=0;
k<<=1;
}
if(a[0]==0 && a[1]==0){
cout<<"NO"<<endl;
continue;
}
cout<<"YES"<<endl;
for(int i=0;i<32;i++){
if(a[i]==1 && a[i+1]==0){
a[i]=-1;
a[i+1]=1;
}
}
for(int i=0;i<32;i++){
if(i && i%8==0) cout<<endl;
cout<<a[i]<<' ';
}
cout<<endl;
}
return 0;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3676kb
input:
3 0 3 5
output:
NO YES 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 YES -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1
result:
wrong answer Offend Limitation 3. (test case 3)