QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#516521#8216. Jumbled PrimesuukuWA 11ms3528kbC++14741b2024-08-12 17:55:042024-08-12 17:55:10

Judging History

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

  • [2024-08-12 17:55:10]
  • 评测
  • 测评结果:WA
  • 用时:11ms
  • 内存:3528kb
  • [2024-08-12 17:55:04]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int Read(){
	int x=0;char ch=getchar();bool f=0;
	while(!isdigit(ch)) if(ch=='-') f=1,ch=getchar(); else ch=getchar();
	while(isdigit(ch)) x=(x<<1)+(x<<3)+(ch^48),ch=getchar();
	return f?-x:x;
}
bool ans[105];
int main(){
	int T=1000;
	while(T--){
		for(int i=1;i<=100;i++) ans[i]=1;
		for(int i=1;i<=100;i++){
			if(!ans[i]) continue;
			for(int j=i+1;j<=100;j++){
				cout<<"? "<<i<<' '<<j<<'\n';
				cout.flush();
//				printf("? %d %d\n",i,j);
				fflush(stdout);
				int x;
				cin>>x; 
				if(x!=1){
					ans[i]=0;
					ans[j]=0;break;
				} 
			}
		}
		cout<<"! ";
		for(int i=1;i<=100;i++) cout<<ans[i];
		cout<<'\n';
		cout.flush();
			
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 11ms
memory: 3528kb

input:

1
1
1
3
1
1
1
1
1
11
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
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
25
2
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
...

output:

? 1 2
? 1 3
? 1 4
? 1 5
? 2 3
? 2 4
? 2 5
? 2 6
? 2 7
? 2 8
? 3 4
? 3 5
? 3 6
? 3 7
? 3 8
? 3 9
? 3 10
? 3 11
? 3 12
? 3 13
? 3 14
? 3 15
? 3 16
? 3 17
? 3 18
? 3 19
? 3 20
? 3 21
? 3 22
? 3 23
? 3 24
? 3 25
? 3 26
? 3 27
? 3 28
? 3 29
? 3 30
? 3 31
? 3 32
? 3 33
? 3 34
? 3 35
? 3 36
? 3 37
? 3 38
?...

result:

wrong output format Unexpected end of file - int32 expected