結果

問題 No.513 宝探し2
ユーザー htkbhtkb
提出日時 2017-05-05 23:46:00
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 882 bytes
コンパイル時間 120 ms
コンパイル使用メモリ 10,784 KB
実行使用メモリ 24,348 KB
平均クエリ数 76.25
最終ジャッジ日時 2023-09-23 13:51:01
合計ジャッジ時間 2,895 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 AC 39 ms
23,664 KB
testcase_06 AC 38 ms
23,728 KB
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

print("50000 50000")
d = int(input())
print("50000 40000")
up = int(input())
print("50000 60000")
down = int(input())
print("40000 50000")
left = int(input())
print("60000 50000")
right = int(input())
if d+10000==up:
    y_sign = 1
else:
    y_sign = -1
if d+10000==left:
    x_sign = 1
else:
    x_sign = -1

x, y = (50000, 50000)
prev = d
eq = False
while True:
    if eq:
        newx = x+d*x_sign
        newy = y+d*y_sign
        eq = False
    else:
        newx = x+d*x_sign
        newy = y+d*y_sign
    print("%d %d"%(newx,y))
    mx = int(input())
    if mx==0:
        break
    print("%d %d"%(x, newy))
    my = int(input())
    if my == 0:
        break

    if mx > prev:
        x_sign *= -1
    if my > prev:
        y_sign *= -1

    if mx==my:
        eq = True
    elif mx<my:
        x = newx
    else:
        y = newy
    prev = d
    d = min(min(mx,my)//2, 1)
0