結果
| 問題 | No.246 質問と回答 |
| コンテスト | |
| ユーザー |
くれちー
|
| 提出日時 | 2016-12-27 16:14:56 |
| 言語 | C90(gcc15) (gcc 15.2.0) |
| 結果 |
AC
|
| 実行時間 | 74 ms / 2,000 ms |
| コード長 | 287 bytes |
| 記録 | |
| コンパイル時間 | 162 ms |
| コンパイル使用メモリ | 35,256 KB |
| 最終ジャッジ日時 | 2026-02-24 00:00:57 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 30 |
ソースコード
#include <stdio.h>
int main() {
int top = 1, tail = 1e9, b;
while (1) {
printf("? %d\n", (top + tail) / 2);
fflush(stdout);
scanf("%d", &b);
if (b) top = (top + tail) / 2;
else tail = (top + tail) / 2;
if (top == tail - 1) break;
}
printf("! %d\n", top);
return 0;
}
くれちー