結果

問題 No.1133 キムワイプイーター
ユーザー tomoyaatcodertomoyaatcoder
提出日時 2020-07-30 03:09:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 111 ms / 2,000 ms
コード長 358 bytes
コンパイル時間 1,984 ms
コンパイル使用メモリ 86,832 KB
実行使用メモリ 79,020 KB
最終ジャッジ日時 2023-09-13 21:48:07
合計ジャッジ時間 5,237 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,444 KB
testcase_01 AC 72 ms
71,532 KB
testcase_02 AC 101 ms
77,240 KB
testcase_03 AC 109 ms
78,924 KB
testcase_04 AC 108 ms
78,580 KB
testcase_05 AC 106 ms
79,020 KB
testcase_06 AC 102 ms
78,128 KB
testcase_07 AC 99 ms
77,744 KB
testcase_08 AC 96 ms
78,024 KB
testcase_09 AC 104 ms
77,936 KB
testcase_10 AC 110 ms
78,948 KB
testcase_11 AC 111 ms
78,824 KB
testcase_12 AC 109 ms
78,856 KB
testcase_13 AC 110 ms
78,832 KB
testcase_14 AC 93 ms
77,544 KB
testcase_15 AC 97 ms
77,492 KB
testcase_16 AC 96 ms
77,040 KB
testcase_17 AC 81 ms
76,520 KB
testcase_18 AC 81 ms
76,620 KB
testcase_19 AC 80 ms
76,500 KB
testcase_20 AC 80 ms
76,648 KB
testcase_21 AC 79 ms
76,636 KB
testcase_22 AC 80 ms
76,424 KB
testcase_23 AC 72 ms
71,236 KB
testcase_24 AC 71 ms
71,528 KB
testcase_25 AC 81 ms
76,380 KB
testcase_26 AC 70 ms
71,300 KB
testcase_27 AC 71 ms
71,332 KB
testcase_28 AC 72 ms
71,356 KB
testcase_29 AC 70 ms
71,420 KB
testcase_30 AC 81 ms
76,260 KB
testcase_31 AC 71 ms
71,328 KB
testcase_32 AC 69 ms
71,428 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())
s = input()
ans = [[1 for j in range(n + 1)] for i in range(n + 1)]
ans[-1][0] = 0
now_y = n
now_x = 0
for i in range(m):
    if s[i] == "U":
        now_y -= 1
    elif s[i] == "R":
        now_x += 1
    elif s[i] == "L":
        now_x -= 1
    else:
        now_y += 1
    ans[now_y][now_x] = 0
for i in ans:
    print(*i)
0