Submission #1007768

# Submission time Handle Problem Language Result Execution time Memory
1007768 2024-06-25T12:58:28 Z amirhoseinfar1385 Mađioničar (COI22_madionicar) C++17
0 / 100
1119 ms 412 KB
#include<bits/stdc++.h>
using namespace std;

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

int main(){
	int res=1;
	int l=1;
	int n;
	cin>>n;
	for(int i=2;i<=n;i++){
		l--;
		while(pors(l,i)==0){
			l++;
		}
		res=max(res,i-l+1);
	}
	cout<<res<<"\n";
}
# Verdict Execution time Memory Grader output
1 Incorrect 126 ms 344 KB invalid token
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 126 ms 344 KB invalid token
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1119 ms 412 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 126 ms 344 KB invalid token
2 Halted 0 ms 0 KB -