注意到,长度不大于十所以能够直接全排列草过去

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
using i128 = __int128;
const int MOD = 1e9 + 7;
const ll INF = 0x3f3f3f3f3f3f3f3f;
const int N = 1e6 + 10;

void solve()
{
    string s;
    cin>>s;
    sort(s.begin(),s.end());
    int sumn = 0;
    do
    {
        bool f = 0;
        for (int i = 1 ; i < s.size() ; i++)
        {
            if (s[i] == s[i - 1])
            {
                f = 1;
                break;
            }
        }
        if (!f) sumn++;
    } while (next_permutation(s.begin(),s.end()));
    cout<<sumn;
    return;
}
int main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    int _ = 1;
    //std::cin>>_;
    while (_--)
    {
        solve();
    }
    return 0;
}