59562023-10-06 13:18:13mmatedSzózatcpp17Accepted 100/1003ms4060 KiB
#include <bits/stdc++.h>
using namespace std;
#define f(i,k,n) for(int i=k; i<n; i++)
#define ll long long
const int inf = INT_MAX;

void solve()
{
  int n;
  cin>>n;
  set<string> a;
  string x;
  f(i,0,n)  
  {
    cin>>x;
    a.insert(x);
  }  
  int s=a.size()-1;
  int c=1;
  f(i,0,n-s)    c*=(26-s-i);
  cout<<c;
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    int t=1;
    //cin>>t;
    while(t--)  solve();
    return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1828 KiB
2Accepted3ms2060 KiB
subtask210/10
3Accepted3ms2280 KiB
4Accepted3ms2628 KiB
5Accepted3ms2436 KiB
subtask320/20
6Accepted3ms2648 KiB
7Accepted2ms2640 KiB
8Accepted3ms2768 KiB
9Accepted3ms3000 KiB
10Accepted3ms3204 KiB
11Accepted2ms3204 KiB
subtask430/30
12Accepted3ms3288 KiB
13Accepted2ms3288 KiB
14Accepted3ms3420 KiB
15Accepted2ms3492 KiB
16Accepted2ms3592 KiB
17Accepted2ms3388 KiB
subtask540/40
18Accepted2ms3492 KiB
19Accepted2ms3396 KiB
20Accepted2ms3404 KiB
21Accepted3ms3632 KiB
22Accepted3ms3744 KiB
23Accepted2ms3824 KiB
24Accepted3ms4060 KiB