結果
| 問題 |
No.1021 Children in Classrooms
|
| コンテスト | |
| ユーザー |
ptotq
|
| 提出日時 | 2020-04-10 21:35:44 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 258 ms / 2,000 ms |
| コード長 | 338 bytes |
| コンパイル時間 | 174 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 29,472 KB |
| 最終ジャッジ日時 | 2024-09-15 19:28:57 |
| 合計ジャッジ時間 | 4,419 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge6 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 |
ソースコード
from collections import deque
import sys
input = sys.stdin.readline
N, M = map(int, input().split())
dq = deque(map(int, input().split()))
for c in input().rstrip():
if c == 'L':
x = dq.popleft()
dq[0] += x
dq.append(0)
else:
x = dq.pop()
dq[-1] += x
dq.appendleft(0)
print(*dq)
ptotq