結果
| 問題 | No.1021 Children in Classrooms |
| コンテスト | |
| ユーザー |
wattaihei
|
| 提出日時 | 2020-05-23 18:14:27 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 471 ms / 2,000 ms |
| コード長 | 431 bytes |
| 記録 | |
| コンパイル時間 | 410 ms |
| コンパイル使用メモリ | 20,824 KB |
| 実行使用メモリ | 34,272 KB |
| 最終ジャッジ日時 | 2026-04-25 00:49:51 |
| 合計ジャッジ時間 | 7,188 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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)
wattaihei