結果

問題 No.1133 キムワイプイーター
ユーザー dangodango
提出日時 2023-06-24 18:52:15
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 407 bytes
コンパイル時間 385 ms
コンパイル使用メモリ 86,492 KB
実行使用メモリ 83,696 KB
最終ジャッジ日時 2023-09-14 14:29:08
合計ジャッジ時間 6,928 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,280 KB
testcase_01 AC 69 ms
70,896 KB
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 AC 73 ms
75,440 KB
testcase_18 AC 79 ms
75,400 KB
testcase_19 AC 78 ms
75,392 KB
testcase_20 AC 76 ms
75,368 KB
testcase_21 AC 81 ms
75,556 KB
testcase_22 AC 81 ms
75,408 KB
testcase_23 AC 75 ms
71,168 KB
testcase_24 AC 75 ms
71,176 KB
testcase_25 AC 76 ms
75,496 KB
testcase_26 AC 71 ms
71,264 KB
testcase_27 AC 72 ms
71,376 KB
testcase_28 AC 72 ms
71,120 KB
testcase_29 AC 74 ms
71,248 KB
testcase_30 AC 77 ms
75,312 KB
testcase_31 AC 74 ms
71,288 KB
testcase_32 AC 74 ms
70,900 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())
s = input()
mat = [[1] * (n + 1) for _ in range(n + 1)]
mat[n][0] = 0
def loop(i, x, y):
    if i == m:
        return mat
    if s[i] == 'L':
        x -= 1
    elif s[i] == 'R':
        x += 1
    if s[i] == 'D':
        y += 1
    elif s[i] == 'U':
        y -= 1
    mat[y][x] = 0
    return loop(i + 1, x, y)
for row in loop(0, 0, n):
    print(' '.join(map(str, row)))
0