QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#582620#9378. Strange BinaryLam017WA 0ms3612kbC++231.4kb2024-09-22 17:00:412024-09-22 17:00:41

Judging History

你现在查看的是最新测评结果

  • [2024-09-22 17:00:41]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3612kb
  • [2024-09-22 17:00:41]
  • 提交

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;
}

详细

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)