QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#582374 | #9378. Strange Binary | Swd146296# | WA | 0ms | 3600kb | C++14 | 611b | 2024-09-22 16:12:04 | 2024-09-22 16:12:05 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
int main(){
int _;
cin>>_;
while(_--){
int n,nn;
cin>>n;
nn=n;
if(n%4==0){
puts("NO");
continue;
}
int ans[37]={};
for(int i=0;i<=31;i++){
ans[i]=(nn&1);
nn/=2;
}
int now0=0,chu0=32;
for(int i=31;i>=0;i--){
if(ans[i]==0){
if(now0==0){
chu0=i;
}
now0+=1;
}
if(ans[i]==1){
if(now0>=1){
ans[chu0]=1;
for(int j=chu0-1;j>=i;--j)
ans[j]=-1;
}
now0=0;
}
}
for(int i=0;i<=31;i++){
cout<<ans[i]<<' ';
if((i+1)%8==0)puts("");
}
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3600kb
input:
3 0 3 5
output:
NO 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 -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 Token parameter [name=checker] equals to "1", doesn't correspond to pattern "YES|NO" (test case 3)