結果
| 問題 | No.1021 Children in Classrooms |
| コンテスト | |
| ユーザー |
Novi
|
| 提出日時 | 2020-06-06 15:20:48 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 234 ms / 2,000 ms |
| コード長 | 408 bytes |
| 記録 | |
| コンパイル時間 | 335 ms |
| コンパイル使用メモリ | 20,828 KB |
| 実行使用メモリ | 34,244 KB |
| 最終ジャッジ日時 | 2026-05-29 13:01:21 |
| 合計ジャッジ時間 | 7,196 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 |
ソースコード
from collections import deque
n,m=map(int,input().split())
a=list(map(int,input().split()))
a=deque(a)
S=input()
for s in S:
if s=="L":
first=a.popleft()
second=a.popleft()
after=first+second
a.appendleft(after)
a.append(0)
else:
first=a.pop()
second=a.pop()
after=first+second
a.append(after)
a.appendleft(0)
print(*a)
Novi