#include <bits/stdc++.h>
#define rep(a,b,c) for(int a=b; a<c; a++)
#define repa(a,b) for(auto a:b)
#define fi first
#define se second
#define pii pair<int, int>
#define ll long long
#define endl "\n"
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n, d, ans=0;
cin>>n>>d;
string s[n];
rep(i,0,n){
cin>>s[i];
rep(j,0,i){
int c=0;
rep(k,0,4) if(s[i][k]!=s[j][k]) c++;
if(c==d) ans++;
}
}
cout<<ans<<endl;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
348 KB |
Output is correct |
2 |
Correct |
4 ms |
348 KB |
Output is correct |
3 |
Correct |
3 ms |
348 KB |
Output is correct |
4 |
Correct |
596 ms |
1116 KB |
Output is correct |
5 |
Correct |
912 ms |
1368 KB |
Output is correct |
6 |
Correct |
909 ms |
1360 KB |
Output is correct |
7 |
Correct |
585 ms |
1360 KB |
Output is correct |
8 |
Execution timed out |
1066 ms |
1372 KB |
Time limit exceeded |
9 |
Execution timed out |
1058 ms |
1928 KB |
Time limit exceeded |
10 |
Execution timed out |
1010 ms |
2384 KB |
Time limit exceeded |
11 |
Execution timed out |
1044 ms |
1408 KB |
Time limit exceeded |
12 |
Execution timed out |
1066 ms |
1884 KB |
Time limit exceeded |
13 |
Execution timed out |
1054 ms |
1372 KB |
Time limit exceeded |
14 |
Execution timed out |
1037 ms |
1348 KB |
Time limit exceeded |
15 |
Execution timed out |
1055 ms |
2132 KB |
Time limit exceeded |
16 |
Execution timed out |
1037 ms |
1620 KB |
Time limit exceeded |
17 |
Execution timed out |
1022 ms |
2236 KB |
Time limit exceeded |
18 |
Execution timed out |
1101 ms |
1684 KB |
Time limit exceeded |
19 |
Execution timed out |
1053 ms |
1884 KB |
Time limit exceeded |
20 |
Execution timed out |
1092 ms |
2360 KB |
Time limit exceeded |