結果

問題 No.514 宝探し3
ユーザー maimai
提出日時 2017-05-06 01:02:41
言語 Ruby
(3.3.0)
結果
AC  
実行時間 107 ms / 2,000 ms
コード長 210 bytes
コンパイル時間 44 ms
コンパイル使用メモリ 11,552 KB
実行使用メモリ 31,496 KB
平均クエリ数 2.75
最終ジャッジ日時 2023-09-23 13:53:18
合計ジャッジ時間 2,491 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 107 ms
31,088 KB
testcase_01 AC 104 ms
31,496 KB
testcase_02 AC 104 ms
30,780 KB
testcase_03 AC 104 ms
30,684 KB
testcase_04 AC 105 ms
30,908 KB
testcase_05 AC 104 ms
30,872 KB
testcase_06 AC 105 ms
31,116 KB
testcase_07 AC 107 ms
31,288 KB
testcase_08 AC 104 ms
30,916 KB
testcase_09 AC 103 ms
31,048 KB
testcase_10 AC 105 ms
31,296 KB
testcase_11 AC 104 ms
31,284 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

def query(x,y)
    puts "#{x} #{y}"
    STDOUT.flush
    return gets.to_i
end

N = 1000000000

p1 = query(0,0)
exit if p1 == 0
p2 = query(N,0)
exit if p2 == 0
print "#{(p1-p2+N)/2} #{(p1+p2-N)/2}";STDOUT.flush
0