結果

問題 No.331 CodeRunnerでやれ
ユーザー tjaketjake
提出日時 2015-12-24 00:48:15
言語 Python2
(2.7.18)
結果
AC  
実行時間 364 ms / 5,000 ms
コード長 530 bytes
コンパイル時間 657 ms
コンパイル使用メモリ 6,636 KB
実行使用メモリ 24,180 KB
平均クエリ数 398.35
最終ジャッジ日時 2023-09-23 22:42:24
合計ジャッジ時間 6,517 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 153 ms
23,344 KB
testcase_01 AC 157 ms
23,668 KB
testcase_02 AC 165 ms
23,652 KB
testcase_03 AC 364 ms
24,036 KB
testcase_04 AC 144 ms
23,556 KB
testcase_05 AC 161 ms
23,352 KB
testcase_06 AC 333 ms
23,544 KB
testcase_07 AC 181 ms
23,844 KB
testcase_08 AC 359 ms
24,180 KB
testcase_09 AC 203 ms
23,628 KB
testcase_10 AC 274 ms
23,640 KB
testcase_11 AC 227 ms
24,004 KB
testcase_12 AC 229 ms
23,424 KB
testcase_13 AC 248 ms
23,412 KB
testcase_14 AC 255 ms
23,908 KB
testcase_15 AC 228 ms
23,616 KB
testcase_16 AC 338 ms
23,616 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
flush = sys.stdout.flush
used = [[0]*50 for i in range(50)]
dx = [-1, 0, 1, 0]
dy = [0, -1, 0, 1]
r4 = range(4)

def dfs(x, y, di):
    for k in r4:
        s = raw_input()
        if s[0]=="M": exit(0)
        d = int(s)
        nd = (di + k) % 4
        nx = x + dx[nd]; ny = y + dy[nd]
        if d and not used[ny][nx]:
            print"F"; flush()
            used[ny][nx] = 1
            dfs(nx, ny, nd)
            input()
        print"R"; flush()
    input()
    print"B"; flush()
used[0][0] = 1
dfs(0, 0, 0)
0