最后一块测试RE
查看原帖
最后一块测试RE
126570
zaxhr楼主2020/5/7 21:58
#include <stdio.h>

int main() {
  int State;
  int top = 1000000000;
  int bot = 1;
  int ans;
  while (1==1) {
    ans = (top + bot) >> 1;
    printf("%d\n", ans);
    fflush(stdout);
    scanf("%d", &State);
    if (State == 0) {
      break;
    } else if (State == 1) {
      top = ans;
    } else if (State == -1){
      bot = ans;
    }
  }
  return 0;
}

本人过菜,前来询问

2020/5/7 21:58
加载中...