結果

問題 No.246 質問と回答
ユーザー eigh8_teigh8_t
提出日時 2015-07-17 22:57:58
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 212 bytes
コンパイル時間 377 ms
コンパイル使用メモリ 11,176 KB
実行使用メモリ 31,652 KB
平均クエリ数 101.00
最終ジャッジ日時 2023-09-23 07:09:55
合計ジャッジ時間 6,962 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 129 ms
30,956 KB
testcase_03 AC 136 ms
31,112 KB
testcase_04 AC 133 ms
30,856 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 134 ms
31,044 KB
testcase_08 AC 129 ms
31,084 KB
testcase_09 AC 130 ms
31,072 KB
testcase_10 WA -
testcase_11 AC 129 ms
31,568 KB
testcase_12 AC 130 ms
30,852 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 122 ms
31,088 KB
testcase_17 AC 125 ms
31,012 KB
testcase_18 AC 125 ms
30,984 KB
testcase_19 AC 125 ms
31,052 KB
testcase_20 AC 125 ms
31,336 KB
testcase_21 WA -
testcase_22 AC 123 ms
31,372 KB
testcase_23 AC 123 ms
30,708 KB
testcase_24 WA -
testcase_25 AC 127 ms
31,392 KB
testcase_26 WA -
testcase_27 AC 129 ms
31,184 KB
testcase_28 WA -
testcase_29 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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