結果

問題 No.1021 Children in Classrooms
ユーザー c-yanc-yan
提出日時 2020-04-10 21:55:22
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 216 ms / 2,000 ms
コード長 309 bytes
コンパイル時間 459 ms
コンパイル使用メモリ 10,612 KB
実行使用メモリ 31,340 KB
最終ジャッジ日時 2023-10-14 00:26:23
合計ジャッジ時間 4,403 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,624 KB
testcase_01 AC 19 ms
8,480 KB
testcase_02 AC 19 ms
8,580 KB
testcase_03 AC 20 ms
8,592 KB
testcase_04 AC 21 ms
8,728 KB
testcase_05 AC 20 ms
8,588 KB
testcase_06 AC 20 ms
8,636 KB
testcase_07 AC 21 ms
8,788 KB
testcase_08 AC 20 ms
8,872 KB
testcase_09 AC 213 ms
31,056 KB
testcase_10 AC 213 ms
30,992 KB
testcase_11 AC 213 ms
30,948 KB
testcase_12 AC 210 ms
31,020 KB
testcase_13 AC 212 ms
31,004 KB
testcase_14 AC 210 ms
31,108 KB
testcase_15 AC 173 ms
25,644 KB
testcase_16 AC 183 ms
25,620 KB
testcase_17 AC 184 ms
26,424 KB
testcase_18 AC 216 ms
31,340 KB
testcase_19 AC 84 ms
8,796 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque

N, M = map(int, input().split())
a = list(map(int, input().split()))
S = input()

q = deque(a)
for c in S:
    if c == 'L':
        t = q.popleft()
        q[0] += t
        q.append(0)
    elif c == 'R':
        t = q.pop()
        q[-1] += t
        q.appendleft(0)
print(*q)
0