Submission #1007783

# Submission time Handle Problem Language Result Execution time Memory
1007783 2024-06-25T13:20:02 Z amirhoseinfar1385 Mađioničar (COI22_madionicar) C++17
0 / 100
514 ms 344 KB
#include<bits/stdc++.h>
using namespace std;

bool pors(int l,int r){
	if(l>r||l<=0){
		return 0;
	}
	if(l==r){
		return 1;
	}
	cout<<"? "<<l<<" "<<r<<endl;
	int x;
	cin>>x;
	return x;
}

int main(){
	int res=1;
	int n;
	cin>>n;
	for(int i=2;i<=n;i++){
		while(pors(i-res,i)){
			res++;
		}
	}
	cout<<"! "<<res<<"\n";
}
# Verdict Execution time Memory Grader output
1 Incorrect 44 ms 344 KB L = 22, expected 30
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 44 ms 344 KB L = 22, expected 30
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 514 ms 344 KB L = 29, expected 52
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 44 ms 344 KB L = 22, expected 30
2 Halted 0 ms 0 KB -