結果

問題 No.2419 MMA文字列2
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2023-08-23 06:40:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 168 ms / 2,000 ms
コード長 172 bytes
コンパイル時間 415 ms
コンパイル使用メモリ 87,336 KB
実行使用メモリ 77,496 KB
最終ジャッジ日時 2023-08-23 06:40:57
合計ジャッジ時間 5,890 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,548 KB
testcase_01 AC 72 ms
71,400 KB
testcase_02 AC 70 ms
71,112 KB
testcase_03 AC 75 ms
76,388 KB
testcase_04 AC 75 ms
76,412 KB
testcase_05 AC 71 ms
71,456 KB
testcase_06 AC 71 ms
71,488 KB
testcase_07 AC 72 ms
71,300 KB
testcase_08 AC 71 ms
71,376 KB
testcase_09 AC 72 ms
71,576 KB
testcase_10 AC 71 ms
71,340 KB
testcase_11 AC 77 ms
76,612 KB
testcase_12 AC 92 ms
76,536 KB
testcase_13 AC 78 ms
76,420 KB
testcase_14 AC 103 ms
76,716 KB
testcase_15 AC 94 ms
76,732 KB
testcase_16 AC 107 ms
76,396 KB
testcase_17 AC 85 ms
76,540 KB
testcase_18 AC 108 ms
76,644 KB
testcase_19 AC 108 ms
76,576 KB
testcase_20 AC 86 ms
76,800 KB
testcase_21 AC 82 ms
76,532 KB
testcase_22 AC 141 ms
77,244 KB
testcase_23 AC 157 ms
77,496 KB
testcase_24 AC 153 ms
77,260 KB
testcase_25 AC 141 ms
77,280 KB
testcase_26 AC 81 ms
76,476 KB
testcase_27 AC 135 ms
76,904 KB
testcase_28 AC 143 ms
77,324 KB
testcase_29 AC 168 ms
77,016 KB
testcase_30 AC 145 ms
77,384 KB
testcase_31 AC 144 ms
77,076 KB
権限があれば一括ダウンロードができます

ソースコード

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