結果

問題 No.246 質問と回答
ユーザー yozayoza
提出日時 2015-07-17 23:42:16
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 253 bytes
コンパイル時間 61 ms
コンパイル使用メモリ 11,468 KB
実行使用メモリ 31,624 KB
平均クエリ数 30.77
最終ジャッジ日時 2023-09-23 07:14:10
合計ジャッジ時間 5,665 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
31,536 KB
testcase_01 AC 122 ms
31,068 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 120 ms
31,032 KB
testcase_06 AC 120 ms
31,192 KB
testcase_07 AC 122 ms
31,392 KB
testcase_08 AC 119 ms
31,080 KB
testcase_09 WA -
testcase_10 AC 119 ms
31,280 KB
testcase_11 AC 121 ms
31,416 KB
testcase_12 WA -
testcase_13 AC 122 ms
31,100 KB
testcase_14 AC 125 ms
31,308 KB
testcase_15 AC 123 ms
30,880 KB
testcase_16 AC 124 ms
31,284 KB
testcase_17 AC 123 ms
31,336 KB
testcase_18 AC 121 ms
31,420 KB
testcase_19 AC 122 ms
31,080 KB
testcase_20 AC 120 ms
30,988 KB
testcase_21 AC 119 ms
31,052 KB
testcase_22 AC 122 ms
30,932 KB
testcase_23 AC 123 ms
31,184 KB
testcase_24 AC 122 ms
31,224 KB
testcase_25 AC 123 ms
30,776 KB
testcase_26 AC 122 ms
30,964 KB
testcase_27 WA -
testcase_28 AC 123 ms
30,964 KB
testcase_29 AC 125 ms
31,624 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

move = 10 ** 9 / 2 + 10000 
border = move

100.times do
  puts "? #{border}"
  STDOUT.flush
  res = gets.to_i == 1 ? 1 : -1
  if move == 1 and res == -1 then
    puts "! #{border - 1}"
    break
  end
  move = [move/2, 1].max
  border += res * move
end
0