結果

問題 No.559 swapAB列
ユーザー kohei2019kohei2019
提出日時 2022-02-09 20:52:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 78 ms / 2,000 ms
コード長 162 bytes
コンパイル時間 1,217 ms
コンパイル使用メモリ 87,040 KB
実行使用メモリ 71,352 KB
最終ジャッジ日時 2023-09-07 06:42:31
合計ジャッジ時間 2,895 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,296 KB
testcase_01 AC 78 ms
71,100 KB
testcase_02 AC 74 ms
71,228 KB
testcase_03 AC 75 ms
71,096 KB
testcase_04 AC 77 ms
71,208 KB
testcase_05 AC 76 ms
71,352 KB
testcase_06 AC 76 ms
70,952 KB
testcase_07 AC 77 ms
71,220 KB
testcase_08 AC 76 ms
71,328 KB
testcase_09 AC 76 ms
71,152 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

S = list(input())

lsA = []
for i in range(len(S)):
    if S[i] == 'A':
        lsA.append(i)

ans = 0
ii = 0
for i in lsA:
    ans += i-ii
    ii += 1
print(ans)
0