結果
問題 |
No.1133 キムワイプイーター
|
ユーザー |
|
提出日時 | 2023-06-24 18:52:15 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 407 bytes |
コンパイル時間 | 208 ms |
コンパイル使用メモリ | 81,920 KB |
実行使用メモリ | 81,152 KB |
最終ジャッジ日時 | 2024-07-01 21:50:55 |
合計ジャッジ時間 | 4,734 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 16 RE * 15 |
ソースコード
n, m = map(int, input().split()) s = input() mat = [[1] * (n + 1) for _ in range(n + 1)] mat[n][0] = 0 def loop(i, x, y): if i == m: return mat if s[i] == 'L': x -= 1 elif s[i] == 'R': x += 1 if s[i] == 'D': y += 1 elif s[i] == 'U': y -= 1 mat[y][x] = 0 return loop(i + 1, x, y) for row in loop(0, 0, n): print(' '.join(map(str, row)))