結果

問題 No.1021 Children in Classrooms
ユーザー brthyyjpbrthyyjp
提出日時 2020-04-10 21:43:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 214 ms / 2,000 ms
コード長 406 bytes
コンパイル時間 267 ms
コンパイル使用メモリ 87,080 KB
実行使用メモリ 107,396 KB
最終ジャッジ日時 2023-10-13 23:54:10
合計ジャッジ時間 4,961 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 92 ms
71,708 KB
testcase_01 AC 93 ms
71,852 KB
testcase_02 AC 94 ms
71,928 KB
testcase_03 AC 114 ms
78,216 KB
testcase_04 AC 111 ms
78,244 KB
testcase_05 AC 109 ms
78,192 KB
testcase_06 AC 110 ms
78,180 KB
testcase_07 AC 110 ms
78,232 KB
testcase_08 AC 112 ms
78,232 KB
testcase_09 AC 203 ms
107,332 KB
testcase_10 AC 214 ms
107,176 KB
testcase_11 AC 203 ms
107,060 KB
testcase_12 AC 205 ms
107,184 KB
testcase_13 AC 202 ms
107,044 KB
testcase_14 AC 197 ms
107,176 KB
testcase_15 AC 173 ms
101,272 KB
testcase_16 AC 176 ms
100,960 KB
testcase_17 AC 178 ms
101,124 KB
testcase_18 AC 186 ms
107,396 KB
testcase_19 AC 108 ms
77,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())
A =list(map(int, input().split()))
s = str(input())

from collections import deque
B = deque(A)
for i in range(m):
    if s[i] == 'L':
        x = B.popleft()
        y = B.popleft()
        y += x
        B.appendleft(y)
        B.append(0)
    else:
        x = B.pop()
        y = B.pop()
        y += x
        B.append(y)
        B.appendleft(0)
B = list(B)
print(*B)
0