Submission #292215

# Submission time Handle Problem Language Result Execution time Memory
292215 2020-09-06T14:18:20 Z amiratou Hotter Colder (IOI10_hottercolder) C++14
50 / 100
794 ms 24424 KB
#include "grader.h"
#include <bits/stdc++.h>

using namespace std;

int HC(int N){
	int l=1,r=N;
	while((r-l)>=2){
		//cerr<<l<<" "<<r<<"\n";
		int a=l+(r-l)/3,b=r-(r-l)/3;
		int med=(a+b)>>1;
		//cerr<<a<<" "<<b<<"\n";
		int A=Guess(a),B=Guess(b);
		if(!B)
			return (a+b)/2;
		if(B==1)l=med+1;
		else r=med;
	}
	//cerr<<l<<" "<<r<<"\n";
	int g=Guess(l),h=Guess(r);
	if(h==1)return r;
	else return l;
}

Compilation message

hottercolder.cpp: In function 'int HC(int)':
hottercolder.cpp:13:7: warning: unused variable 'A' [-Wunused-variable]
   13 |   int A=Guess(a),B=Guess(b);
      |       ^
hottercolder.cpp:20:6: warning: unused variable 'g' [-Wunused-variable]
   20 |  int g=Guess(l),h=Guess(r);
      |      ^
# Verdict Execution time Memory Grader output
1 Correct 25 ms 1280 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 25 ms 1280 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 24 ms 1280 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 794 ms 24424 KB Output isn't correct - alpha = 0.000000000000