結果

問題 No.514 宝探し3
ユーザー maimai
提出日時 2017-05-05 22:33:48
言語 Ruby
(3.2.2)
結果
AC  
実行時間 97 ms / 2,000 ms
コード長 191 bytes
コンパイル時間 49 ms
コンパイル使用メモリ 11,320 KB
実行使用メモリ 31,488 KB
平均クエリ数 2.75
最終ジャッジ日時 2023-09-23 13:18:41
合計ジャッジ時間 2,085 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 97 ms
30,944 KB
testcase_01 AC 91 ms
31,488 KB
testcase_02 AC 89 ms
31,332 KB
testcase_03 AC 92 ms
31,404 KB
testcase_04 AC 93 ms
31,044 KB
testcase_05 AC 89 ms
30,736 KB
testcase_06 AC 90 ms
31,016 KB
testcase_07 AC 95 ms
30,708 KB
testcase_08 AC 92 ms
31,292 KB
testcase_09 AC 91 ms
30,848 KB
testcase_10 AC 94 ms
31,244 KB
testcase_11 AC 90 ms
30,760 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
query((p1-p2+N)/2,(p1+p2-N)/2)
0