結果

問題 No.246 質問と回答
ユーザー yozayoza
提出日時 2015-07-18 00:00:50
言語 Ruby
(3.3.0)
結果
AC  
実行時間 131 ms / 2,000 ms
コード長 321 bytes
コンパイル時間 584 ms
コンパイル使用メモリ 11,304 KB
実行使用メモリ 31,424 KB
平均クエリ数 101.00
最終ジャッジ日時 2023-09-23 19:59:14
合計ジャッジ時間 7,012 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
30,720 KB
testcase_01 AC 130 ms
31,340 KB
testcase_02 AC 126 ms
30,888 KB
testcase_03 AC 129 ms
31,368 KB
testcase_04 AC 127 ms
30,868 KB
testcase_05 AC 129 ms
30,956 KB
testcase_06 AC 128 ms
31,256 KB
testcase_07 AC 128 ms
31,040 KB
testcase_08 AC 128 ms
30,652 KB
testcase_09 AC 126 ms
30,868 KB
testcase_10 AC 127 ms
30,824 KB
testcase_11 AC 128 ms
30,856 KB
testcase_12 AC 128 ms
31,320 KB
testcase_13 AC 128 ms
30,804 KB
testcase_14 AC 128 ms
30,940 KB
testcase_15 AC 129 ms
31,304 KB
testcase_16 AC 130 ms
31,308 KB
testcase_17 AC 129 ms
31,076 KB
testcase_18 AC 129 ms
30,868 KB
testcase_19 AC 130 ms
30,748 KB
testcase_20 AC 131 ms
30,836 KB
testcase_21 AC 131 ms
30,840 KB
testcase_22 AC 130 ms
30,960 KB
testcase_23 AC 128 ms
31,424 KB
testcase_24 AC 129 ms
31,396 KB
testcase_25 AC 127 ms
30,944 KB
testcase_26 AC 128 ms
30,932 KB
testcase_27 AC 129 ms
31,240 KB
testcase_28 AC 129 ms
31,024 KB
testcase_29 AC 129 ms
30,908 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

move = 10 ** 9 / 2 + 10000 
border = move
count_list = {}

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

puts "! #{count_list.sort_by{|k, v| v}.reverse()[0..1].map{|k, v| k}.min}"
0