Submission #473212

#TimeUsernameProblemLanguageResultExecution timeMemory
473212morasha3Genetics (BOI18_genetics)C++17
27 / 100
2078 ms2892 KiB
#include<bits/stdc++.h> typedef long long ll; const ll mod = (ll) 1e9 + 7; const ll mx = (ll) 2e5 +7; using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); ll n,k,ans=0,t; cin>>n>>k>>t; vector<string>v; string s; for(int i=0;i<n;i++) { cin>>s; v.push_back(s); } for(int i=0;i<n;i++) { bool g=1; for(int j=0;j<n;j++) { if(i==j)continue; ll r=t; bool f=1; for(int h=0;h<k;h++) { if(v[i][h]!=v[j][h]) { r--; if(r==-1) { f=0; break; } } } if(f==0||r!=0) { g=0; break; } } if(g==1) { ans=i+1; break; } } cout<<ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...