結果

問題 No.1021 Children in Classrooms
ユーザー けむけむけむけむ
提出日時 2021-09-20 18:00:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 562 bytes
コンパイル時間 218 ms
コンパイル使用メモリ 10,996 KB
実行使用メモリ 36,052 KB
最終ジャッジ日時 2023-09-15 13:01:01
合計ジャッジ時間 4,800 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,960 KB
testcase_01 AC 16 ms
7,876 KB
testcase_02 AC 15 ms
7,872 KB
testcase_03 AC 50 ms
8,448 KB
testcase_04 AC 58 ms
8,468 KB
testcase_05 AC 54 ms
8,340 KB
testcase_06 AC 56 ms
8,460 KB
testcase_07 AC 103 ms
8,616 KB
testcase_08 AC 100 ms
8,500 KB
testcase_09 TLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

def classrooms(N, M, a, S):
    S = list(S)
    aft_a = [] + a
    for i in range(M):
        bef_a = [] + aft_a
        s = S[i]
        if s == 'R':
            aft_a = [0] + bef_a[:N-2] +[bef_a[N-1] + bef_a[N-2]]
        elif s == 'L':
            aft_a = [bef_a[0] +bef_a[1]] + bef_a[2:] + [0]
    ans = ''
    for j in range(N):
        ans += str(aft_a[j]) + ' '
    return ans

def main():
    N, M = map(int, input().split())
    a = list(map(int, input().split()))
    S = input()
    print(classrooms(N, M, a, S))

if __name__ == '__main__':
    main()
0