結果

問題 No.513 宝探し2
ユーザー maimai
提出日時 2017-05-05 22:33:21
言語 Ruby
(3.3.0)
結果
AC  
実行時間 114 ms / 2,000 ms
コード長 187 bytes
コンパイル時間 186 ms
コンパイル使用メモリ 11,564 KB
実行使用メモリ 31,584 KB
平均クエリ数 2.75
最終ジャッジ日時 2023-09-24 01:02:26
合計ジャッジ時間 2,610 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 114 ms
31,328 KB
testcase_01 AC 109 ms
31,040 KB
testcase_02 AC 106 ms
31,324 KB
testcase_03 AC 106 ms
30,792 KB
testcase_04 AC 107 ms
31,584 KB
testcase_05 AC 107 ms
30,800 KB
testcase_06 AC 105 ms
31,320 KB
testcase_07 AC 105 ms
30,700 KB
testcase_08 AC 105 ms
30,716 KB
testcase_09 AC 104 ms
31,492 KB
testcase_10 AC 109 ms
31,164 KB
testcase_11 AC 108 ms
31,396 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

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

N = 100000

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