結果
| 問題 | No.1021 Children in Classrooms |
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2020-04-10 21:29:06 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 223 ms / 2,000 ms |
| コード長 | 271 bytes |
| 記録 | |
| コンパイル時間 | 392 ms |
| コンパイル使用メモリ | 20,568 KB |
| 実行使用メモリ | 32,572 KB |
| 最終ジャッジ日時 | 2026-04-04 22:01:46 |
| 合計ジャッジ時間 | 5,154 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 |
ソースコード
from collections import deque
N,M=map(int,input().split())
A=deque(map(int,input().split()))
S=input()
for s in S:
if s=="L":
x=A.popleft()
A[0]+=x
A.append(0)
else:
x=A.pop()
A[-1]+=x
A.appendleft(0)
print(*A)
titia