結果
| 問題 | No.1021 Children in Classrooms |
| コンテスト | |
| ユーザー |
Novi
|
| 提出日時 | 2020-06-06 15:20:48 |
| 言語 | Python3 (3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 158 ms / 2,000 ms |
| + 207µs | |
| コード長 | 408 bytes |
| 記録 | |
| コンパイル時間 | 54 ms |
| コンパイル使用メモリ | 14,848 KB |
| 実行使用メモリ | 30,780 KB |
| 最終ジャッジ日時 | 2026-10-06 13:26:55 |
| 合計ジャッジ時間 | 4,464 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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