結果
問題 |
No.1021 Children in Classrooms
|
ユーザー |
![]() |
提出日時 | 2020-04-11 00:43:17 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 516 bytes |
コンパイル時間 | 76 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 30,624 KB |
最終ジャッジ日時 | 2024-09-16 04:44:29 |
合計ジャッジ時間 | 4,312 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 WA * 7 |
ソースコード
N, M = map(int, input().split()) a = list(map(int, input().split())) S = input() t = 0 for c in S: if c == 'L': t -= 1 if t < 0 and -t < N: a[-t] += a[-(t + 1)] a[-(t + 1)] = 0 elif c == 'R': t += 1 if t > 0 and t < N: a[N - 1 - t] += a[N - t] a[N - t] = 0 if t < -N: t = - (N - 1) elif t > N: t = N - 1 if t > 0: print(*(([0] * t) + a)[:N]) elif t < 0: print(*(a + ([0] * -t))[-t:N - t]) else: print(*a)