結果

問題 No.246 質問と回答
コンテスト
ユーザー mban
提出日時 2017-01-04 02:13:17
言語 C90(gcc15)
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -std=c90 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
WA  
実行時間 -
コード長 295 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 131 ms
コンパイル使用メモリ 35,508 KB
最終ジャッジ日時 2026-02-24 00:03:01
ジャッジサーバーID
(参考情報)
judge2 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 30
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include<stdio.h>

int plus = 1 << 30;
int ans = 0;
int main(void) {
	int i;
	int w;
	int r;
	for (i = 0; i < 30; i++) {
		plus /= 2;
		w = ans + plus;
		printf("? %d\n", w);
		fflush(0);
		scanf("%d", &r);
		if (r == 0) {
			ans = w;
		}
		
	}
	printf("! %d\n", ans+1);
	fflush(0);
	return 0;
}
0