結果

問題 No.2021 Not A but B
ユーザー kpinkcat
提出日時 2023-09-21 17:28:32
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
MLE  
実行時間 -
コード長 508 bytes
コンパイル時間 1,926 ms
コンパイル使用メモリ 197,944 KB
最終ジャッジ日時 2025-02-16 23:54:06
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 4 MLE * 1 -- * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include<iostream>
#include<map>
#include<vector>
#include <algorithm>
#include<math.h>
#include <iomanip>
#include<set>
#include <numeric>
#include<string>
using ll = long long;
using namespace std;

int main()
{
    ll n;
    string s, tmp;
    cin >> n >> s;
    set<string> st;
    for (int i = 0; i < n-1; i++){
        tmp = s;
        if (tmp[i] == 'A') tmp[i] = 'B';
        if (tmp[i+1] == 'A') tmp[i+1] = 'B';
        st.insert(tmp);
    }
    cout << st.size() << endl;
}
0