結果

問題 No.1021 Children in Classrooms
ユーザー betrue12betrue12
提出日時 2020-04-10 21:26:12
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 70 ms / 2,000 ms
コード長 495 bytes
コンパイル時間 2,094 ms
コンパイル使用メモリ 204,220 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-10-13 23:07:08
合計ジャッジ時間 4,485 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,356 KB
testcase_02 AC 1 ms
4,352 KB
testcase_03 AC 2 ms
4,352 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,352 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,352 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 66 ms
4,348 KB
testcase_10 AC 67 ms
4,384 KB
testcase_11 AC 67 ms
4,348 KB
testcase_12 AC 66 ms
4,352 KB
testcase_13 AC 66 ms
4,348 KB
testcase_14 AC 65 ms
4,348 KB
testcase_15 AC 50 ms
4,348 KB
testcase_16 AC 51 ms
4,348 KB
testcase_17 AC 53 ms
4,352 KB
testcase_18 AC 70 ms
4,348 KB
testcase_19 AC 7 ms
4,352 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(){
    int N, M;
    cin >> N >> M;
    deque<int> A(N);
    for(int i=0; i<N; i++) cin >> A[i];
    string S;
    cin >> S;
    for(char c : S){
        if(c == 'L'){
            A[1] += A[0];
            A.pop_front();
            A.push_back(0);
        }else{
            A[N-2] += A[N-1];
            A.pop_back();
            A.push_front(0);
        }
    }
    for(int i=0; i<N; i++) cout << A[i] << " \n"[i==N-1];
    return 0;
}
0