結果

問題 No.1021 Children in Classrooms
ユーザー AEnAEn
提出日時 2022-05-13 16:24:37
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 218 ms / 2,000 ms
コード長 302 bytes
コンパイル時間 401 ms
コンパイル使用メモリ 86,872 KB
実行使用メモリ 118,420 KB
最終ジャッジ日時 2023-09-28 20:40:16
合計ジャッジ時間 6,877 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 100 ms
71,652 KB
testcase_01 AC 96 ms
71,212 KB
testcase_02 AC 97 ms
71,480 KB
testcase_03 AC 117 ms
77,904 KB
testcase_04 AC 118 ms
77,792 KB
testcase_05 AC 114 ms
77,964 KB
testcase_06 AC 114 ms
77,864 KB
testcase_07 AC 114 ms
77,964 KB
testcase_08 AC 115 ms
77,980 KB
testcase_09 AC 213 ms
118,340 KB
testcase_10 AC 218 ms
118,420 KB
testcase_11 AC 211 ms
118,396 KB
testcase_12 AC 210 ms
118,300 KB
testcase_13 AC 207 ms
118,336 KB
testcase_14 AC 205 ms
118,312 KB
testcase_15 AC 192 ms
113,420 KB
testcase_16 AC 195 ms
113,320 KB
testcase_17 AC 197 ms
113,900 KB
testcase_18 AC 202 ms
118,260 KB
testcase_19 AC 138 ms
87,228 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque
N, M = map(int,input().split())
A = list(map(int, input().split()))
d = deque(A)
S = list(input())
for s in S:
    if s == 'R':
        d.appendleft(0)
        n = d.pop()
        d[-1] += n
    else:
        d.append(0)
        n = d.popleft()
        d[0] += n
print(*d)
0