답안 #562887

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
562887 2022-05-15T13:29:30 Z saultapia Hotter Colder (IOI10_hottercolder) C++17
0 / 100
801 ms 91480 KB
#include "grader.h"

int HC(int N){
   int low = 1;
   int high = N;

   if(N == 1) return 1;
   int ans = Guess(N / 2);
   int l, r, mid, lftans, rghtans;
   int midans = 0;
   while(low <= high)
   {
      mid = (low + high) >> 1;
      l = (low + mid) >> 1;
      r = (mid + high) >> 1;
      midans = Guess(mid);
      lftans = Guess(l);
      rghtans = Guess(r);
      if(l == r)
      {
         return l;
      }
      if(lftans == -1)
      {
         low = l + 1;
      }
      if(rghtans == -1)
      {
         high = r - 1;
      }
      if(lftans == 1 || lftans == 0)
      {
         high = mid - 1;
      }
      if(rghtans == 1 || rghtans == 0)
      {
         low = mid + 1;
      }

   }
   
}

Compilation message

hottercolder.cpp: In function 'int HC(int)':
hottercolder.cpp:8:8: warning: unused variable 'ans' [-Wunused-variable]
    8 |    int ans = Guess(N / 2);
      |        ^~~
hottercolder.cpp:10:8: warning: variable 'midans' set but not used [-Wunused-but-set-variable]
   10 |    int midans = 0;
      |        ^~~~~~
hottercolder.cpp:42:1: warning: control reaches end of non-void function [-Wreturn-type]
   42 | }
      | ^
# 결과 실행 시간 메모리 Grader output
1 Incorrect 39 ms 11724 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 44 ms 11740 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 50 ms 11740 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 801 ms 91480 KB Output isn't correct - alpha = 0.000000000000