QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#754406 | #9378. Strange Binary | moanhehe666233# | Compile Error | / | / | C++23 | 735b | 2024-11-16 14:58:33 | 2024-11-16 14:58:34 |
Judging History
answer
#include "bits/stdc++.h"
using namespace std;
int a[32];
int main() {
int T;
cin>>T;
while (T--) {
int n;
cin>>n;
for (int i=0;i<=31;i++) a[i] = ((1<<i)&n) ? 1 : 0;;
if (a[0]==0 && a[1]==0) cout<<"NO\n";
else {
cout<<"YES\n";
for (int i=0;i<31;i++)
if (a[i]==1 && a[i+1]==0)
a[i+1]=1,a[i]=-1;
for (int j=0;j<4;j++) {
for (int i=0;i<8;i++) {
cout<<a[j*8+i]<<" ";
}
cout<<endl;
}
}
}
return 0;
}
/*
5 3
1 2 3
100 THU
110 PKU
95 PKU
105 THU
115 PKU
*
Details
answer.code:35:1: error: unterminated comment 35 | /* | ^