Submission #71178

# Submission time Handle Problem Language Result Execution time Memory
71178 2018-08-24T07:46:40 Z chhun Hotter Colder (IOI10_hottercolder) C++14
0 / 100
789 ms 24692 KB
//#include <stdio.h>
#include "grader.h"
int cnt = -0x3f3f3f3f, ori;
int HC_(int l,int r) {
	if (r - l <= 3) {
		int g = Guess(l);
		for (int i = l; i <= r; i++) {
			if (Guess(i) == -1)return i-1;
		}
		return r;
	}
	int g1 = Guess(l);
	int g2 = Guess(r);
	if (g2 == 0)
		return (l + r + 1) / 2;
	else if (g2 == 1) {
		return HC_((r + l + 1) / 2+1, r);
	}
	else if (g2 == -1) {
		return HC_(l, (l + r-1) / 2);
	}
}
int HC(int N) {
	int g1, g2;
	g1 = Guess(1);
	g2 = Guess(N);
	if (g2 == 0)
		return (N + 1) / 2;
	else if (g2 == 1) {
		return HC_((N + 1) / 2 + 1, N);
	}
	else if (g2 == -1) {
		return HC_(1, N / 2);
	}
}

Compilation message

hottercolder.cpp: In function 'int HC_(int, int)':
hottercolder.cpp:6:7: warning: unused variable 'g' [-Wunused-variable]
   int g = Guess(l);
       ^
hottercolder.cpp:12:6: warning: unused variable 'g1' [-Wunused-variable]
  int g1 = Guess(l);
      ^~
hottercolder.cpp: In function 'int HC(int)':
hottercolder.cpp:24:6: warning: variable 'g1' set but not used [-Wunused-but-set-variable]
  int g1, g2;
      ^~
hottercolder.cpp: In function 'int HC_(int, int)':
hottercolder.cpp:22:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
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 32 ms 3320 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 31 ms 3448 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 33 ms 3424 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 789 ms 24692 KB Output isn't correct - alpha = 0.000000000000