結果

問題 No.331 CodeRunnerでやれ
ユーザー vwxyzvwxyz
提出日時 2023-12-26 06:59:02
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 442 ms / 5,000 ms
コード長 530 bytes
コンパイル時間 118 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 26,120 KB
平均クエリ数 455.65
最終ジャッジ日時 2023-12-26 06:59:10
合計ジャッジ時間 7,470 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 200 ms
26,120 KB
testcase_01 AC 229 ms
26,120 KB
testcase_02 AC 211 ms
26,120 KB
testcase_03 AC 441 ms
26,120 KB
testcase_04 AC 213 ms
26,120 KB
testcase_05 AC 222 ms
26,120 KB
testcase_06 AC 419 ms
26,120 KB
testcase_07 AC 334 ms
26,120 KB
testcase_08 AC 442 ms
26,120 KB
testcase_09 AC 242 ms
26,120 KB
testcase_10 AC 269 ms
26,120 KB
testcase_11 AC 243 ms
26,120 KB
testcase_12 AC 355 ms
26,120 KB
testcase_13 AC 285 ms
26,120 KB
testcase_14 AC 369 ms
26,120 KB
testcase_15 AC 304 ms
26,120 KB
testcase_16 AC 412 ms
26,120 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
sys.setrecursionlimit(10**7)

seen={(0,0)}
dx=[0,1,0,-1]
dy=[1,0,-1,0]


def solve(x,y,d):
    seen.add((x,y))
    for _ in range(4):
        le=input()
        if le=="Merry Christmas!":
            exit()
        le=int(le)
        if not (x+dx[d],y+dy[d]) in seen:
            if le:
                print("F")
                solve(x+dx[d],y+dy[d],d)
                input()
                print("B")
                input()
        print("L")
        d+=1
        d%=4

solve(0,0,0)






####
#...
#v##
#..#
####
0