QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#582374#9378. Strange BinarySwd146296#WA 0ms3600kbC++14611b2024-09-22 16:12:042024-09-22 16:12:05

Judging History

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

  • [2024-09-22 16:12:05]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3600kb
  • [2024-09-22 16:12:04]
  • 提交

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)