結果

問題 No.2419 MMA文字列2
ユーザー prd_xxxprd_xxx
提出日時 2023-08-12 13:48:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 146 ms / 2,000 ms
コード長 225 bytes
コンパイル時間 166 ms
コンパイル使用メモリ 82,384 KB
実行使用メモリ 76,120 KB
最終ジャッジ日時 2024-04-30 04:08:24
合計ジャッジ時間 3,397 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
52,484 KB
testcase_01 AC 36 ms
53,416 KB
testcase_02 AC 35 ms
52,092 KB
testcase_03 AC 41 ms
60,592 KB
testcase_04 AC 41 ms
59,752 KB
testcase_05 AC 36 ms
52,504 KB
testcase_06 AC 36 ms
53,296 KB
testcase_07 AC 37 ms
52,320 KB
testcase_08 AC 36 ms
52,556 KB
testcase_09 AC 35 ms
52,440 KB
testcase_10 AC 35 ms
52,704 KB
testcase_11 AC 41 ms
61,180 KB
testcase_12 AC 64 ms
66,176 KB
testcase_13 AC 46 ms
62,248 KB
testcase_14 AC 75 ms
71,472 KB
testcase_15 AC 62 ms
67,464 KB
testcase_16 AC 77 ms
70,836 KB
testcase_17 AC 53 ms
64,508 KB
testcase_18 AC 80 ms
71,160 KB
testcase_19 AC 87 ms
72,824 KB
testcase_20 AC 56 ms
64,560 KB
testcase_21 AC 53 ms
63,300 KB
testcase_22 AC 125 ms
75,948 KB
testcase_23 AC 114 ms
75,972 KB
testcase_24 AC 110 ms
76,120 KB
testcase_25 AC 125 ms
75,972 KB
testcase_26 AC 47 ms
61,520 KB
testcase_27 AC 97 ms
70,700 KB
testcase_28 AC 120 ms
75,984 KB
testcase_29 AC 146 ms
75,988 KB
testcase_30 AC 124 ms
75,972 KB
testcase_31 AC 137 ms
75,908 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input()

cnt = [0]*26
ans = 0
for c in S:
    i = ord(c) - ord('A')
    cnt[i] += 1
    for j in range(26):
        if i==j: continue
        if cnt[j] >= 2:
            n = cnt[j]
            ans += n*(n-1)//2
print(ans)
0