結果

問題 No.2021 Not A but B
ユーザー V_Melville
提出日時 2022-07-29 22:31:32
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
MLE  
実行時間 -
コード長 399 bytes
コンパイル時間 4,978 ms
コンパイル使用メモリ 324,584 KB
実行使用メモリ 816,724 KB
最終ジャッジ日時 2024-07-19 15:41:30
合計ジャッジ時間 7,956 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 4 MLE * 1 -- * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/extc++.h>

using namespace std;

int main() {
    int n;
    string s;
    cin >> n >> s;
    
    unordered_set<string> st;
    string t = "BB" + s.substr(2);
    st.insert(t);
    for (int i = 1; i < n-1; ++i) {
        t = s.substr(0, i) + "BB" + s.substr(i+2);
        // std::cerr << t << '\n';
        st.insert(t);
    }
    
    cout << st.size() << '\n';
    
    return 0;
}
0