結果

問題 No.1021 Children in Classrooms
ユーザー lloyzlloyz
提出日時 2022-04-20 07:56:44
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 216 ms / 2,000 ms
コード長 315 bytes
コンパイル時間 431 ms
コンパイル使用メモリ 10,748 KB
実行使用メモリ 30,504 KB
最終ジャッジ日時 2023-09-02 01:35:43
合計ジャッジ時間 6,884 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,620 KB
testcase_01 AC 16 ms
8,524 KB
testcase_02 AC 17 ms
8,652 KB
testcase_03 AC 19 ms
8,804 KB
testcase_04 AC 19 ms
8,808 KB
testcase_05 AC 20 ms
8,696 KB
testcase_06 AC 19 ms
8,660 KB
testcase_07 AC 18 ms
8,748 KB
testcase_08 AC 19 ms
8,908 KB
testcase_09 AC 214 ms
30,084 KB
testcase_10 AC 212 ms
30,232 KB
testcase_11 AC 208 ms
30,140 KB
testcase_12 AC 214 ms
30,252 KB
testcase_13 AC 213 ms
30,148 KB
testcase_14 AC 216 ms
30,168 KB
testcase_15 AC 179 ms
24,860 KB
testcase_16 AC 183 ms
25,048 KB
testcase_17 AC 179 ms
25,884 KB
testcase_18 AC 215 ms
30,504 KB
testcase_19 AC 92 ms
10,296 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque

n, m = map(int, input().split())
A = deque(map(int, input().split()))
S = list(input())
for i in range(m):
    if S[i] == 'L':
        a = A.popleft()
        A[0] += a
        A.append(0)
    elif S[i] == 'R':
        a = A.pop()
        A[-1] += a
        A.appendleft(0)
print(*A)
0