QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#584532#9378. Strange BinaryLoxilanteWA 0ms3536kbC++141.0kb2024-09-23 15:05:442024-09-23 15:05:45

Judging History

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

  • [2024-09-23 15:05:45]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3536kb
  • [2024-09-23 15:05:44]
  • 提交

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)