結果
| 問題 | No.2419 MMA文字列2 |
| コンテスト | |
| ユーザー |
rlangevin
|
| 提出日時 | 2023-09-03 15:12:34 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 109 ms / 2,000 ms |
| + 514µs | |
| コード長 | 232 bytes |
| 記録 | |
| コンパイル時間 | 239 ms |
| コンパイル使用メモリ | 96,236 KB |
| 実行使用メモリ | 88,576 KB |
| 最終ジャッジ日時 | 2026-07-26 04:11:54 |
| 合計ジャッジ時間 | 4,544 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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