QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#583718 | #9378. Strange Binary | kirco | WA | 0ms | 3612kb | C++23 | 780b | 2024-09-22 21:32:47 | 2024-09-22 21:32:47 |
Judging History
answer
#include <bits/stdc++.h>
#define int long long
#define endl "\n"
#define iosy ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define rop(i,a,n) for(int i=a;i<n;i++)
using namespace std;
const int inf = 0x3f3f3f3f3f3f3f3fLL;
const int N = 2e5+10;
const int MOD = 1e9+7;
void solve(){
int n;cin>>n;
vector<int> a(32,-1);
a[31]=1;
if(n<=2){
cout<<"NO\n";
return;
}else{
int k=0;
while(n>0){
k++;
n>>=1;
}
//cout<<"k="<<k<<"\n";
a[k-2]=1;
}
cout<<"YES\n";
int j=0;
for(int i=0;i<32;i++){
if(j<8){
j++;
}else{
cout<<"\n";
j=1;
}
cout<<a[i]<<" ";
}
cout<<"\n";
}
signed main()
{
iosy;
int _t=1;
cin>>_t;
while(_t--){
solve();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3548kb
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:
ok Accepted! (3 test cases)
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3612kb
input:
2 0 1073741823
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
result:
wrong answer Offend Limitation 3. (test case 2)