結果

問題 No.331 CodeRunnerでやれ
ユーザー vwxyzvwxyz
提出日時 2023-12-26 06:27:05
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 1,036 bytes
コンパイル時間 180 ms
コンパイル使用メモリ 12,032 KB
実行使用メモリ 123,588 KB
平均クエリ数 2.47
最終ジャッジ日時 2023-12-26 06:27:14
合計ジャッジ時間 8,318 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 214 ms
26,120 KB
testcase_01 AC 193 ms
26,120 KB
testcase_02 AC 209 ms
26,120 KB
testcase_03 TLE -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
sys.setrecursionlimit(10**7)

N=int(input())
seen={(0,0)}

def solve(x,y):
    seen.add((x,y))
    le=input()
    if le=="Merry Christmas!":
        exit()
    le=int(le)
    if not (x+1,y) in seen:
        if le:
            print("F")
            solve(x+1,y)
            input()
            print("B")

    print("L")
    le=input()
    if le=="Merry Christmas!":
        exit()
    le=int(le)
    if not (x,y+1) in seen:
        if le:
            print("F")
            solve(x,y+1)
            input()
            print("B")

    print("L")
    le=input()
    if le=="Merry Christmas!":
        exit()
    le=int(le)
    if not (x-1,y) in seen:
        if le:
            print("F")
            solve(x-1,y)
            input()
            print("B")
    
    print("L")
    le=input()
    if le=="Merry Christmas!":
        exit()
    le=int(le)
    if not (x,y-1) in seen:
        if le:
            print("F")
            solve(x,y-1)
            input()
            print("B")
    print("L")

print("F")
solve(0,0)
0