結果

問題 No.1133 キムワイプイーター
ユーザー Tna
提出日時 2022-07-13 16:22:15
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 626 bytes
コンパイル時間 226 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 18,876 KB
最終ジャッジ日時 2024-06-24 21:07:20
合計ジャッジ時間 5,827 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 10 WA * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = [int(x) for x in input().split()]
moves = list(input())
maps = []
for i in range(n+1):
    tmp = []
    for j in range(n+1):
        tmp.append("1")
    maps.append(tmp)
# print(maps)

x = y = 0
maps[n-y][n-x] = "0"
for move in moves:
    if move == "U":
        y = y + 1
    elif move == "R":
        x = x + 1
    elif move == "L":
        x = x - 1
    elif move == "D":
        y = y - 1
    maps[n-y][n-x] = "0"
# print(maps)

# maps = map(str, maps)
for i in range(n+1):
    # print(map_row)
    print(" ".join(maps[i]))
    # for map_d in map_row:
    #     # print(map_d)
    #     print("".join(str(map_row)))
0