Submission #41043

# Submission time Handle Problem Language Result Execution time Memory
41043 2018-02-12T07:02:44 Z pica4500 Hotter Colder (IOI10_hottercolder) C++
50 / 100
757 ms 8312 KB
#include "grader.h"

int HC(int N){
	int lo = 1;
	int hi = N;
	int mid = (lo + hi) / 2;

	int loVal;
	int hiVal;
	while (lo < hi) {
		loVal = Guess(lo);
		hiVal = Guess(hi);
		mid = (lo + hi) / 2;
		if (hiVal == 0) return mid;
		else if (hiVal == 1) lo = mid + 1;
		else hi = mid;
	}
	return lo;
}

Compilation message

hottercolder.cpp: In function 'int HC(int)':
hottercolder.cpp:8:6: warning: variable 'loVal' set but not used [-Wunused-but-set-variable]
  int loVal;
      ^~~~~
# Verdict Execution time Memory Grader output
1 Correct 27 ms 1272 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 30 ms 1272 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 28 ms 1272 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 757 ms 8312 KB Output isn't correct - alpha = 0.000000000000