結果
| 問題 | No.1021 Children in Classrooms |
| コンテスト | |
| ユーザー |
ntuda
|
| 提出日時 | 2024-01-28 21:37:22 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 154 ms / 2,000 ms |
| + 767µs | |
| コード長 | 349 bytes |
| 記録 | |
| コンパイル時間 | 248 ms |
| コンパイル使用メモリ | 95,688 KB |
| 実行使用メモリ | 117,264 KB |
| 最終ジャッジ日時 | 2026-09-05 15:27:22 |
| 合計ジャッジ時間 | 5,351 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 |
ソースコード
from collections import deque
N,M = map(int,input().split())
A = list(map(int,input().split()))
S = input()
d = deque(A)
for s in S:
if s == "L":
a = d.popleft()
a += d.popleft()
d.appendleft(a)
d.append(0)
else:
a = d.pop()
a += d.pop()
d.append(a)
d.appendleft(0)
print(*d)
ntuda