結果
問題 | No.559 swapAB列 |
ユーザー | kappybar |
提出日時 | 2020-05-01 16:48:42 |
言語 | C++14 (gcc 13.2.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 441 bytes |
コンパイル時間 | 1,421 ms |
コンパイル使用メモリ | 163,864 KB |
実行使用メモリ | 4,380 KB |
最終ジャッジ日時 | 2023-08-25 21:55:59 |
合計ジャッジ時間 | 2,013 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge12 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
4,380 KB |
testcase_01 | AC | 1 ms
4,380 KB |
testcase_02 | AC | 2 ms
4,376 KB |
testcase_03 | AC | 2 ms
4,380 KB |
testcase_04 | AC | 2 ms
4,376 KB |
testcase_05 | AC | 1 ms
4,376 KB |
testcase_06 | AC | 2 ms
4,380 KB |
testcase_07 | AC | 1 ms
4,380 KB |
testcase_08 | AC | 1 ms
4,380 KB |
testcase_09 | AC | 1 ms
4,376 KB |
ソースコード
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<(int)(n);i++) using namespace std; using ll = long long ; using P = pair<int,int> ; using pll = pair<ll,ll>; constexpr int INF = 1e9; constexpr ll LINF = 1e18; constexpr int MOD = 1000000007; int main(){ string s; cin >> s; int ans = 0; int b = 0; rep(i,s.size()){ if(s[i] == 'B') ++b; else ans += b; } cout << ans << endl; return 0; }