제출 #973921

#제출 시각아이디문제언어결과실행 시간메모리
973921sleepntsheepGuess the number (BOI20_guess)C11
0 / 100
0 ms344 KiB
#include<stdio.h> int n; int main() { scanf("%d",&n); int lb=-1,ub=n+1; while(ub-lb>1) { int mid=lb+(ub-lb)/2,x; printf("? %d\n",mid);fflush(stdout); scanf("%d",&x); if(x==0)return printf("= %d\n",mid),fflush(stdout),0; if(x<0)lb=mid; else ub=mid; } }

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

Guess.c: In function 'main':
Guess.c:6:5: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
    6 |     scanf("%d",&n);
      |     ^~~~~~~~~~~~~~
Guess.c:12:9: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |         scanf("%d",&x);
      |         ^~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...