結果

問題 No.246 質問と回答
ユーザー suppy193suppy193
提出日時 2017-01-13 11:46:02
言語 Ruby
(3.3.0)
結果
AC  
実行時間 131 ms / 2,000 ms
コード長 229 bytes
コンパイル時間 54 ms
コンパイル使用メモリ 11,248 KB
実行使用メモリ 31,448 KB
平均クエリ数 30.87
最終ジャッジ日時 2023-09-23 20:20:54
合計ジャッジ時間 5,886 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
30,856 KB
testcase_01 AC 127 ms
31,424 KB
testcase_02 AC 130 ms
31,304 KB
testcase_03 AC 127 ms
30,928 KB
testcase_04 AC 124 ms
31,324 KB
testcase_05 AC 125 ms
31,368 KB
testcase_06 AC 124 ms
30,740 KB
testcase_07 AC 124 ms
31,000 KB
testcase_08 AC 126 ms
31,448 KB
testcase_09 AC 126 ms
30,772 KB
testcase_10 AC 124 ms
31,092 KB
testcase_11 AC 126 ms
31,160 KB
testcase_12 AC 126 ms
30,952 KB
testcase_13 AC 125 ms
31,260 KB
testcase_14 AC 129 ms
31,284 KB
testcase_15 AC 131 ms
31,092 KB
testcase_16 AC 127 ms
31,320 KB
testcase_17 AC 129 ms
30,900 KB
testcase_18 AC 128 ms
31,008 KB
testcase_19 AC 130 ms
31,272 KB
testcase_20 AC 127 ms
30,904 KB
testcase_21 AC 126 ms
31,364 KB
testcase_22 AC 124 ms
31,284 KB
testcase_23 AC 129 ms
31,044 KB
testcase_24 AC 129 ms
30,900 KB
testcase_25 AC 125 ms
30,912 KB
testcase_26 AC 125 ms
30,720 KB
testcase_27 AC 126 ms
30,920 KB
testcase_28 AC 127 ms
30,828 KB
testcase_29 AC 128 ms
31,148 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

min_x = 0
max_x = 10**9
100.times do
	x = (max_x - min_x) / 2 + min_x
	print "? #{x}\n"
	STDOUT.flush
	y = gets.strip.to_i
	if y == 1
		min_x = x
	else
		max_x = x
	end
	if max_x - min_x == 1
		break
	end
end
print "! #{min_x}\n"
0