結果

問題 No.1021 Children in Classrooms
ユーザー O2MTO2MT
提出日時 2020-08-24 18:02:41
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 258 ms / 2,000 ms
コード長 334 bytes
コンパイル時間 110 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 30,640 KB
最終ジャッジ日時 2024-04-24 03:40:01
合計ジャッジ時間 4,084 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
10,752 KB
testcase_01 AC 25 ms
10,880 KB
testcase_02 AC 25 ms
10,752 KB
testcase_03 AC 27 ms
11,008 KB
testcase_04 AC 27 ms
10,880 KB
testcase_05 AC 27 ms
11,008 KB
testcase_06 AC 28 ms
11,008 KB
testcase_07 AC 28 ms
11,008 KB
testcase_08 AC 29 ms
10,880 KB
testcase_09 AC 258 ms
30,240 KB
testcase_10 AC 253 ms
30,216 KB
testcase_11 AC 252 ms
30,368 KB
testcase_12 AC 250 ms
30,368 KB
testcase_13 AC 249 ms
30,240 KB
testcase_14 AC 255 ms
30,372 KB
testcase_15 AC 211 ms
26,196 KB
testcase_16 AC 217 ms
25,584 KB
testcase_17 AC 221 ms
26,988 KB
testcase_18 AC 254 ms
30,640 KB
testcase_19 AC 116 ms
11,392 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque
N,M = map(int,input().split())
A = deque(list(map(int,input().split())))
S = str(input())

for i in range(M):
  if S[i] == "L":
    l = A.popleft()
    ll = A.popleft()
    A.appendleft(l+ll)
    A.append(0)
  else:
    l = A.pop()
    ll = A.pop()
    A.append(l+ll)
    A.appendleft(0)
      
print(*A)
0