結果

問題 No.559 swapAB列
ユーザー ohana
提出日時 2023-10-27 15:00:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 39 ms / 2,000 ms
コード長 122 bytes
コンパイル時間 157 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 53,252 KB
最終ジャッジ日時 2024-09-25 13:01:58
合計ジャッジ時間 1,188 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

s = input()

cnt = 0
ans = 0
for c in s[::-1]:
    if c == "A":
        cnt += 1
    else:
        ans += cnt

print(ans)
0