結果

問題 No.1021 Children in Classrooms
ユーザー rlangevinrlangevin
提出日時 2023-01-21 16:26:49
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 248 ms / 2,000 ms
コード長 356 bytes
コンパイル時間 296 ms
コンパイル使用メモリ 87,260 KB
実行使用メモリ 111,344 KB
最終ジャッジ日時 2023-09-06 05:15:07
合計ジャッジ時間 5,542 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
71,756 KB
testcase_01 AC 89 ms
71,824 KB
testcase_02 AC 91 ms
71,752 KB
testcase_03 AC 107 ms
77,704 KB
testcase_04 AC 108 ms
77,772 KB
testcase_05 AC 106 ms
77,904 KB
testcase_06 AC 105 ms
77,960 KB
testcase_07 AC 106 ms
78,068 KB
testcase_08 AC 105 ms
77,988 KB
testcase_09 AC 236 ms
108,160 KB
testcase_10 AC 248 ms
108,432 KB
testcase_11 AC 233 ms
108,016 KB
testcase_12 AC 235 ms
108,808 KB
testcase_13 AC 234 ms
108,580 KB
testcase_14 AC 227 ms
108,196 KB
testcase_15 AC 206 ms
103,688 KB
testcase_16 AC 208 ms
103,588 KB
testcase_17 AC 213 ms
104,840 KB
testcase_18 AC 224 ms
111,344 KB
testcase_19 AC 107 ms
80,712 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import *

N, M = map(int, input().split())
A = deque(map(int, input().split()))
S = list(input())
for s in S:
    if s == "L":
        a = A.popleft()
        b = A.popleft()
        A.appendleft(a + b)
        A.append(0)
    else:
        a = A.pop()
        b = A.pop()
        A.append(a + b)
        A.appendleft(0)
        
print(*A)
0