結果

問題 No.2021 Not A but B
ユーザー yukster714yukster714
提出日時 2023-04-21 21:14:25
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 471 bytes
コンパイル時間 1,656 ms
コンパイル使用メモリ 166,416 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-06 14:41:17
合計ジャッジ時間 3,130 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 WA * 1
other AC * 8 WA * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0;i<n;i++)
#define all(x) x.begin(),x.end() 
#define yesif(x) cout << ((x) ? "Yes": "No") << endl
#define myceil(a, b) (a+b-1)/b 
using namespace std;
typedef long long ll;

int main() {
    int n; cin >> n;
    string s; cin >> s;
    int ans = 0;
    bool bx = false;
    rep(i,n-1){
        if(bx and s[i+1] == 'B') continue;
        bx = s[i] =='B';
        ans++;
    }
    cout << ans << endl;
    return 0;
}

0