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 rep(i, a, b) for (int i = a; i < b; ++i)
#define per(i, a, b) for (int i = b - 1; i >= a; --i)
#define trav(a, x) for (auto& a : x)
#define sz(a) a.size()
#define umap unordered_map
#define uset unordered_set
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
int main() {
cin.tie(0)->sync_with_stdio(0);
int n, m,k;
string dnas[4101];
int cnt[4101];
cin >> n >> m>>k;
rep(i, 0, n) {
cnt[i]=0;
string dna;
cin >> dna;
dnas[i]=dna;
rep(j,0,i){
string prev=dnas[j];
int diff=0;
rep(l,0,m)if(dna[l]!=prev[l])++diff;
if(diff==k)++cnt[j],++cnt[i];
}
}
rep(i,0,n)if(cnt[i]==n-1)cout<<i+1<<endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |