QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#728660#9378. Strange Binarylylmeichichi#AC ✓7ms3664kbC++14916b2024-11-09 15:36:552024-11-09 15:36:55

Judging History

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

  • [2024-11-09 15:36:55]
  • 评测
  • 测评结果:AC
  • 用时:7ms
  • 内存:3664kb
  • [2024-11-09 15:36:55]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
const ll mod=998244353;
const ll inf=2e9;
const int N=2e5+5;
const int M=2e5+5;
const int V=2e6+5;
int n;
int p0[100]={-1,0,-1,-1,0,1};
int p1[100]={-1,-1,0,-1,-1,-1,-1,-1,0,1,1,1};
int pn[100]={-1,0,-1,-1,-1,0,1,1};
void solve(int Ca){
	cin>>n;
	if(n%4==0){cout<<"NO\n";return;}
	cout<<"YES\n";
	n=(n/4*3)+n%4-1;
	cout<<p0[n%6]<<" "<<p1[n%12]<<" ";
	n/=3;
	for(int i=2;i<31;i++){
		cout<<pn[n%8];
		if(i%8==7) cout<<"\n";
		else cout<<" ";
		n/=2;
	}
	cout<<"1\n";
}
int main(){
	#ifdef ONLINE_JUDGE
	ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
	#endif
	#ifndef ONLINE_JUDGE
	freopen("test.in","r",stdin);
	freopen("test.out","w",stdout);
	#endif
	
	int Ca=1;
	cin>>Ca;
	for(int i=1;i<=Ca;i++){
		solve(i);
	}
	return 0;
}

这程序好像有点Bug,我给组数据试试?

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3648kb

input:

3
0
3
5

output:

NO
YES
-1 0 -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 0 -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:

ok Accepted! (3 test cases)

Test #2:

score: 0
Accepted
time: 1ms
memory: 3588kb

input:

2
0
1073741823

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 0 -1 1

result:

ok Accepted! (2 test cases)

Test #3:

score: 0
Accepted
time: 7ms
memory: 3664kb

input:

10000
324097321
555675086
304655177
991244276
9980291
383616352
1071036550
795625380
682098056
68370721
969101726
685975156
973896269
354857775
196188000
606494155
754416123
467588829
495704303
558090120
618002000
491488050
741575237
9937018
10028830
140094825
652839595
357724903
516690123
817724271...

output:

YES
-1 -1 -1 0 -1 0 -1 -1
0 -1 0 -1 0 -1 0 -1
0 -1 -1 -1 0 -1 0 1
-1 0 -1 -1 0 -1 -1 1
YES
0 1 -1 0 -1 1 1 -1
0 1 -1 0 1 1 -1 0
1 1 1 -1 0 -1 -1 -1
0 -1 -1 -1 -1 0 -1 1
YES
-1 -1 -1 0 -1 -1 0 1
-1 0 -1 0 -1 0 -1 0
-1 -1 -1 0 -1 0 -1 -1
-1 0 -1 -1 0 -1 -1 1
NO
YES
-1 0 -1 -1 -1 -1 1 -1
0 -1 -1 0 -1 -...

result:

ok Accepted! (10000 test cases)

Extra Test:

score: 0
Extra Test Passed