結果
問題 | No.2419 MMA文字列2 |
ユーザー |
|
提出日時 | 2023-08-12 14:19:03 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 921 ms / 2,000 ms |
コード長 | 350 bytes |
コンパイル時間 | 232 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 13,992 KB |
最終ジャッジ日時 | 2024-11-19 18:32:09 |
合計ジャッジ時間 | 11,342 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 30 |
ソースコード
import sys def input(): return sys.stdin.readline().rstrip() def main(): S = [ord(s)-65 for s in list(input())] ct = [0]*26 ans = 0 for s in S: ct[s] += 1 for i in range(26): if i == s: continue ans += ct[i]*(ct[i]-1)//2 print(ans) if __name__ == "__main__": main()