結果

問題 No.1133 キムワイプイーター
ユーザー brthyyjp
提出日時 2020-10-15 13:41:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 109 ms / 2,000 ms
コード長 327 bytes
コンパイル時間 205 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 77,568 KB
最終ジャッジ日時 2024-07-20 19:45:05
合計ジャッジ時間 4,898 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m = map(int, input().split())
s = str(input())
X = [[1]*(n+1) for _ in range(n+1)]
X[0][0] = 0
y, x = 0, 0
for c in s:
    if c == 'U':
        y += 1
    elif c == 'R':
        x += 1
    elif c == 'L':
        x -= 1
    else:
        y -= 1
    X[y][x] = max(0, X[y][x]-1)

for i in reversed(range(n+1)):
    print(*X[i])
0