結果

問題 No.1133 キムワイプイーター
ユーザー 37zigen
提出日時 2020-08-04 20:08:51
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 746 ms / 2,000 ms
コード長 326 bytes
コンパイル時間 92 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 12,664 KB
最終ジャッジ日時 2024-09-14 19:49:04
合計ジャッジ時間 9,336 ms
ジャッジサーバーID
(参考情報)
judge4 / judge6
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m=map(int,input().split())
n+=1
s=input()
x=y=0
vis=[[1]*n for i in range(n)]
vis[0][0]=0
for c in s:
    if c=='R':
        x+=1
    elif c=='L':
        x-=1
    elif c=='U':
        y+=1
    elif c=='D':
        y-=1
    if 0<=x<n and 0<=y<n:
        vis[y][x]=max(vis[y][x]-1,0)
for i in range(n):
    print(*vis[n-1-i])
0