結果
| 問題 | No.559 swapAB列 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-08-25 23:12:21 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 232 bytes |
| 記録 | |
| コンパイル時間 | 950 ms |
| コンパイル使用メモリ | 183,988 KB |
| 実行使用メモリ | 7,976 KB |
| 最終ジャッジ日時 | 2026-05-05 00:25:45 |
| 合計ジャッジ時間 | 1,681 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 7 |
ソースコード
#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
int main() {
string s; cin >> s;
int cnt = 0, ans = 0;
rep(i, s.size()) {
if (s[i] == 'B')cnt++;
else ans += cnt;
}
cout << ans << endl;
}