답안 #317294

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
317294 2020-10-29T10:46:15 Z seedkin Hotter Colder (IOI10_hottercolder) C
25 / 100
744 ms 8188 KB
#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

hottercolder.c: In function 'HC':
hottercolder.c:7:8: warning: variable 'g' set but not used [-Wunused-but-set-variable]
    7 |    int g;
      |        ^
# 결과 실행 시간 메모리 Grader output
1 Correct 23 ms 1280 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 23 ms 1312 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 23 ms 1280 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 744 ms 8188 KB Output isn't correct - alpha = 0.000000000000