結果

問題 No.1021 Children in Classrooms
ユーザー けむけむけむけむ
提出日時 2021-09-20 18:19:47
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 557 bytes
コンパイル時間 268 ms
コンパイル使用メモリ 87,120 KB
実行使用メモリ 298,688 KB
最終ジャッジ日時 2023-09-15 13:33:33
合計ジャッジ時間 5,368 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
75,832 KB
testcase_01 AC 72 ms
71,596 KB
testcase_02 AC 71 ms
71,104 KB
testcase_03 AC 101 ms
77,396 KB
testcase_04 AC 104 ms
77,584 KB
testcase_05 AC 100 ms
77,232 KB
testcase_06 AC 95 ms
77,264 KB
testcase_07 AC 105 ms
77,548 KB
testcase_08 AC 105 ms
77,896 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