Submission #317294

#TimeUsernameProblemLanguageResultExecution timeMemory
317294seedkinHotter Colder (IOI10_hottercolder)C11
25 / 100
744 ms8188 KiB
#include "grader.h"

int HC(int N){

   int low = 1;
   int high = N;   
   int g;
   int h;
   while ( high - low > 1 ) {
      g = Guess(low);
      h = Guess(high);

      if(h == 1) {
         low = (low + high) / 2;
      } else if (h == -1) {
         high = (low + high) / 2;
      } else {
         return (low + high) / 2;
      }
   }
   g = Guess(low);
   h = Guess(high);

   if(h == 1) {
      return high;
   } else {
      return low;
   } 

}

Compilation message (stderr)

hottercolder.c: In function 'HC':
hottercolder.c:7:8: warning: variable 'g' set but not used [-Wunused-but-set-variable]
    7 |    int g;
      |        ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...