結果

問題 No.559 swapAB列
ユーザー brthyyjpbrthyyjp
提出日時 2020-06-18 05:53:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 71 ms / 2,000 ms
コード長 139 bytes
コンパイル時間 537 ms
コンパイル使用メモリ 86,580 KB
実行使用メモリ 71,268 KB
最終ジャッジ日時 2023-09-16 11:55:52
合計ジャッジ時間 1,725 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,172 KB
testcase_01 AC 70 ms
70,832 KB
testcase_02 AC 71 ms
71,056 KB
testcase_03 AC 69 ms
70,976 KB
testcase_04 AC 70 ms
71,268 KB
testcase_05 AC 71 ms
71,012 KB
testcase_06 AC 71 ms
70,932 KB
testcase_07 AC 70 ms
70,872 KB
testcase_08 AC 71 ms
70,856 KB
testcase_09 AC 70 ms
70,872 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

s = str(input())
b = 0
ans = 0
for i in range(len(s)):
    if s[i] == 'A':
        ans += b
    if s[i] == 'B':
        b += 1

print(ans)
0