結果
| 問題 | No.2021 Not A but B |
| コンテスト | |
| ユーザー |
kpinkcat
|
| 提出日時 | 2023-09-21 17:28:32 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 508 bytes |
| 記録 | |
| コンパイル時間 | 1,288 ms |
| コンパイル使用メモリ | 216,820 KB |
| 実行使用メモリ | 1,307,520 KB |
| 最終ジャッジ日時 | 2026-07-02 11:47:33 |
| 合計ジャッジ時間 | 4,152 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 4 MLE * 2 -- * 20 |
ソースコード
#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;
}
kpinkcat