Submission #270741

# Submission time Handle Problem Language Result Execution time Memory
270741 2020-08-18T01:42:39 Z TMJN Hotter Colder (IOI10_hottercolder) C++17
0 / 100
10000 ms 262144 KB
#include "grader.h"

int HC(int N){
	int L=1;
	int R=N-1;
	bool f=false;
	Guess(1);
	while(L!=R){
		if(f){
			int t=Guess(L);
			if(t>0){
				if((L+R)&1){
					L=(L+R+1)/2;
				}
				else{
					L=(L+R)/2+1;
				}
			}
			if(t==0)return (L+R)/2;
			if(t<0){
				R=(L+R-1)/2;
			}
		}
		else{
			int t=Guess(R);
			if(t>0){
				R=(L+R-1)/2;
			}
			if(t==0)return (L+R)/2;
			if(t<0){
				if((L+R)&1){
					L=(L+R+1)/2;
				}
				else{
					L=(L+R)/2+1;
				}
			}
		}
		f^=true;
	}
	return L;
}
# Verdict Execution time Memory Grader output
1 Execution timed out 10063 ms 262144 KB Time limit exceeded
# Verdict Execution time Memory Grader output
1 Execution timed out 10081 ms 262144 KB Time limit exceeded
# Verdict Execution time Memory Grader output
1 Execution timed out 10085 ms 262144 KB Time limit exceeded
# Verdict Execution time Memory Grader output
1 Execution timed out 10094 ms 262144 KB Time limit exceeded