#include <bits/stdc++.h>
using namespace std;
#define FOR for(int i=1;i<=n;i++)
#define FOr for(int i=n;i>=1;i--)
#define pb push_back
#define mp make_pair
#define sf scanf
#define pf printf
#define lo long long
#define lim 999999999
#define LIM -999999999
#define li 100005
int n,m,cev;
map<string,int> mpp;
string s;
vector<string> v;
string ss;
int main(){
cin>>n;
for(int i=1;i<=n;i++){
cin>>s;
v.pb(s);
for(int j=0;j<(int)s.size();j++){
ss+=s[j];
mpp[ss]++;
//~ cout<<"----->>"<<mpp[ss]<<'\n';
}
ss.clear();
}
for(int i=0;i<(int)v.size();i++){
if(mpp[v[i]]>1){
cev+=mpp[v[i]]-1;
}
}
cout<<cev;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
2 |
Incorrect |
3 ms |
480 KB |
Output isn't correct |
3 |
Incorrect |
3 ms |
480 KB |
Output isn't correct |
4 |
Incorrect |
3 ms |
568 KB |
Output isn't correct |
5 |
Incorrect |
5 ms |
660 KB |
Output isn't correct |
6 |
Incorrect |
6 ms |
872 KB |
Output isn't correct |
7 |
Incorrect |
8 ms |
900 KB |
Output isn't correct |
8 |
Correct |
9 ms |
1284 KB |
Output is correct |
9 |
Incorrect |
28 ms |
1936 KB |
Output isn't correct |
10 |
Incorrect |
45 ms |
3340 KB |
Output isn't correct |
11 |
Incorrect |
41 ms |
3340 KB |
Output isn't correct |
12 |
Correct |
107 ms |
5948 KB |
Output is correct |
13 |
Incorrect |
71 ms |
5948 KB |
Output isn't correct |
14 |
Incorrect |
79 ms |
6416 KB |
Output isn't correct |
15 |
Incorrect |
102 ms |
6672 KB |
Output isn't correct |
16 |
Incorrect |
72 ms |
6672 KB |
Output isn't correct |
17 |
Correct |
25 ms |
6672 KB |
Output is correct |
18 |
Correct |
19 ms |
6672 KB |
Output is correct |
19 |
Incorrect |
80 ms |
6672 KB |
Output isn't correct |
20 |
Incorrect |
37 ms |
6672 KB |
Output isn't correct |