結果

問題 No.513 宝探し2
ユーザー ttrttr
提出日時 2020-06-06 22:26:28
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 560 bytes
コンパイル時間 101 ms
コンパイル使用メモリ 10,940 KB
実行使用メモリ 24,504 KB
平均クエリ数 82.58
最終ジャッジ日時 2023-09-24 03:38:53
合計ジャッジ時間 2,354 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
24,360 KB
testcase_01 RE -
testcase_02 RE -
testcase_03 AC 41 ms
24,036 KB
testcase_04 RE -
testcase_05 AC 42 ms
23,452 KB
testcase_06 RE -
testcase_07 RE -
testcase_08 AC 41 ms
23,580 KB
testcase_09 AC 41 ms
23,532 KB
testcase_10 AC 43 ms
23,720 KB
testcase_11 AC 42 ms
23,556 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

lx = 0
rx = 10**5
Y = -1

while lx < rx:
    print(lx, Y)
    tl = int(input())
    print(rx, Y)
    tr = int(input())
    mx = (lx+rx)//2
    if lx+1 == rx:
        if tl > tr:
            mx += 1
        break
    if tl < tr:
        rx = mx
    else:
        lx = mx

ly = 0
ry = 10**5
while ly < ry:
    print(mx-1, ly)
    tl = int(input())
    print(mx-1, ry)
    tr = int(input())
    my = (ly+ry)//2
    if ly+1 == ry:
        if tl > tr:
            my += 1
        break
    if tl < tr:
        ry = my
    elif tr < tl:
        ly = my
print(mx, my)
0