結果

問題 No.1133 キムワイプイーター
ユーザー trineutrontrineutron
提出日時 2020-07-30 01:43:19
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 239 ms / 2,000 ms
コード長 317 bytes
コンパイル時間 486 ms
コンパイル使用メモリ 10,708 KB
実行使用メモリ 9,824 KB
最終ジャッジ日時 2023-09-13 15:44:36
合計ジャッジ時間 5,526 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,868 KB
testcase_01 AC 15 ms
7,748 KB
testcase_02 AC 80 ms
8,700 KB
testcase_03 AC 167 ms
9,432 KB
testcase_04 AC 176 ms
9,548 KB
testcase_05 AC 187 ms
9,348 KB
testcase_06 AC 174 ms
9,548 KB
testcase_07 AC 123 ms
9,000 KB
testcase_08 AC 79 ms
8,880 KB
testcase_09 AC 157 ms
9,324 KB
testcase_10 AC 239 ms
9,824 KB
testcase_11 AC 217 ms
9,708 KB
testcase_12 AC 181 ms
9,340 KB
testcase_13 AC 216 ms
9,660 KB
testcase_14 AC 167 ms
9,304 KB
testcase_15 AC 112 ms
9,000 KB
testcase_16 AC 80 ms
8,876 KB
testcase_17 AC 21 ms
8,496 KB
testcase_18 AC 30 ms
8,764 KB
testcase_19 AC 21 ms
8,624 KB
testcase_20 AC 26 ms
8,768 KB
testcase_21 AC 30 ms
8,836 KB
testcase_22 AC 31 ms
8,848 KB
testcase_23 AC 16 ms
7,876 KB
testcase_24 AC 16 ms
7,912 KB
testcase_25 AC 21 ms
8,652 KB
testcase_26 AC 16 ms
7,900 KB
testcase_27 AC 16 ms
7,828 KB
testcase_28 AC 15 ms
7,860 KB
testcase_29 AC 15 ms
7,800 KB
testcase_30 AC 31 ms
8,868 KB
testcase_31 AC 16 ms
7,820 KB
testcase_32 AC 15 ms
7,832 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())
s = input()
a = [[1] * (n + 1) for i in range(n + 1)]
a[0][0] = 0
x, y = 0, 0
for c in s:
    if c == 'U':
        y += 1
    elif c == 'R':
        x += 1
    elif c == 'L':
        x -= 1
    elif c == 'D':
        y -= 1
    a[y][x] = 0
for i in range(n, -1, -1):
    print(*a[i])
0