結果

問題 No.2419 MMA文字列2
ユーザー SPD_9X2
提出日時 2023-08-23 06:40:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 134 ms / 2,000 ms
コード長 172 bytes
コンパイル時間 286 ms
コンパイル使用メモリ 82,372 KB
実行使用メモリ 75,984 KB
最終ジャッジ日時 2024-12-21 07:04:14
合計ジャッジ時間 4,119 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input()
d = [0] * 26
ans = 0

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