結果

問題 No.2419 MMA文字列2
ユーザー aaaaaaaaaa2230
提出日時 2023-08-12 13:50:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 180 ms / 2,000 ms
コード長 219 bytes
コンパイル時間 157 ms
コンパイル使用メモリ 82,332 KB
実行使用メモリ 75,776 KB
最終ジャッジ日時 2024-11-19 16:22:28
合計ジャッジ時間 3,698 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input()

ans = 0

for i in range(26):
    b = chr(ord("A")+i)

    dp = [1,0,0]

    for s in S:
        if s == b:
            dp[2] += dp[1]
            dp[1] += 1
        else:
            ans += dp[2]
print(ans)
0