結果

問題 No.2419 MMA文字列2
ユーザー ああいいああいい
提出日時 2023-08-12 18:59:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 187 ms / 2,000 ms
コード長 182 bytes
コンパイル時間 165 ms
コンパイル使用メモリ 82,248 KB
実行使用メモリ 76,712 KB
最終ジャッジ日時 2024-04-30 14:05:16
合計ジャッジ時間 3,664 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
54,664 KB
testcase_01 AC 36 ms
53,940 KB
testcase_02 AC 36 ms
54,748 KB
testcase_03 AC 39 ms
61,568 KB
testcase_04 AC 37 ms
55,652 KB
testcase_05 AC 36 ms
54,332 KB
testcase_06 AC 36 ms
54,144 KB
testcase_07 AC 36 ms
53,924 KB
testcase_08 AC 39 ms
54,224 KB
testcase_09 AC 36 ms
54,628 KB
testcase_10 AC 36 ms
54,252 KB
testcase_11 AC 36 ms
54,396 KB
testcase_12 AC 89 ms
71,284 KB
testcase_13 AC 48 ms
63,092 KB
testcase_14 AC 104 ms
76,196 KB
testcase_15 AC 79 ms
70,700 KB
testcase_16 AC 110 ms
76,232 KB
testcase_17 AC 59 ms
66,408 KB
testcase_18 AC 108 ms
76,080 KB
testcase_19 AC 111 ms
76,076 KB
testcase_20 AC 63 ms
66,844 KB
testcase_21 AC 57 ms
66,460 KB
testcase_22 AC 78 ms
76,376 KB
testcase_23 AC 79 ms
76,368 KB
testcase_24 AC 71 ms
76,352 KB
testcase_25 AC 71 ms
76,712 KB
testcase_26 AC 42 ms
62,116 KB
testcase_27 AC 50 ms
70,224 KB
testcase_28 AC 187 ms
76,348 KB
testcase_29 AC 180 ms
76,476 KB
testcase_30 AC 184 ms
76,552 KB
testcase_31 AC 178 ms
76,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input()
from collections import defaultdict

d = defaultdict(int)
ans = 0
for s in S:
	for u in d:
		if u == s:continue
		v = d[u]
		ans += v * (v - 1) // 2
	d[s] += 1
print(ans)
0