結果

問題 No.2419 MMA文字列2
ユーザー rlangevinrlangevin
提出日時 2023-09-03 15:12:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 167 ms / 2,000 ms
コード長 232 bytes
コンパイル時間 337 ms
コンパイル使用メモリ 86,480 KB
実行使用メモリ 81,352 KB
最終ジャッジ日時 2023-09-03 15:12:41
合計ジャッジ時間 5,658 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
70,740 KB
testcase_01 AC 71 ms
71,076 KB
testcase_02 AC 75 ms
70,528 KB
testcase_03 AC 76 ms
75,936 KB
testcase_04 AC 76 ms
75,804 KB
testcase_05 AC 76 ms
70,740 KB
testcase_06 AC 75 ms
70,948 KB
testcase_07 AC 78 ms
70,988 KB
testcase_08 AC 70 ms
70,992 KB
testcase_09 AC 70 ms
71,116 KB
testcase_10 AC 71 ms
71,192 KB
testcase_11 AC 78 ms
75,896 KB
testcase_12 AC 94 ms
76,816 KB
testcase_13 AC 80 ms
75,988 KB
testcase_14 AC 115 ms
78,100 KB
testcase_15 AC 98 ms
77,412 KB
testcase_16 AC 109 ms
78,272 KB
testcase_17 AC 87 ms
76,796 KB
testcase_18 AC 116 ms
78,352 KB
testcase_19 AC 112 ms
78,516 KB
testcase_20 AC 89 ms
76,688 KB
testcase_21 AC 86 ms
76,488 KB
testcase_22 AC 153 ms
81,244 KB
testcase_23 AC 164 ms
80,936 KB
testcase_24 AC 163 ms
81,300 KB
testcase_25 AC 151 ms
81,352 KB
testcase_26 AC 91 ms
76,620 KB
testcase_27 AC 148 ms
81,164 KB
testcase_28 AC 157 ms
81,260 KB
testcase_29 AC 167 ms
81,348 KB
testcase_30 AC 156 ms
80,972 KB
testcase_31 AC 158 ms
81,116 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

S = list(input())
S = [ord(s) - ord("A") for s in S]
cnt = [0] * 26
ans = 0
for s in S:
    for i in range(26):
        if i == s:
            continue
        ans += cnt[i] * (cnt[i] - 1)//2
    cnt[s] += 1
    
print(ans)
        
0