QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#588441 | #9378. Strange Binary | Nanako7_ix | WA | 0ms | 3556kb | C++14 | 1.0kb | 2024-09-25 11:19:28 | 2024-09-25 11:43:13 |
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;
}
Details
Tip: Click on the bar to expand more detailed information
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)