QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#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;
}
詳細信息
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)