結果

問題 No.1133 キムワイプイーター
ユーザー zaki_chemtechzaki_chemtech
提出日時 2020-07-30 18:01:27
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 171 ms / 2,000 ms
コード長 349 bytes
コンパイル時間 288 ms
コンパイル使用メモリ 87,220 KB
実行使用メモリ 121,820 KB
最終ジャッジ日時 2023-09-17 15:38:59
合計ジャッジ時間 5,350 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,264 KB
testcase_01 AC 74 ms
71,324 KB
testcase_02 AC 115 ms
89,084 KB
testcase_03 AC 141 ms
101,024 KB
testcase_04 AC 140 ms
101,512 KB
testcase_05 AC 144 ms
102,040 KB
testcase_06 AC 141 ms
101,468 KB
testcase_07 AC 129 ms
95,636 KB
testcase_08 AC 114 ms
87,484 KB
testcase_09 AC 137 ms
100,920 KB
testcase_10 AC 171 ms
121,820 KB
testcase_11 AC 163 ms
116,684 KB
testcase_12 AC 142 ms
101,792 KB
testcase_13 AC 163 ms
116,444 KB
testcase_14 AC 127 ms
100,764 KB
testcase_15 AC 128 ms
95,768 KB
testcase_16 AC 115 ms
88,748 KB
testcase_17 AC 86 ms
76,468 KB
testcase_18 AC 87 ms
76,616 KB
testcase_19 AC 85 ms
76,640 KB
testcase_20 AC 85 ms
76,624 KB
testcase_21 AC 88 ms
76,508 KB
testcase_22 AC 86 ms
76,432 KB
testcase_23 AC 73 ms
71,236 KB
testcase_24 AC 74 ms
71,348 KB
testcase_25 AC 84 ms
76,456 KB
testcase_26 AC 76 ms
71,316 KB
testcase_27 AC 76 ms
71,308 KB
testcase_28 AC 76 ms
71,312 KB
testcase_29 AC 75 ms
71,204 KB
testcase_30 AC 88 ms
76,508 KB
testcase_31 AC 74 ms
71,104 KB
testcase_32 AC 74 ms
71,260 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m = map(int,input().split())

s = list(input())

memo = [[1]*(n+1) for i in range(n+1)]

memo[0][0] = 0

y, x = 0, 0

for i in range(m):
    if s[i] == 'U':
        y += 1
    elif s[i] == 'D':
        y -= 1
    elif s[i] == 'R':
        x += 1
    elif s[i] == 'L':
        x -= 1
    memo[y][x] = 0

for i in range(n,-1,-1):
    print(*memo[i])
0