結果

問題 No.1021 Children in Classrooms
ユーザー pluto77pluto77
提出日時 2020-06-10 09:21:02
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 211 ms / 2,000 ms
コード長 252 bytes
コンパイル時間 478 ms
コンパイル使用メモリ 10,644 KB
実行使用メモリ 31,328 KB
最終ジャッジ日時 2023-09-03 22:50:26
合計ジャッジ時間 5,586 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,536 KB
testcase_01 AC 17 ms
8,456 KB
testcase_02 AC 17 ms
8,572 KB
testcase_03 AC 19 ms
8,640 KB
testcase_04 AC 19 ms
8,680 KB
testcase_05 AC 18 ms
8,588 KB
testcase_06 AC 19 ms
8,664 KB
testcase_07 AC 20 ms
8,724 KB
testcase_08 AC 19 ms
8,840 KB
testcase_09 AC 208 ms
31,132 KB
testcase_10 AC 207 ms
30,964 KB
testcase_11 AC 210 ms
30,976 KB
testcase_12 AC 206 ms
31,128 KB
testcase_13 AC 210 ms
30,992 KB
testcase_14 AC 208 ms
30,964 KB
testcase_15 AC 174 ms
25,632 KB
testcase_16 AC 178 ms
25,736 KB
testcase_17 AC 180 ms
26,452 KB
testcase_18 AC 211 ms
31,328 KB
testcase_19 AC 84 ms
8,808 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki1021
from collections import deque
n,m=map(int,input().split())
a=list(map(int,input().split()))
s=input()
q=deque(a)
for c in s:
 if c=='L':
  x=q.popleft()
  q[0]+=x
  q.append(0)
 elif c=='R':
  x=q.pop()
  q[-1]+=x
  q.appendleft(0)
print(*q)
0