結果

問題 No.246 質問と回答
ユーザー eigh8_t
提出日時 2015-07-17 22:56:27
言語 Ruby
(3.4.1)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 197 bytes
コンパイル時間 305 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 46,836 KB
最終ジャッジ日時 2024-07-16 19:42:55
合計ジャッジ時間 6,619 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other TLE * 1 -- * 29
権限があれば一括ダウンロードができます
コンパイルメッセージ
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
	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