結果

問題 No.246 質問と回答
ユーザー eigh8_t
提出日時 2015-07-17 22:57:58
言語 Ruby
(3.4.1)
結果
WA  
実行時間 -
コード長 212 bytes
コンパイル時間 395 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 29,272 KB
平均クエリ数 101.00
最終ジャッジ日時 2024-07-16 07:03:01
合計ジャッジ時間 6,110 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 17 WA * 13
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:3: warning: assigned but unused variable - pre
Syntax OK

ソースコード

diff #

n = 500000000
d = 500000000
pre = "1\n"
100.times{
	puts "? " + n.to_s
	$stdout.flush
	d /= 2
	d = 1 if d == 0
	if gets == "1\n"
		n += d
	else
		n -= d
	end
	pre = $_
}
puts "! " + (n+$_.to_i).to_s
$stdout.flush
0