結果
問題 | No.1021 Children in Classrooms |
ユーザー |
![]() |
提出日時 | 2020-05-23 18:14:27 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 288 ms / 2,000 ms |
コード長 | 431 bytes |
コンパイル時間 | 469 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 30,608 KB |
最終ジャッジ日時 | 2024-10-08 16:36:16 |
合計ジャッジ時間 | 5,127 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 |
ソースコード
import sys input = sys.stdin.readline from collections import deque N, M = map(int, input().split()) A = list(map(int, input().split())) S = input().rstrip() q = deque() for a in A: q.append(a) for s in S: if s == "L": q.append(0) a = q.popleft() b = q.popleft() q.appendleft(a+b) else: q.appendleft(0) a = q.pop() b = q.pop() q.append(a+b) print(*q)