Submission #226767

# Submission time Handle Problem Language Result Execution time Memory
226767 2020-04-25T09:33:46 Z jiahng Hotter Colder (IOI10_hottercolder) C++14
25 / 100
876 ms 24424 KB
#include "grader.h"
#include <bits/stdc++.h>
typedef long long ll;
int HC(int N){
	ll l = 1, r = N + 1;
	
	
	

	while (l + 3 < r){
		int mid = (l+r)/2;
		
		//std::cout<<l<<' '<<r<<'\n';
		
		int mid2 = (l+mid)/2;
		Guess((l+r)/2);
		//std::cout<<mid2<<' ';
		int res = Guess(mid2);
		//std::cout<<res<<'\n';
		
		if (res == 1) r = mid;
		else if (res == -1) l = mid2;
		else return (mid+mid2)/2;
	}
	
	//std::cout<<l<<' ';
	int cur = l;
	Guess(l);
	
	if (l+1 <= N && Guess(l+1) == 1) cur = l+1;
	Guess(cur);
	
	if (l+2 <= N && Guess(l+2) == 1) cur = l+2;
	Guess(cur);
	
	if (l+3 <= N && Guess(l+3) == 1) cur = l+3;
	
	//std::cout<<l<<'\n';
	return cur;
}
# Verdict Execution time Memory Grader output
1 Correct 32 ms 1280 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 34 ms 1400 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 33 ms 1400 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 876 ms 24424 KB Output isn't correct - alpha = 0.000000000000