結果

問題 No.1133 キムワイプイーター
ユーザー akitsugu777akitsugu777
提出日時 2020-12-02 16:44:17
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 579 ms / 2,000 ms
コード長 351 bytes
コンパイル時間 95 ms
コンパイル使用メモリ 11,004 KB
実行使用メモリ 23,784 KB
最終ジャッジ日時 2023-10-11 11:46:51
合計ジャッジ時間 7,545 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,848 KB
testcase_01 AC 17 ms
7,816 KB
testcase_02 AC 168 ms
12,432 KB
testcase_03 AC 404 ms
19,072 KB
testcase_04 AC 421 ms
19,056 KB
testcase_05 AC 437 ms
20,664 KB
testcase_06 AC 423 ms
19,024 KB
testcase_07 AC 270 ms
15,476 KB
testcase_08 AC 156 ms
12,404 KB
testcase_09 AC 381 ms
17,860 KB
testcase_10 AC 579 ms
23,784 KB
testcase_11 AC 518 ms
22,120 KB
testcase_12 AC 429 ms
19,432 KB
testcase_13 AC 520 ms
23,072 KB
testcase_14 AC 411 ms
18,368 KB
testcase_15 AC 268 ms
14,936 KB
testcase_16 AC 169 ms
12,368 KB
testcase_17 AC 22 ms
8,604 KB
testcase_18 AC 31 ms
8,904 KB
testcase_19 AC 21 ms
8,524 KB
testcase_20 AC 27 ms
8,500 KB
testcase_21 AC 31 ms
8,712 KB
testcase_22 AC 32 ms
8,912 KB
testcase_23 AC 16 ms
7,900 KB
testcase_24 AC 16 ms
7,840 KB
testcase_25 AC 22 ms
8,604 KB
testcase_26 AC 16 ms
7,760 KB
testcase_27 AC 16 ms
7,940 KB
testcase_28 AC 16 ms
7,900 KB
testcase_29 AC 16 ms
7,860 KB
testcase_30 AC 32 ms
8,820 KB
testcase_31 AC 16 ms
7,860 KB
testcase_32 AC 15 ms
7,976 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())
S = input()
L = [[1]*(n+1) for _ in range(n+1)]

x = 0
y = 0
Lx = [0]
Ly = [0]
for s in S:
    if s == 'R':
        x += 1
    elif s == 'L':
        x -= 1
    elif s == 'U':
        y += 1
    else:
        y -= 1
    Lx += [x]
    Ly += [y]

for i, j in zip(Lx, Ly):
    L[j][i] = 0

for i in L[::-1]:
    print(*i)
0