Submission #232353

# Submission time Handle Problem Language Result Execution time Memory
232353 2020-05-16T19:57:28 Z crossing0ver Hotter Colder (IOI10_hottercolder) C++17
0 / 100
816 ms 82808 KB
#include<bits/stdc++.h>
#include "grader.h"
using namespace std;


int HC(int N){
	if (N == 1) return 1;
	int m = N/2;
	int ask,last = Guess(m);
	int l = 1, r = N;
	int x = (3*N + 3)/4;
	ask = Guess(x);
	while (l != r)
	{
		
	if (ask == 0) {
		return (last + x)/2;		
	}
	if (ask == 1) {
		if (last < x)
		l = (last + x + 1)/2;
		else r = (x + last -1)/2;
	}
	else {
		if (last < x) 
		r = (last + x - 1)/2;
		else l = (last + x + 1)/2;
	}
	if (l == r) return l;
	last = x;
	x = (l + r)/2;
	ask = Guess(x);    
	}

}

Compilation message

hottercolder.cpp: In function 'int HC(int)':
hottercolder.cpp:35:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
# Verdict Execution time Memory Grader output
1 Incorrect 38 ms 9976 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 38 ms 9984 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 38 ms 9976 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 816 ms 82808 KB Output isn't correct - alpha = 0.000000000000