結果
| 問題 |
No.559 swapAB列
|
| コンテスト | |
| ユーザー |
Project2017C2
|
| 提出日時 | 2017-10-23 16:35:01 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 419 bytes |
| コンパイル時間 | 1,464 ms |
| コンパイル使用メモリ | 167,344 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-21 15:44:55 |
| 合計ジャッジ時間 | 2,010 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 7 |
ソースコード
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using IP = pair<int, int>;
#define INF 999999999
#define atcoder(int)1e9+7
#define Endl endl
#define all(v) (v.begin(),v.end())
#define pb(a) push_back(a)
int main() {
string s;
cin >> s;
int ans = 0;
int l = 0;
for (int i = 0; i < s.length(); i++) {
if (s[i] == 'A') {
ans += i - l;
l++;
}
}
cout << ans << endl;
return 0;
}
Project2017C2