#include <iostream>
using namespace std;
const int N = 2e5 + 7;
string str[N];
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
for(int i = 0; i < n; i++)
cin >> str[i];
int ans = 0;
for(int i = 0; i < n; i++){
for(int j = 0; j < n; j++){
if(i != j){
int x = str[j].find(str[i]);
if(x != -1)
ans++;
}
}
}
cout << ans << endl;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
6484 KB |
Output is correct |
2 |
Correct |
4 ms |
6460 KB |
Output is correct |
3 |
Correct |
4 ms |
6484 KB |
Output is correct |
4 |
Correct |
6 ms |
6592 KB |
Output is correct |
5 |
Correct |
19 ms |
6588 KB |
Output is correct |
6 |
Correct |
44 ms |
6596 KB |
Output is correct |
7 |
Correct |
64 ms |
6580 KB |
Output is correct |
8 |
Correct |
54 ms |
6604 KB |
Output is correct |
9 |
Execution timed out |
1081 ms |
6596 KB |
Time limit exceeded |
10 |
Execution timed out |
1085 ms |
6612 KB |
Time limit exceeded |
11 |
Execution timed out |
1091 ms |
6612 KB |
Time limit exceeded |
12 |
Execution timed out |
1095 ms |
6596 KB |
Time limit exceeded |
13 |
Execution timed out |
1089 ms |
6740 KB |
Time limit exceeded |
14 |
Execution timed out |
1069 ms |
6696 KB |
Time limit exceeded |
15 |
Execution timed out |
1081 ms |
6740 KB |
Time limit exceeded |
16 |
Execution timed out |
1087 ms |
6728 KB |
Time limit exceeded |
17 |
Execution timed out |
1084 ms |
6704 KB |
Time limit exceeded |
18 |
Execution timed out |
1087 ms |
6740 KB |
Time limit exceeded |
19 |
Execution timed out |
1092 ms |
6612 KB |
Time limit exceeded |
20 |
Execution timed out |
1094 ms |
6728 KB |
Time limit exceeded |