Submission #204945

# Submission time Handle Problem Language Result Execution time Memory
204945 2020-02-27T14:12:25 Z jasony123123 Hotter Colder (IOI10_hottercolder) C++11
50 / 100
708 ms 21112 KB
#include "grader.h"

#include <bits/stdc++.h>
//#include <ext/pb_ds/tree_policy.hpp>
//#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
//using namespace __gnu_pbds;
#define FOR(i,start,end) for(int i=start;i<(int)(end);i++)
#define FORE(i,start,end) for(int i=start;i<=(int)end;i++)
#define RFORE(i,start,end) for(int i = start; i>=end; i--)
#define all(a) a.begin(), a.end()
#define v vector
typedef long long ll;
typedef pair<int, int > pii;
//template <class T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template<class T> void minn(T &a, T b) { a = min(a, b); }
template<class T> void maxx(T &a, T b) { a = max(a, b); }


int go(int L, int R){
/*	LIMIT--;
	if(!LIMIT){
		exit(0);
	}

	cout << "go " << L << " to " << R << endl;
*/
	if(L==R) return L;

	int M = (L+R)/2;

	Guess(M);
	int res = Guess(M+1);

	if(res == 0) assert(0);
	else if (res == 1) return go(M+1,R); // hotter
	else go(L,M); // colder
}

int HC(int N){
	return go(1,N);
}

Compilation message

hottercolder.cpp: In function 'int go(int, int)':
hottercolder.cpp:38:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
# Verdict Execution time Memory Grader output
1 Correct 26 ms 1272 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 26 ms 1272 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 26 ms 1364 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 708 ms 21112 KB Output isn't correct - alpha = 0.000000000000