結果

問題 No.1133 キムワイプイーター
ユーザー miya145592miya145592
提出日時 2023-05-16 23:29:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 121 ms / 2,000 ms
コード長 337 bytes
コンパイル時間 400 ms
コンパイル使用メモリ 87,276 KB
実行使用メモリ 78,384 KB
最終ジャッジ日時 2023-08-21 10:37:34
合計ジャッジ時間 5,803 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,088 KB
testcase_01 AC 69 ms
70,964 KB
testcase_02 AC 101 ms
77,412 KB
testcase_03 AC 114 ms
77,840 KB
testcase_04 AC 116 ms
77,972 KB
testcase_05 AC 117 ms
77,860 KB
testcase_06 AC 117 ms
77,692 KB
testcase_07 AC 108 ms
78,016 KB
testcase_08 AC 100 ms
77,224 KB
testcase_09 AC 109 ms
77,544 KB
testcase_10 AC 121 ms
78,356 KB
testcase_11 AC 120 ms
78,384 KB
testcase_12 AC 114 ms
77,848 KB
testcase_13 AC 119 ms
78,064 KB
testcase_14 AC 100 ms
77,480 KB
testcase_15 AC 104 ms
77,780 KB
testcase_16 AC 100 ms
77,288 KB
testcase_17 AC 82 ms
76,148 KB
testcase_18 AC 83 ms
76,124 KB
testcase_19 AC 81 ms
76,120 KB
testcase_20 AC 81 ms
75,904 KB
testcase_21 AC 86 ms
75,796 KB
testcase_22 AC 84 ms
76,052 KB
testcase_23 AC 71 ms
71,140 KB
testcase_24 AC 71 ms
71,012 KB
testcase_25 AC 82 ms
76,180 KB
testcase_26 AC 72 ms
71,132 KB
testcase_27 AC 71 ms
70,972 KB
testcase_28 AC 72 ms
71,200 KB
testcase_29 AC 71 ms
71,172 KB
testcase_30 AC 86 ms
76,036 KB
testcase_31 AC 71 ms
70,964 KB
testcase_32 AC 71 ms
71,088 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M = map(int, input().split())
S = input()
dp = [[1 for _ in range(N+1)] for _ in range(N+1)]
dp[0][0] = 0
now = [0, 0]
for s in S:
    if s=="U":
        now[1]+=1
    elif s=="R":
        now[0]+=1
    elif s=="L":
        now[0]-=1
    else:
        now[1]-=1
    x, y = now
    dp[y][x] = 0
for i in range(N+1):
    print(*dp[N-i])
0