結果

問題 No.1133 キムワイプイーター
ユーザー brthyyjpbrthyyjp
提出日時 2020-10-15 13:41:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 115 ms / 2,000 ms
コード長 327 bytes
コンパイル時間 1,474 ms
コンパイル使用メモリ 87,016 KB
実行使用メモリ 78,736 KB
最終ジャッジ日時 2023-09-28 01:09:40
合計ジャッジ時間 6,633 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
71,360 KB
testcase_01 AC 65 ms
71,440 KB
testcase_02 AC 95 ms
77,416 KB
testcase_03 AC 107 ms
77,928 KB
testcase_04 AC 106 ms
78,244 KB
testcase_05 AC 107 ms
78,108 KB
testcase_06 AC 105 ms
78,092 KB
testcase_07 AC 99 ms
78,460 KB
testcase_08 AC 94 ms
77,656 KB
testcase_09 AC 104 ms
77,824 KB
testcase_10 AC 115 ms
78,736 KB
testcase_11 AC 110 ms
78,476 KB
testcase_12 AC 110 ms
78,232 KB
testcase_13 AC 111 ms
78,280 KB
testcase_14 AC 96 ms
77,564 KB
testcase_15 AC 96 ms
78,100 KB
testcase_16 AC 93 ms
77,668 KB
testcase_17 AC 75 ms
76,576 KB
testcase_18 AC 79 ms
76,556 KB
testcase_19 AC 75 ms
76,416 KB
testcase_20 AC 75 ms
76,436 KB
testcase_21 AC 78 ms
76,576 KB
testcase_22 AC 77 ms
76,540 KB
testcase_23 AC 67 ms
71,172 KB
testcase_24 AC 66 ms
71,156 KB
testcase_25 AC 77 ms
76,528 KB
testcase_26 AC 66 ms
71,256 KB
testcase_27 AC 69 ms
71,324 KB
testcase_28 AC 69 ms
70,940 KB
testcase_29 AC 69 ms
71,180 KB
testcase_30 AC 79 ms
76,428 KB
testcase_31 AC 66 ms
71,216 KB
testcase_32 AC 65 ms
71,152 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

for i in reversed(range(n+1)):
    print(*X[i])
0