結果

問題 No.1021 Children in Classrooms
ユーザー w0mbatw0mbat
提出日時 2020-04-24 21:17:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 160 ms / 2,000 ms
コード長 337 bytes
コンパイル時間 176 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 112,512 KB
最終ジャッジ日時 2024-04-23 02:45:34
合計ジャッジ時間 3,941 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,504 KB
testcase_01 AC 36 ms
53,632 KB
testcase_02 AC 37 ms
53,504 KB
testcase_03 AC 58 ms
66,432 KB
testcase_04 AC 54 ms
66,432 KB
testcase_05 AC 52 ms
66,432 KB
testcase_06 AC 52 ms
66,304 KB
testcase_07 AC 55 ms
66,944 KB
testcase_08 AC 53 ms
66,816 KB
testcase_09 AC 149 ms
112,384 KB
testcase_10 AC 160 ms
112,128 KB
testcase_11 AC 147 ms
112,276 KB
testcase_12 AC 154 ms
112,128 KB
testcase_13 AC 156 ms
112,384 KB
testcase_14 AC 158 ms
112,512 KB
testcase_15 AC 120 ms
103,808 KB
testcase_16 AC 119 ms
103,588 KB
testcase_17 AC 122 ms
103,552 KB
testcase_18 AC 134 ms
109,312 KB
testcase_19 AC 57 ms
76,244 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque
N,M=map(int, input().split())
*A,=map(int, input().split())
S=input()
q=deque(A)
for s in S:
    if s=='L':
        l1=q.popleft()
        l2=q.popleft()
        q.appendleft(l1+l2)
        q.append(0)
    else:
        r1=q.pop()
        r2=q.pop()
        q.append(r1+r2)
        q.appendleft(0)
print(*q)
0