結果

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

ソースコード

diff #

"""
NG
"""
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][x] = "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][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