62112023-11-08 09:43:00EsVagySzózatcpp17Accepted 100/1003ms4504 KiB
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>

using namespace std;

int main()
{
    int chars = 26;
    int unknowns = 0;

    int size;
    cin >> size;
    for (int i = 0; i < size; i++)
    {
        char c;
        cin >> c;

        if (c == '_')
        {
            unknowns++;
        }
        else
        {
            chars--;
        }
    }

    long int ans = 1;
    for (int i = chars; unknowns > 0; chars--, unknowns--)
    {
        ans *= chars;
    }

    cout << ans;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1872 KiB
2Accepted3ms2124 KiB
subtask210/10
3Accepted3ms2368 KiB
4Accepted3ms2704 KiB
5Accepted2ms2768 KiB
subtask320/20
6Accepted3ms2988 KiB
7Accepted3ms3204 KiB
8Accepted3ms3384 KiB
9Accepted3ms3416 KiB
10Accepted3ms3596 KiB
11Accepted2ms3812 KiB
subtask430/30
12Accepted3ms4048 KiB
13Accepted2ms3996 KiB
14Accepted3ms4124 KiB
15Accepted2ms4204 KiB
16Accepted2ms4328 KiB
17Accepted2ms4204 KiB
subtask540/40
18Accepted2ms4320 KiB
19Accepted2ms4472 KiB
20Accepted3ms4436 KiB
21Accepted2ms4504 KiB
22Accepted2ms4492 KiB
23Accepted3ms4484 KiB
24Accepted2ms4480 KiB