結果

問題 No.1021 Children in Classrooms
ユーザー convexineqconvexineq
提出日時 2020-04-10 21:23:05
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 229 ms / 2,000 ms
コード長 462 bytes
コンパイル時間 96 ms
コンパイル使用メモリ 10,528 KB
実行使用メモリ 30,444 KB
最終ジャッジ日時 2023-10-13 21:14:03
合計ジャッジ時間 4,265 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,560 KB
testcase_01 AC 19 ms
8,384 KB
testcase_02 AC 20 ms
8,584 KB
testcase_03 AC 20 ms
8,692 KB
testcase_04 AC 20 ms
8,696 KB
testcase_05 AC 19 ms
8,616 KB
testcase_06 AC 21 ms
8,640 KB
testcase_07 AC 21 ms
8,852 KB
testcase_08 AC 20 ms
8,848 KB
testcase_09 AC 225 ms
30,192 KB
testcase_10 AC 226 ms
30,136 KB
testcase_11 AC 227 ms
30,140 KB
testcase_12 AC 225 ms
30,244 KB
testcase_13 AC 225 ms
30,076 KB
testcase_14 AC 226 ms
30,152 KB
testcase_15 AC 183 ms
24,812 KB
testcase_16 AC 188 ms
24,860 KB
testcase_17 AC 191 ms
25,848 KB
testcase_18 AC 229 ms
30,444 KB
testcase_19 AC 89 ms
8,868 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
# Your code here!
import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline
read = sys.stdin.read

from collections import deque

n,m = [int(i) for i in readline().split()]
a = deque(int(i) for i in readline().split())
s = input()

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

print(*a)
0