結果
問題 |
No.246 質問と回答
|
ユーザー |
![]() |
提出日時 | 2015-07-21 13:40:26 |
言語 | C90 (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 471 bytes |
コンパイル時間 | 216 ms |
コンパイル使用メモリ | 20,480 KB |
実行使用メモリ | 25,476 KB |
平均クエリ数 | 30.07 |
最終ジャッジ日時 | 2024-07-16 07:14:04 |
合計ジャッジ時間 | 3,760 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 30 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:15:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 15 | scanf("%d", &ret); | ^~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> int main(void){ int low=0, high = 1000000000; while( low < high){ int mid = (low+high)/2; int ret; fflush(stdout); fflush(stdin); printf("? %d\n", mid); fflush(stdin); fflush(stdout); scanf("%d", &ret); fflush(stdin); fflush(stdout); if(ret == 1){ high = mid; } if( ret == 0){ low = mid+1; } } fflush(stdin); fflush(stdout); printf("! %d\n", low); fflush(stdin); fflush(stdout); return 0; }