Submission #356458

# Submission time Handle Problem Language Result Execution time Memory
356458 2021-01-23T11:47:00 Z Mefarnis Hotter Colder (IOI10_hottercolder) C++14
0 / 100
882 ms 152584 KB
#include <bits/stdc++.h>
#include "grader.h"
using namespace std;

int HC(int n) {
	int l = 1 , r = n , last = 1;
	Guess(last);
	while(l < r) {
		int mid = (l+r) >> 1;
		int x = (last == l) ? r : l;
		int val = Guess(x);
		if(val == 0)
			return mid;
		int y = (val == 1) ? x : last;
		if((l+r)%2 == 0) {
			if(y == l)
				r = mid-1;
			else
				l = mid+1;
		}
		else {
			if(y == l)
				r = mid;
			else
				l = mid+1;
		}
		last = x;
	}
	return l;
}
# Verdict Execution time Memory Grader output
1 Incorrect 45 ms 14060 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 45 ms 14060 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 45 ms 14068 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 882 ms 152584 KB Output isn't correct - alpha = 0.000000000000