結果
| 問題 |
No.2419 MMA文字列2
|
| コンテスト | |
| ユーザー |
rlangevin
|
| 提出日時 | 2023-09-03 15:12:34 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 137 ms / 2,000 ms |
| コード長 | 232 bytes |
| コンパイル時間 | 385 ms |
| コンパイル使用メモリ | 82,028 KB |
| 実行使用メモリ | 80,752 KB |
| 最終ジャッジ日時 | 2024-06-12 20:55:37 |
| 合計ジャッジ時間 | 4,416 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 30 |
ソースコード
S = list(input())
S = [ord(s) - ord("A") for s in S]
cnt = [0] * 26
ans = 0
for s in S:
for i in range(26):
if i == s:
continue
ans += cnt[i] * (cnt[i] - 1)//2
cnt[s] += 1
print(ans)
rlangevin