結果

問題 No.1133 キムワイプイーター
ユーザー r_ishida
提出日時 2026-03-03 00:11:15
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 630 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 4,468 ms
コンパイル使用メモリ 85,300 KB
実行使用メモリ 78,332 KB
最終ジャッジ日時 2026-03-03 00:11:25
合計ジャッジ時間 3,434 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 10 WA * 21
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import math
import sys
def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

n, m = MI()
s = S()

k = [[1]*(n+1) for _ in range(n+1)]
x = 0
y = 0

k[x][n-y] = 0
for i in range(m):
    if s[i] == 'U':
        x += 1
    elif s[i] == 'D':
        x -= 1
    elif s[i] == 'R':
        y += 1
    elif s[i] == 'L':
        y -= 1
    k[x][n-y] = 0

for i in range(n, -1, -1):
    print(*k[i])
0