QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#754406#9378. Strange Binarymoanhehe666233#Compile Error//C++23735b2024-11-16 14:58:332024-11-16 14:58:34

Judging History

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

  • [2024-11-16 14:58:34]
  • 评测
  • [2024-11-16 14:58:33]
  • 提交

answer

#include "bits/stdc++.h"
using namespace std;

int a[32];

int main() {



    int T;
    cin>>T;

    while (T--) {
        int n;
        cin>>n;
        for (int i=0;i<=31;i++) a[i] = ((1<<i)&n) ? 1 : 0;; 
        if (a[0]==0 && a[1]==0) cout<<"NO\n";
        else {
            cout<<"YES\n";
            for (int i=0;i<31;i++) 
                if (a[i]==1 && a[i+1]==0) 
                    a[i+1]=1,a[i]=-1; 
            for (int j=0;j<4;j++) {
                for (int i=0;i<8;i++) {
                    cout<<a[j*8+i]<<" ";
                }
                cout<<endl;
            }
            
        } 
    }

    return 0;
}
/*
5 3
1 2 3
100 THU
110 PKU
95 PKU
105 THU
115 PKU
 *

Details

answer.code:35:1: error: unterminated comment
   35 | /*
      | ^