結果

問題 No.1021 Children in Classrooms
ユーザー _matumo__matumo_
提出日時 2020-09-25 14:23:59
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 180 ms / 2,000 ms
コード長 342 bytes
コンパイル時間 599 ms
コンパイル使用メモリ 10,700 KB
実行使用メモリ 30,568 KB
最終ジャッジ日時 2023-09-10 14:31:59
合計ジャッジ時間 3,802 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,632 KB
testcase_01 AC 18 ms
8,496 KB
testcase_02 AC 18 ms
8,500 KB
testcase_03 AC 19 ms
8,664 KB
testcase_04 AC 19 ms
8,700 KB
testcase_05 AC 19 ms
8,640 KB
testcase_06 AC 20 ms
8,672 KB
testcase_07 AC 20 ms
8,824 KB
testcase_08 AC 20 ms
8,728 KB
testcase_09 AC 180 ms
30,120 KB
testcase_10 AC 178 ms
30,244 KB
testcase_11 AC 178 ms
30,288 KB
testcase_12 AC 178 ms
30,280 KB
testcase_13 AC 178 ms
30,160 KB
testcase_14 AC 179 ms
30,188 KB
testcase_15 AC 145 ms
24,820 KB
testcase_16 AC 146 ms
25,000 KB
testcase_17 AC 151 ms
25,824 KB
testcase_18 AC 179 ms
30,568 KB
testcase_19 AC 52 ms
8,908 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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