結果

問題 No.559 swapAB列
ユーザー iad_2889iad_2889
提出日時 2019-05-17 00:19:02
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 244 bytes
コンパイル時間 114 ms
コンパイル使用メモリ 11,820 KB
実行使用メモリ 10,044 KB
最終ジャッジ日時 2023-10-17 07:06:23
合計ジャッジ時間 1,188 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,044 KB
testcase_01 AC 30 ms
10,044 KB
testcase_02 AC 28 ms
10,044 KB
testcase_03 AC 28 ms
10,044 KB
testcase_04 AC 27 ms
10,044 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 29 ms
10,044 KB
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input()
ans = 0
if len(set(S)) != 1:
    for i,s in enumerate(S):
        if s == "A":
            j = 0
            for j in range(i - 1,0,-1):
                if S[j - 1] == "A":
                    break
            ans+=i - j
print(ans)
0