結果

問題 No.1021 Children in Classrooms
ユーザー w0mbatw0mbat
提出日時 2020-04-24 20:55:11
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 387 bytes
コンパイル時間 351 ms
コンパイル使用メモリ 82,580 KB
実行使用メモリ 110,208 KB
最終ジャッジ日時 2024-04-23 02:43:25
合計ジャッジ時間 3,429 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
52,692 KB
testcase_01 AC 36 ms
52,132 KB
testcase_02 AC 40 ms
53,184 KB
testcase_03 AC 53 ms
65,924 KB
testcase_04 AC 53 ms
65,900 KB
testcase_05 AC 53 ms
65,356 KB
testcase_06 AC 54 ms
67,036 KB
testcase_07 AC 52 ms
65,480 KB
testcase_08 WA -
testcase_09 AC 129 ms
109,912 KB
testcase_10 AC 125 ms
109,560 KB
testcase_11 AC 124 ms
110,136 KB
testcase_12 AC 141 ms
110,096 KB
testcase_13 AC 142 ms
109,828 KB
testcase_14 AC 135 ms
109,804 KB
testcase_15 AC 103 ms
102,436 KB
testcase_16 WA -
testcase_17 AC 105 ms
102,320 KB
testcase_18 WA -
testcase_19 AC 49 ms
73,500 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M=map(int, input().split())
*A,=map(int, input().split())
S=input()

l=0
r=N-1
k=0
i=0
for s in S:
    if s=='L':
        i-=1
        l=max(l,-i)
        k=max(0,k-1)
    else:
        i+=1
        r=min(r,N-1-i)
        k=min(N-1,k+1)
ans=[0]*N
for i in range(N):
    if i<=l:
        ans[k]+=A[i]
    elif i<r:
        ans[k+i-l]+=A[i]
    else:
        ans[k+r-l]+=A[i]
print(*ans)
0