結果

問題 No.514 宝探し3
ユーザー cympfhcympfh
提出日時 2017-05-05 22:57:03
言語 Ruby
(3.3.0)
結果
AC  
実行時間 102 ms / 2,000 ms
コード長 235 bytes
コンパイル時間 105 ms
コンパイル使用メモリ 11,528 KB
実行使用メモリ 31,544 KB
平均クエリ数 3.00
最終ジャッジ日時 2023-09-23 13:28:06
合計ジャッジ時間 2,304 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 99 ms
31,136 KB
testcase_01 AC 97 ms
31,544 KB
testcase_02 AC 100 ms
30,828 KB
testcase_03 AC 102 ms
30,916 KB
testcase_04 AC 99 ms
30,776 KB
testcase_05 AC 95 ms
31,228 KB
testcase_06 AC 100 ms
31,432 KB
testcase_07 AC 97 ms
31,268 KB
testcase_08 AC 99 ms
31,452 KB
testcase_09 AC 94 ms
31,328 KB
testcase_10 AC 100 ms
31,120 KB
testcase_11 AC 96 ms
30,800 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

M = 1000000000

def get(x, y)

  x = [M, [0, x].max].min
  y = [M, [0, y].max].min

  puts "#{x} #{y}"
  STDOUT.flush
  d = gets.to_i
  return d
end

d0 = get(0, 0)
d1 = get(M, 0)

x = (M + d0 - d1) / 2
y = (d0 + d1 - M) / 2
get(x, y)
0