結果

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

テストケース

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

ソースコード

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)

while True:
    print("%d %d\n"%(x+(d*x_sign),y))
    mx = int(input())
    if mx==0:
        break
    print("%d %d\n"%(x, y+(d*y_sign)))
    my = int(input())
    if my == 0:
        break
    if mx==my:
        if mx > d:
            x_sign*=-1
            y_sign*=-1
        x += mx*x_sign//2
        y += my*y_sign//2
    elif mx<my:
        x += d*x_sign
        y_sign*=-1
    else:
        y += d*y_sign
        x_sign*=-1
    d = min(min(mx,my)//2, 1)
0