Submission #748608

# Submission time Handle Problem Language Result Execution time Memory
748608 2023-05-26T15:02:28 Z mariowong Mađioničar (COI22_madionicar) C++14
0 / 100
1401 ms 308 KB
#include <bits/stdc++.h>
using namespace std;

int main(){
	ios::sync_with_stdio(false);
	int n;
	cin >> n;
	int sz=2;
	for (int i=1;i<=n;i++){
		int x=1;
		while (x){
			int l=i-sz/2+1,r=i+sz/2;
			if (l > 0 && r <= n){
				cout << "? " << l << " " << r << endl;
				cin >> x;
				if (x) sz+=2;
			}
			else x=0;
		}
	}
	int sz2=3;
	for (int i=1;i<=n;i++){
		int x=1;
		while (x){
			int l=i-sz2/2,r=i+sz2/2;
			if (l > 0 && r <= n){
				cout << "? " << l << " " << r << endl;
				cin >> x;
				if (x) sz2+=2;
			}
			else x=0;
		}
	}
	cout << max(sz,sz2)-2 << "\n";
	return 0;
}	
//0 1 1 2 2 3 1
//2 4 1 2 2 5 1
# Verdict Execution time Memory Grader output
1 Incorrect 134 ms 208 KB invalid token
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 134 ms 208 KB invalid token
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1401 ms 308 KB invalid token
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 134 ms 208 KB invalid token
2 Halted 0 ms 0 KB -