結果

問題 No.1021 Children in Classrooms
ユーザー ntudantuda
提出日時 2024-01-28 21:37:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 180 ms / 2,000 ms
コード長 349 bytes
コンパイル時間 460 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 106,864 KB
最終ジャッジ日時 2024-01-28 21:37:30
合計ジャッジ時間 5,444 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
53,332 KB
testcase_01 AC 38 ms
53,332 KB
testcase_02 AC 40 ms
53,332 KB
testcase_03 AC 55 ms
66,796 KB
testcase_04 AC 55 ms
66,796 KB
testcase_05 AC 55 ms
66,796 KB
testcase_06 AC 60 ms
66,796 KB
testcase_07 AC 55 ms
66,796 KB
testcase_08 AC 56 ms
66,796 KB
testcase_09 AC 180 ms
106,864 KB
testcase_10 AC 159 ms
106,736 KB
testcase_11 AC 141 ms
106,864 KB
testcase_12 AC 149 ms
106,864 KB
testcase_13 AC 141 ms
106,864 KB
testcase_14 AC 134 ms
106,864 KB
testcase_15 AC 133 ms
102,172 KB
testcase_16 AC 124 ms
102,168 KB
testcase_17 AC 129 ms
101,944 KB
testcase_18 AC 125 ms
106,544 KB
testcase_19 AC 60 ms
75,852 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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)
0