Submission #231477

# Submission time Handle Problem Language Result Execution time Memory
231477 2020-05-13T17:49:13 Z Dilshod_Imomov Hotter Colder (IOI10_hottercolder) C++17
77 / 100
777 ms 24640 KB
#include "grader.h"
#include <bits/stdc++.h>
using namespace std;
int HC(int N){
	int l = 1, r = N;
	while ( l < r ) {
		int m = (l + r) / 2;
		// cout << l << ' ' << m << ' ' << r << '\n';
		Guess(l);
		int b = Guess(r);
		if ( b == 1 ) {
			l = m + 1;
		}
		else if ( b == -1 ) {
			if ( l % 2 == r % 2 ) {
				r = m - 1;
			}
			else {
				r = m;
			}
		}
		else {
			return m;
		}
	}
	return r;
}
# Verdict Execution time Memory Grader output
1 Correct 26 ms 1280 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 36 ms 1280 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 27 ms 1408 KB Output is correct
# Verdict Execution time Memory Grader output
1 Partially correct 777 ms 24640 KB Output is partially correct - alpha = 0.068965517241