結果

問題 No.2240 WAC
ユーザー srjywrdnprktsrjywrdnprkt
提出日時 2023-04-22 05:41:02
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 819 bytes
コンパイル時間 1,037 ms
コンパイル使用メモリ 106,540 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-24 12:51:00
合計ジャッジ時間 2,181 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 10 ms
5,376 KB
testcase_11 WA -
testcase_12 AC 8 ms
5,376 KB
testcase_13 AC 4 ms
5,376 KB
testcase_14 AC 3 ms
5,376 KB
testcase_15 AC 7 ms
5,376 KB
testcase_16 WA -
testcase_17 AC 6 ms
5,376 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 7 ms
5,376 KB
testcase_21 WA -
testcase_22 AC 5 ms
5,376 KB
testcase_23 AC 4 ms
5,376 KB
testcase_24 AC 7 ms
5,376 KB
testcase_25 WA -
testcase_26 AC 3 ms
5,376 KB
testcase_27 AC 3 ms
5,376 KB
testcase_28 AC 4 ms
5,376 KB
testcase_29 AC 3 ms
5,376 KB
testcase_30 AC 5 ms
5,376 KB
testcase_31 AC 9 ms
5,376 KB
testcase_32 WA -
testcase_33 AC 5 ms
5,376 KB
testcase_34 AC 6 ms
5,376 KB
testcase_35 AC 2 ms
5,376 KB
testcase_36 WA -
testcase_37 AC 8 ms
5,376 KB
testcase_38 AC 4 ms
5,376 KB
testcase_39 AC 8 ms
5,376 KB
testcase_40 AC 5 ms
5,376 KB
testcase_41 AC 6 ms
5,376 KB
testcase_42 AC 6 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <cmath>
#include <map>
#include <set>
#include <iomanip>
#include <queue>
#include <algorithm>
#include <numeric>
#include <deque>
#include <complex>
#include <cassert>

using namespace std;
using ll = long long;

int main(){

    int N, M, w=0, a, c=0;
    string S;
    cin >> N >> M >> S;
    a = N+M;
 
    for (int i=0; i<(N+M)*2; i++){
        if (S[i] == 'W') w++;
        else if (S[i] == 'A') a--;
        if (w > a && w != N){
            cout << "No" << endl;
            return 0;
        }
    }
    a = N+M;
    for (int i=(N+M)*2-1; i>=0; i--){
        if (S[i] == 'C') c++;
        else if (S[i] == 'A') a--;
        if (c > a && c != M){
            cout << "No" << endl;
            return 0;
        }
    }

    cout << "Yes" << endl;

    return 0;
}
0