結果
問題 | No.2419 MMA文字列2 |
ユーザー |
![]() |
提出日時 | 2023-08-12 13:33:24 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 209 ms / 2,000 ms |
コード長 | 174 bytes |
コンパイル時間 | 175 ms |
コンパイル使用メモリ | 81,880 KB |
実行使用メモリ | 76,492 KB |
最終ジャッジ日時 | 2024-11-19 15:31:18 |
合計ジャッジ時間 | 4,009 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 30 |
ソースコード
s=input()ans=0from collections import defaultdictcnt=defaultdict(int)for i in s:for j in cnt:if j!=i:c=cnt[j]ans+=c*(c-1)//2cnt[i]+=1print(ans)