98192024-03-08 10:12:51FulopMateSzózatcpp17Accepted 100/1003ms4212 KiB
#include <bits/stdc++.h>
using namespace std;
using ll=long long;

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    int n;
    cin>>n;
    int choose=26;
    map<char,int> cnt;
    for (int i=0;i<n;i++){
        char c;
        cin>>c;
        cnt[c]++;
        if (cnt[c]==1 && c!='_') choose--;
    }
    ll ans=1;
    for (int i=0;i<cnt['_'];i++){
        ans*=choose;
        choose--;
    }
    cout<<ans;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1828 KiB
2Accepted3ms2048 KiB
subtask210/10
3Accepted3ms2140 KiB
4Accepted3ms2356 KiB
5Accepted3ms2568 KiB
subtask320/20
6Accepted3ms2760 KiB
7Accepted3ms2984 KiB
8Accepted3ms3208 KiB
9Accepted3ms3424 KiB
10Accepted2ms3512 KiB
11Accepted2ms3384 KiB
subtask430/30
12Accepted3ms3520 KiB
13Accepted3ms3528 KiB
14Accepted3ms3536 KiB
15Accepted3ms3640 KiB
16Accepted2ms3528 KiB
17Accepted3ms3664 KiB
subtask540/40
18Accepted3ms3752 KiB
19Accepted3ms3980 KiB
20Accepted3ms3960 KiB
21Accepted3ms4060 KiB
22Accepted3ms4068 KiB
23Accepted3ms4196 KiB
24Accepted3ms4212 KiB