結果

問題 No.1021 Children in Classrooms
ユーザー 👑 H20H20
提出日時 2020-12-01 13:37:39
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 212 ms / 2,000 ms
コード長 316 bytes
コンパイル時間 1,537 ms
コンパイル使用メモリ 86,256 KB
実行使用メモリ 112,840 KB
最終ジャッジ日時 2023-10-11 03:32:42
合計ジャッジ時間 7,096 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
71,456 KB
testcase_01 AC 91 ms
71,720 KB
testcase_02 AC 91 ms
71,416 KB
testcase_03 AC 109 ms
78,156 KB
testcase_04 AC 111 ms
78,248 KB
testcase_05 AC 108 ms
78,140 KB
testcase_06 AC 110 ms
77,964 KB
testcase_07 AC 111 ms
78,224 KB
testcase_08 AC 113 ms
78,196 KB
testcase_09 AC 206 ms
112,640 KB
testcase_10 AC 212 ms
112,736 KB
testcase_11 AC 200 ms
112,588 KB
testcase_12 AC 203 ms
112,508 KB
testcase_13 AC 200 ms
112,344 KB
testcase_14 AC 192 ms
112,664 KB
testcase_15 AC 177 ms
103,520 KB
testcase_16 AC 175 ms
103,696 KB
testcase_17 AC 175 ms
104,212 KB
testcase_18 AC 187 ms
112,840 KB
testcase_19 AC 124 ms
77,488 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

0