結果

問題 No.1021 Children in Classrooms
ユーザー tktk_snsntktk_snsn
提出日時 2021-08-08 19:51:34
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 232 ms / 2,000 ms
コード長 299 bytes
コンパイル時間 880 ms
コンパイル使用メモリ 11,804 KB
実行使用メモリ 33,852 KB
最終ジャッジ日時 2023-10-19 20:26:28
合計ジャッジ時間 5,396 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,100 KB
testcase_01 AC 30 ms
10,100 KB
testcase_02 AC 28 ms
10,100 KB
testcase_03 AC 31 ms
10,288 KB
testcase_04 AC 31 ms
10,352 KB
testcase_05 AC 30 ms
10,276 KB
testcase_06 AC 32 ms
10,336 KB
testcase_07 AC 32 ms
10,400 KB
testcase_08 AC 32 ms
10,392 KB
testcase_09 AC 228 ms
33,840 KB
testcase_10 AC 232 ms
33,812 KB
testcase_11 AC 229 ms
33,844 KB
testcase_12 AC 228 ms
33,848 KB
testcase_13 AC 227 ms
33,844 KB
testcase_14 AC 229 ms
33,852 KB
testcase_15 AC 195 ms
27,064 KB
testcase_16 AC 196 ms
28,248 KB
testcase_17 AC 197 ms
28,880 KB
testcase_18 AC 230 ms
33,172 KB
testcase_19 AC 91 ms
10,468 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

b = deque(a)
for i in s:
    if i == "L":
        x = b.popleft()
        b[0] += x
        b.append(0)
    else:
        x = b.pop()
        b[-1] += x
        b.appendleft(0)

print(*b)
0