結果

問題 No.1021 Children in Classrooms
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2022-03-27 22:58:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 156 ms / 2,000 ms
コード長 308 bytes
コンパイル時間 478 ms
コンパイル使用メモリ 82,944 KB
実行使用メモリ 107,648 KB
最終ジャッジ日時 2024-04-24 08:18:14
合計ジャッジ時間 4,213 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,504 KB
testcase_01 AC 41 ms
53,120 KB
testcase_02 AC 40 ms
53,760 KB
testcase_03 AC 68 ms
66,688 KB
testcase_04 AC 61 ms
67,200 KB
testcase_05 AC 58 ms
66,944 KB
testcase_06 AC 59 ms
67,072 KB
testcase_07 AC 60 ms
67,200 KB
testcase_08 AC 58 ms
67,456 KB
testcase_09 AC 143 ms
107,648 KB
testcase_10 AC 149 ms
107,136 KB
testcase_11 AC 156 ms
107,520 KB
testcase_12 AC 142 ms
107,136 KB
testcase_13 AC 142 ms
107,520 KB
testcase_14 AC 139 ms
107,648 KB
testcase_15 AC 124 ms
102,656 KB
testcase_16 AC 123 ms
102,528 KB
testcase_17 AC 128 ms
102,272 KB
testcase_18 AC 128 ms
107,392 KB
testcase_19 AC 76 ms
76,288 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque
n,m = map(int,input().split())
A = deque(list(map(int,input().split())))

S = input()
for s in S:
    if s == "L":
        x = A.popleft()
        A[0] += x
        A.append(0)
    
    if s == "R":
        x = A.pop()
        A[-1] += x
        A.appendleft(0)

print(*list(A))
0