結果
| 問題 |
No.559 swapAB列
|
| コンテスト | |
| ユーザー |
ひゅーら
|
| 提出日時 | 2017-08-26 12:07:22 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 303 bytes |
| コンパイル時間 | 617 ms |
| コンパイル使用メモリ | 63,716 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-15 17:39:16 |
| 合計ジャッジ時間 | 1,144 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 7 |
ソースコード
#include <cstdio>
#include <string>
#include <iostream>
using namespace std;
int main(){
string s;
getline(cin, s);
int countB = 0;
int ans = 0;
int size = s.size();
for(int i = 0; i < size; i++){
if(s[i] == 'A'){
ans += countB;
}else{
countB++;
}
}
printf("%d\n", ans);
return 0;
}
ひゅーら