結果
問題 |
No.1021 Children in Classrooms
|
ユーザー |
![]() |
提出日時 | 2020-04-24 21:17:06 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 174 ms / 2,000 ms |
コード長 | 337 bytes |
コンパイル時間 | 157 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 112,256 KB |
最終ジャッジ日時 | 2024-10-15 02:10:53 |
合計ジャッジ時間 | 3,675 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 |
ソースコード
from collections import deque N,M=map(int, input().split()) *A,=map(int, input().split()) S=input() q=deque(A) for s in S: if s=='L': l1=q.popleft() l2=q.popleft() q.appendleft(l1+l2) q.append(0) else: r1=q.pop() r2=q.pop() q.append(r1+r2) q.appendleft(0) print(*q)