結果
| 問題 | No.246 質問と回答 |
| コンテスト | |
| ユーザー |
suppy193
|
| 提出日時 | 2017-01-13 11:37:42 |
| 言語 | Ruby (3.4.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 335 bytes |
| 記録 | |
| コンパイル時間 | 167 ms |
| コンパイル使用メモリ | 7,552 KB |
| 実行使用メモリ | 29,400 KB |
| 平均クエリ数 | 30.93 |
| 最終ジャッジ日時 | 2024-07-16 12:15:52 |
| 合計ジャッジ時間 | 5,772 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 WA * 29 |
コンパイルメッセージ
Main.rb:3: warning: assigned but unused variable - ans Syntax OK
ソースコード
min_x = 0
max_x = 10**9
ans = 140
100.times do
x = (max_x - min_x) / 2 + min_x
print "? #{x}\n"
#print "? #{x} #{min_x} #{max_x}\n"
STDOUT.flush
y = gets.strip.to_i
#if x >= ans
# y = 1
#else
# y = 0
#end
if y == 1
max_x = x
else
min_x = x
end
if max_x - min_x == 1
break
end
end
max_x = 202
print "! #{max_x}\n"
suppy193