#abc225a. A - Distinct Strings
A - Distinct Strings
Score : points
问题陈述
你得到一个长度为 的字符串 ,其中包含小写英文字母。
通过排列 中的字符,可以得到多少种不同的字符串?
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
You are given a string of length consisting of lowercase English letters.
How many different strings can be obtained by permuting the characters in ?
Constraints
- is a string of length consisting of lowercase English letters.
Input
Input is given from Standard Input in the following format:
Output
Print the number of different strings that can be obtained by permuting the characters in .
Sample Input 1
aba
Sample Output 1
3
By permuting the characters in aba
, three different strings can be obtained: aab
, aba
, baa
.
Sample Input 2
ccc
Sample Output 2
1
By permuting the characters in ccc
, just one string can be obtained: ccc
.
Sample Input 3
xyz
Sample Output 3
6
By permuting the characters in xyz
, six different strings can be obtained: xyz
, xzy
, yxz
, yzx
, zxy
, zyx
.
update @ 2024/3/10 09:52:42