Submission #473620

#TimeUsernameProblemLanguageResultExecution timeMemory
473620sobaGenetics (BOI18_genetics)C++14
0 / 100
2083 ms5724 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 4101; int n ,m ,k ; int vis[N]; string s[N]; int main() { // ios_base::sync_with_stdio(0); // cin.tie(0); cin >> n >> m >> k; vector<int>v; for(int i = 0 ; i < n ; i++) { cin >> s[i]; v.push_back(i); } random_shuffle(v.begin() , v.end()); while(true) { if(vis[v[0]]) continue; int c; bool flag=true; vis[v[0]]++; for(int i = 1 ; i < n ; i++) { c=0; for(int j = 0 ; j < m ; j++) { if(s[v[0]][j]!=s[v[i]][j]) c++; if(c>k)break; } if(c!=k) { vis[v[i]]++; flag=false; break; } } if(flag) { cout << v[0]+1 ; return 0; } random_shuffle(v.begin() , v.end()); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...