QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#584532 | #9378. Strange Binary | Loxilante | WA | 0ms | 3536kb | C++14 | 1.0kb | 2024-09-23 15:05:44 | 2024-09-23 15:05:45 |
Judging History
answer
#define F_C
#include <bits/stdc++.h>
#define rep(i, l, r) for(int i = l; i < r; i++)
#define hrp(i, l, r) for(int i = l; i <= r; i++)
#define rev(i, r, l) for(int i = r; i >= l; i--)
#define int ll
using namespace std;
typedef long long ll;
template<typename tn = int> tn next(void) { tn k; cin>>k; return k; }
#ifndef LOCAL
#define D(...) 0
#endif
signed main(void)
{
#ifdef LOCAL
// freopen("C:\\Users\\Loxil\\Desktop\\IN.txt", "r", stdin);
// freopen("C:\\Users\\Loxil\\Desktop\\OUT.txt", "w", stdout);
#endif
ios::sync_with_stdio(false);
cin.tie(0);
int T = next();
while(T--)
{
int n = next();
if (!n || (n-1)&3 == 3) { cout<<"NO"<<endl; continue; }
vector<int> bin(40, -1);
int p = 1, i = 0; n--;
while(n)
{
if (n&1) if (i) bin[i-1] += 2; else bin[i]++;
n >>= 1; i++;
}
cout<<"YES"<<endl;
rep(i, 0, 32) cout<<bin[i]<<" \n"[i%8 == 7];
}
return 0;
}
/*
*/
詳細信息
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3536kb
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:
wrong answer Offend Limitation 3. (test case 3)