結果

問題 No.1021 Children in Classrooms
コンテスト
ユーザー ohara_n
提出日時 2020-04-10 22:05:44
言語 Python3
(3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
TLE  
実行時間 -
コード長 670 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 298 ms
コンパイル使用メモリ 21,536 KB
実行使用メモリ 34,756 KB
最終ジャッジ日時 2026-08-28 06:02:27
合計ジャッジ時間 10,225 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 6 TLE * 1 -- * 10
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

N,M = map(int,input().split())
classes = list(map(int,input().split()))
order = input()
for i in range(M):
    if order[i] == 'L':
        temp = [0]*N
        for i in range(N):
            if i == 0:
                temp[i] = classes[i]+ classes[i+1]
            elif i <N-1:
                temp[i] = classes[i+1]
            else:
                temp[i] = 0
        classes = temp
    
    else:
        temp = [0]*N
        for i in range(N):
            if i == 0:
                temp[i] = 0
            elif i <N-1:
                temp[i] = classes[i-1]
            else:
                temp[i] = classes[i]+classes[i-1]
        classes = temp
print(*classes)
0