結果
問題 |
No.559 swapAB列
|
ユーザー |
|
提出日時 | 2019-01-30 21:19:50 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 321 bytes |
コンパイル時間 | 1,401 ms |
コンパイル使用メモリ | 159,780 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-06 13:31:43 |
合計ジャッジ時間 | 1,924 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 7 |
ソースコード
#include "bits/stdc++.h" using namespace std; #define Would #define you const int INF = 999999999; const int MOD = 1e9 + 7; const double pi = 3.141592653589793238; int a, b; int main() { string h; cin >> h; for (int i = 0; i < h.length(); ++i) { if (h[i] == 'B') { ++b; } else { a += b; } } cout << a << endl; }