結果

問題 No.513 宝探し2
ユーザー simansiman
提出日時 2020-12-10 17:38:25
言語 Ruby
(3.3.0)
結果
AC  
実行時間 93 ms / 2,000 ms
コード長 174 bytes
コンパイル時間 314 ms
コンパイル使用メモリ 11,312 KB
実行使用メモリ 31,348 KB
平均クエリ数 3.00
最終ジャッジ日時 2023-09-24 02:49:21
合計ジャッジ時間 2,988 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
30,908 KB
testcase_01 AC 87 ms
31,312 KB
testcase_02 AC 93 ms
31,056 KB
testcase_03 AC 90 ms
30,872 KB
testcase_04 AC 88 ms
30,988 KB
testcase_05 AC 87 ms
31,268 KB
testcase_06 AC 87 ms
30,884 KB
testcase_07 AC 87 ms
30,808 KB
testcase_08 AC 89 ms
31,272 KB
testcase_09 AC 91 ms
31,348 KB
testcase_10 AC 88 ms
31,136 KB
testcase_11 AC 89 ms
31,348 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

def query(x, y)
  STDOUT.puts("%d %d" % [x, y])
  STDOUT.flush
  gets.to_i
end

d1 = query(0, 0)
d2 = query(0, 100_000)

x = (d1 + d2 - 100_000) / 2
y = (d1 - x)
query(x, y)
0