結果
| 問題 |
No.1021 Children in Classrooms
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-04-11 00:26:48 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 227 ms / 2,000 ms |
| コード長 | 449 bytes |
| コンパイル時間 | 83 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 29,480 KB |
| 最終ジャッジ日時 | 2024-09-16 04:30:44 |
| 合計ジャッジ時間 | 4,036 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 |
ソースコード
import sys
from collections import deque
n, m = map(int, sys.stdin.readline().split())
a = deque(map(int, sys.stdin.readline().split()))
s = sys.stdin.readline().rstrip()
def main():
for c in s:
if c == 'L':
b = a.popleft()
a.append(0)
a[0] += b
else:
b = a.pop()
a.appendleft(0)
a[-1] += b
print(*a, sep=' ')
if __name__ == '__main__':
main()