結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
52,072 KB
testcase_01 AC 33 ms
52,556 KB
testcase_02 AC 33 ms
52,124 KB
testcase_03 AC 48 ms
65,824 KB
testcase_04 AC 53 ms
65,884 KB
testcase_05 AC 51 ms
66,064 KB
testcase_06 AC 50 ms
66,552 KB
testcase_07 WA -
testcase_08 AC 49 ms
65,920 KB
testcase_09 AC 120 ms
109,956 KB
testcase_10 AC 122 ms
109,860 KB
testcase_11 AC 120 ms
110,016 KB
testcase_12 AC 134 ms
109,832 KB
testcase_13 AC 132 ms
110,064 KB
testcase_14 AC 130 ms
109,520 KB
testcase_15 WA -
testcase_16 AC 104 ms
102,056 KB
testcase_17 WA -
testcase_18 AC 112 ms
109,940 KB
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

l=r=0
i=imin=imax=0
for s in S:
    if s=='L':
        l+=1
        i-=1
    else:
        r+=1
        i+=1
    imin = min(imin, i)
    imax = max(imax, i)

ans=[0]*N
for i in range(N):
    j=i
    j+=max(0, -imin-j)
    j-=max(0, imax-(N-j-1))
    j=j+r-l
    j=max(0,min(N-1,j))
    ans[j]+=A[i]
print(*ans)
0