結果

問題 No.513 宝探し2
ユーザー h_nosonh_noson
提出日時 2017-06-13 21:23:28
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 48 ms / 2,000 ms
コード長 528 bytes
コンパイル時間 283 ms
コンパイル使用メモリ 10,772 KB
実行使用メモリ 24,492 KB
平均クエリ数 48.00
最終ジャッジ日時 2023-09-24 01:19:48
合計ジャッジ時間 1,963 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 48 ms
24,172 KB
testcase_01 AC 41 ms
23,724 KB
testcase_02 AC 41 ms
23,924 KB
testcase_03 AC 41 ms
23,964 KB
testcase_04 AC 42 ms
23,848 KB
testcase_05 AC 39 ms
23,932 KB
testcase_06 AC 40 ms
23,908 KB
testcase_07 AC 39 ms
23,840 KB
testcase_08 AC 40 ms
24,492 KB
testcase_09 AC 39 ms
23,852 KB
testcase_10 AC 41 ms
23,968 KB
testcase_11 AC 41 ms
24,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

lx = ly = 0
rx = ry = 10**5 + 1

while lx + 1 < rx:
    m = (lx + rx) // 2
    print("%d %d" % (m-1, 0))
    d1 = int(input())
    if d1 == 0: exit(0)
    print("%d %d" % (m, 0))
    d2 = int(input())
    if d2 == 0: exit(0)
    if d1 > d2:
        lx = m
    else:
        rx = m
while ly + 1 < ry:
    m = (ly + ry) // 2
    print("%d %d" % (lx,m-1))
    d1 = int(input())
    if d1 == 0: exit(0)
    print("%d %d" % (lx,m))
    d2 = int(input())
    if d2 == 0: exit(0)
    if d1 > d2:
        ly = m
    else:
        ry = m
0