QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#582620 | #9378. Strange Binary | Lam017 | WA | 0ms | 3612kb | C++23 | 1.4kb | 2024-09-22 17:00:41 | 2024-09-22 17:00:41 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
while(t--)
{
int n;
cin>>n;
if(n == 0)
{
cout << "NO" << endl;
continue;
}
else if (n % 2 == 0)
{
int nn = n;
n >>= 1;
if((n % 4) == 0)
{
cout << "NO" << endl;
}
else
{
nn--;
for (int i = 0; i <= 30;i++)
{
if (i == 0)
{
cout << 0 << " ";
continue;
}
if (((n >> i) & 1) == 1)
cout << ((n >> i) & 1) << " ";
else
cout << -1 << " ";
if ((i + 1) % 8 == 0)
cout << endl;
}
cout << 1 << endl;
}
}
else
{
n >>= 1;
for (int i = 0; i <= 30;i++)
{
if (((n >> i) & 1) == 1)
cout << ((n >> i) & 1) << " ";
else
cout << -1 << " ";
if ((i + 1) % 8 == 0)
cout << endl;
}
cout << 1 << endl;
}
}
//system("pause");
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3612kb
input:
3 0 3 5
output:
NO 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 -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 Token parameter [name=checker] equals to "1", doesn't correspond to pattern "YES|NO" (test case 3)