結果

問題 No.1133 キムワイプイーター
ユーザー hir355hir355
提出日時 2020-08-01 21:32:35
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 236 ms / 2,000 ms
コード長 294 bytes
コンパイル時間 168 ms
コンパイル使用メモリ 10,692 KB
実行使用メモリ 9,812 KB
最終ジャッジ日時 2023-09-22 16:48:42
合計ジャッジ時間 5,484 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,920 KB
testcase_01 AC 16 ms
7,804 KB
testcase_02 AC 79 ms
8,764 KB
testcase_03 AC 169 ms
9,316 KB
testcase_04 AC 180 ms
9,280 KB
testcase_05 AC 187 ms
9,364 KB
testcase_06 AC 183 ms
9,368 KB
testcase_07 AC 125 ms
8,976 KB
testcase_08 AC 77 ms
8,680 KB
testcase_09 AC 154 ms
9,388 KB
testcase_10 AC 236 ms
9,812 KB
testcase_11 AC 219 ms
9,532 KB
testcase_12 AC 182 ms
9,296 KB
testcase_13 AC 214 ms
9,528 KB
testcase_14 AC 163 ms
9,472 KB
testcase_15 AC 113 ms
8,708 KB
testcase_16 AC 80 ms
8,752 KB
testcase_17 AC 21 ms
8,500 KB
testcase_18 AC 30 ms
8,852 KB
testcase_19 AC 21 ms
8,576 KB
testcase_20 AC 28 ms
8,584 KB
testcase_21 AC 30 ms
8,708 KB
testcase_22 AC 31 ms
8,712 KB
testcase_23 AC 16 ms
7,884 KB
testcase_24 AC 15 ms
7,848 KB
testcase_25 AC 21 ms
8,488 KB
testcase_26 AC 16 ms
7,832 KB
testcase_27 AC 15 ms
7,832 KB
testcase_28 AC 15 ms
7,800 KB
testcase_29 AC 15 ms
7,788 KB
testcase_30 AC 31 ms
8,712 KB
testcase_31 AC 16 ms
7,772 KB
testcase_32 AC 15 ms
7,952 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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