QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#588435 | #9378. Strange Binary | Nanako7_ix | WA | 0ms | 3556kb | C++14 | 1.0kb | 2024-09-25 11:07:48 | 2024-09-25 11:43:00 |
Judging History
answer
#include<bits/stdc++.h>
#define pii pair<int, int>
#define endl "\n"
#define setpre(x) fixed << setprecision(x)
#define FOR(i, l, r) for(int i = l; i <= r; ++i)
#define ROF(i, l, r) for(int i = r; i >= l; --i)
#define fi first
#define se second
using namespace std;
using LL = long long;
constexpr int MAXN = 5e5 + 10;
constexpr int inf = 0x3f3f3f3f;
constexpr LL INF = 0x3f3f3f3fffffffff;
void solve() {
int n;
cin >> n;
if((n & 3) == 0) {
cout << "NO\n";
return;
}
cout << "YES\n";
vector<int> a(32);
FOR(i, 0, 31) a[i] = n >> i & 1;
for(int i = 0; i < 32; ++i) {
if(a[i] == 1 && a[i + 1] == 0) {
a[i] = -1, a[i + 1] = 1;
}
}
for(int i = 0; i < 4; ++i) {
for(int j = i * 8; j < (i + 1) * 8; ++j) {
cout << a[j] << ' ';
}
cout << endl;
}
}
signed main() {
cin.tie(0), cout.tie(0) -> sync_with_stdio(0);
int t = 1;
cin >> t;
while(t--) solve();
return 0;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3556kb
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)