結果
| 問題 |
No.559 swapAB列
|
| コンテスト | |
| ユーザー |
kpinkcat
|
| 提出日時 | 2023-08-18 09:46:34 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 449 bytes |
| コンパイル時間 | 966 ms |
| コンパイル使用メモリ | 102,292 KB |
| 最終ジャッジ日時 | 2025-02-16 09:03:00 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 7 |
ソースコード
#include<iostream>
#include<string>
#include<algorithm>
#include<cctype>
#include<set>
#include<bitset>
#include<math.h>
#include<map>
#include<queue>
#include<iomanip>
using namespace std;
#ifdef _WIN32
#include <Windows.h>
#endif
int main()
{
string s;
int bcnt = 0, tcnt = 0;;
cin >> s;
for (int i = 0; i < s.size(); i++){
if (s[i] == 'B') bcnt++;
if (s[i] == 'A') tcnt += bcnt;
}
cout << tcnt << endl;
}
kpinkcat