Submission #26655

#TimeUsernameProblemLanguageResultExecution timeMemory
26655grandsHotter Colder (IOI10_hottercolder)C++14
25 / 100
790 ms8184 KiB
#include "grader.h" int HC(int N){ int prev = 1; int now = N; int h = Guess(prev); int g; while (1){ g = Guess(now); //printf("%d %d\n", prev, now); if (g == 0) { //printf("%d\n", (prev + now) / 2); return (prev+now) / 2; } if (g < 0) { if (prev + 1 == now){ //printf("hot "); return prev; } else if (now + 1 == prev){ //printf("hot2 "); return prev; } h = Guess(prev); now = ((prev + now) / 2); } if (g > 0){ if (prev + 1 == now){ //printf("cold1 "); return now; } else if(now+1==prev){ //printf("cold2 "); return now; } int temp = ((prev + now) / 2 ); prev = now; now = temp; h = g; } } }

Compilation message (stderr)

hottercolder.cpp: In function 'int HC(int)':
hottercolder.cpp:6:6: warning: variable 'h' set but not used [-Wunused-but-set-variable]
  int h = Guess(prev);
      ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...