結果
| 問題 | No.1021 Children in Classrooms |
| コンテスト | |
| ユーザー |
hiraku
|
| 提出日時 | 2020-04-12 20:14:20 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 221 ms / 2,000 ms |
| コード長 | 273 bytes |
| 記録 | |
| コンパイル時間 | 315 ms |
| コンパイル使用メモリ | 20,696 KB |
| 実行使用メモリ | 34,112 KB |
| 最終ジャッジ日時 | 2026-04-10 13:30:45 |
| 合計ジャッジ時間 | 5,372 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 |
ソースコード
from collections import deque
n, m = map(int, input().split())
A = list(map(int, input().split()))
S = input()
q = deque(A)
for s in S:
if s == "L":
x = q.popleft()
q[0] += x
q.append(0)
else:
x = q.pop()
q[-1] += x
q.appendleft(0)
print(*q)
hiraku