#include <bits/stdc++.h>
// #pragma GCC optimize("O3")
// #pragma GCC optimize("unroll_loops")
// #pragma GCC target("avx2")
using namespace std;
using ll = int;
using vll = vector<ll>;
using pll = pair<ll,ll>;
using vpl = vector<pll>;
using vvl =vector<vll>;
#define f first
#define s second
#define pb push_back
#define all(v) v.begin(),v.end()
ll calc(vll a, vll b){
ll ans = 0;
for(ll i = 0; i < a.size(); ++i)if(a[i]!=b[i])ans++;
return ans;
}
int main(){
ios_base::sync_with_stdio(0);cin.tie(NULL);
ll n, m, k;
cin >> n >> m >> k;
vvl lw(n, vll(m));
for(ll i = 0; i < n; ++i){
for(ll j = 0; j < m; ++j){
char c;
cin >> c;
if(c=='A')lw[i][j]=0;
if(c=='C')lw[i][j]=1;
if(c=='T')lw[i][j]=2;
if(c=='G')lw[i][j]=3;
}
}
vll ord(n);
iota(all(ord),0);
random_device g;
shuffle(all(ord), g);
for(ll i: ord){
ll o=0;
for(ll j: ord){
if(j==i)continue;
if(calc(lw[i], lw[j])!=k){
o=1;
break;
}
}
if(!o){cout << i+1;break;}
}
}
# | 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... |