| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 41077 | pce913 | Hotter Colder (IOI10_hottercolder) | C++14 | 845 ms | 55288 KiB | 
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "grader.h"
//내가 사용하는 [] 양쪽 폐구간 이분탐색에서는
//left가 right보다 항상 같거나 크다.
//즉, left는 1~mid,   right은 mid+1 ~ n 이라고 볼 수 있다.
//n이 7이라고 하면 left에는 1 2 3 4, right는 5 6 7 이 있다고 볼 수 있다.
int HC(int N){
	int left = 1;
	int right = N;
	//left쪽이 right보다 갯수가 항상 같거나 하나 크다는 사실을 이용한다.
	//폐구간 폐구간
	int ans = 1;
	while (left <= right){    //==빼야 한다.
		if (left == right){
			ans = left;
			break;
		}
		int mid = (left + right) / 2;
		int la = Guess(left);           //la가 same 이면?   ra도 무조건 same이 될 수 밖에 없다.
		int ra = Guess(right);  //오른쪽을 나중에 보았고
		if (ra == 0){  //오른쪽을 늦게 보았고
			return (left + right) / 2;
		}
		if (ra == 1){  //오른쪽이 hotter라면 오른쪽으로 간다.
			ans = mid;
			left = mid + 1;
		}
		else{
			right = mid - 1;   //현재의
		}
	}
	return ans;
}
Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
