# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
320185 | Karen124 | PIN (CEOI10_pin) | C++14 | 1098 ms | 16228 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const ll N = 5e5 + 5;
const ll INF = 1e18 + 10;
int n, d, ans;
string a[N];
int f(string s1, string s2){
int ret = 0;
for (int i = 0; i < 4; i++){
ret += (s1[i] != s2[i]);
}
return ret;
}
int main (){
cin >> n >> d;
for (int i = 0; i < n; i++){
cin >> a[i];
for (int j = 0; j < i; j++){
ans += (f(a[i], a[j]) == d);
}
}
cout << ans << '\n';
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |