結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
12,076 KB
testcase_01 AC 15 ms
7,772 KB
testcase_02 AC 16 ms
7,768 KB
testcase_03 AC 41 ms
8,264 KB
testcase_04 AC 47 ms
8,448 KB
testcase_05 AC 45 ms
8,376 KB
testcase_06 AC 47 ms
8,496 KB
testcase_07 AC 82 ms
8,380 KB
testcase_08 AC 79 ms
8,488 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