結果

問題 No.1133 キムワイプイーター
ユーザー dango
提出日時 2023-06-24 18:53:09
言語 PyPy3
(7.3.15)
結果
MLE  
実行時間 -
コード長 449 bytes
コンパイル時間 230 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 848,640 KB
最終ジャッジ日時 2024-07-01 21:53:17
合計ジャッジ時間 11,449 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 3 MLE * 6 -- * 22
権限があれば一括ダウンロードができます

ソースコード

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