제출 #317293

#제출 시각아이디문제언어결과실행 시간메모리
317293seedkinHotter Colder (IOI10_hottercolder)C11
0 / 100
10095 ms116728 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 if (h == -1) {
      return low;
   }

}

컴파일 시 표준 에러 (stderr) 메시지

hottercolder.c: In function 'HC':
hottercolder.c:7:8: warning: variable 'g' set but not used [-Wunused-but-set-variable]
    7 |    int g;
      |        ^
hottercolder.c:30:1: warning: control reaches end of non-void function [-Wreturn-type]
   30 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...