結果

問題 No.1133 キムワイプイーター
ユーザー dangodango
提出日時 2023-06-24 18:53:09
言語 PyPy3
(7.3.15)
結果
MLE  
実行時間 -
コード長 449 bytes
コンパイル時間 369 ms
コンパイル使用メモリ 87,228 KB
実行使用メモリ 837,704 KB
最終ジャッジ日時 2023-09-14 14:31:31
合計ジャッジ時間 11,854 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,304 KB
testcase_01 AC 72 ms
71,200 KB
testcase_02 AC 454 ms
290,436 KB
testcase_03 MLE -
testcase_04 MLE -
testcase_05 MLE -
testcase_06 MLE -
testcase_07 AC 752 ms
437,676 KB
testcase_08 AC 426 ms
264,748 KB
testcase_09 MLE -
testcase_10 MLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
sys.setrecursionlimit(1500000)
n, m = map(int, input().split())
s = input()
mat = [[1] * (n + 1) for _ in range(n + 1)]
mat[n][0] = 0
def loop(i, x, y):
    if i == m:
        return mat
    if s[i] == 'L':
        x -= 1
    elif s[i] == 'R':
        x += 1
    if s[i] == 'D':
        y += 1
    elif s[i] == 'U':
        y -= 1
    mat[y][x] = 0
    return loop(i + 1, x, y)
for row in loop(0, 0, n):
    print(' '.join(map(str, row)))
0