#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 7;
int n, d;
long long ans ;
string st[N] ;
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
#ifndef ONLINE_JUDGE
#endif
cin >> n >> d ;
for(int i = 0 ;i < n; ++ i){
cin >> st[i] ;
}
for(int i = 0 ;i < n; ++ i ){
for(int j = 0 ;j < i ; ++ j){
int diff = 0 ;
for(int k = 0 ; k < 4 ; ++ k){
diff += (st[i][k] != st[j][k]) ;
}
ans += (diff == d) ;
}
}
cout << ans ;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
11 ms |
6476 KB |
Output is correct |
2 |
Correct |
9 ms |
6588 KB |
Output is correct |
3 |
Correct |
8 ms |
6476 KB |
Output is correct |
4 |
Correct |
864 ms |
6660 KB |
Output is correct |
5 |
Execution timed out |
1094 ms |
6604 KB |
Time limit exceeded |
6 |
Execution timed out |
1080 ms |
6604 KB |
Time limit exceeded |
7 |
Correct |
847 ms |
6724 KB |
Output is correct |
8 |
Execution timed out |
1088 ms |
6604 KB |
Time limit exceeded |
9 |
Execution timed out |
1097 ms |
6728 KB |
Time limit exceeded |
10 |
Execution timed out |
1099 ms |
6716 KB |
Time limit exceeded |
11 |
Execution timed out |
1097 ms |
6604 KB |
Time limit exceeded |
12 |
Execution timed out |
1092 ms |
6732 KB |
Time limit exceeded |
13 |
Execution timed out |
1087 ms |
6604 KB |
Time limit exceeded |
14 |
Execution timed out |
1091 ms |
6604 KB |
Time limit exceeded |
15 |
Execution timed out |
1088 ms |
6732 KB |
Time limit exceeded |
16 |
Execution timed out |
1083 ms |
6732 KB |
Time limit exceeded |
17 |
Execution timed out |
1099 ms |
6732 KB |
Time limit exceeded |
18 |
Execution timed out |
1088 ms |
6732 KB |
Time limit exceeded |
19 |
Execution timed out |
1091 ms |
6732 KB |
Time limit exceeded |
20 |
Execution timed out |
1082 ms |
6732 KB |
Time limit exceeded |