結果

問題 No.2419 MMA文字列2
ユーザー 👑 H20H20
提出日時 2023-08-12 13:50:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 133 ms / 2,000 ms
コード長 174 bytes
コンパイル時間 154 ms
コンパイル使用メモリ 82,420 KB
実行使用メモリ 85,644 KB
最終ジャッジ日時 2024-04-30 04:14:20
合計ジャッジ時間 3,349 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
52,352 KB
testcase_01 AC 35 ms
51,712 KB
testcase_02 AC 36 ms
52,224 KB
testcase_03 AC 43 ms
59,392 KB
testcase_04 AC 40 ms
59,520 KB
testcase_05 AC 35 ms
52,028 KB
testcase_06 AC 35 ms
52,096 KB
testcase_07 AC 36 ms
51,840 KB
testcase_08 AC 36 ms
52,096 KB
testcase_09 AC 36 ms
51,840 KB
testcase_10 AC 36 ms
51,840 KB
testcase_11 AC 40 ms
59,392 KB
testcase_12 AC 60 ms
65,280 KB
testcase_13 AC 45 ms
60,416 KB
testcase_14 AC 75 ms
71,168 KB
testcase_15 AC 61 ms
66,304 KB
testcase_16 AC 75 ms
71,168 KB
testcase_17 AC 53 ms
62,976 KB
testcase_18 AC 76 ms
71,680 KB
testcase_19 AC 78 ms
72,448 KB
testcase_20 AC 53 ms
63,872 KB
testcase_21 AC 51 ms
62,976 KB
testcase_22 AC 126 ms
85,120 KB
testcase_23 AC 133 ms
85,180 KB
testcase_24 AC 132 ms
85,120 KB
testcase_25 AC 124 ms
85,120 KB
testcase_26 AC 49 ms
61,824 KB
testcase_27 AC 118 ms
85,284 KB
testcase_28 AC 126 ms
85,120 KB
testcase_29 AC 131 ms
85,232 KB
testcase_30 AC 129 ms
85,240 KB
testcase_31 AC 128 ms
85,644 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

S = list(input())
DP = [0]*26
ans = 0
for s in S:
    i = ord(s)-ord('A')
    DP[i]+=1
    for j in range(26):
        if i!=j:
            ans+=DP[j]*(DP[j]-1)//2
print(ans)
0