Submission #473130

#TimeUsernameProblemLanguageResultExecution timeMemory
473130ZaZo_Genetics (BOI18_genetics)C++14
27 / 100
2057 ms8860 KiB
#include <bits/stdc++.h> #define ZAZO ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define int long long using namespace std; char a[4100][4100]; int n , m , k; bool solve(int res) { int prev=k,cnt=0; for(int i = 0 ; i < n ; i ++) { if(i==res) continue; for(int j = 0 ; j < m ; j ++) { if(a[i][j]!=a[res][j]) cnt++; if(cnt>k) return false; } if(prev!=cnt) return false; prev=cnt; cnt=0; } return true; } int32_t main() { ZAZO cin >> n >> m >> k; for(int i = 0 ; i < n ; i ++) { for(int j = 0 ; j < m ; j ++) { cin>>a[i][j]; } } for(int i = 0 ; i < n ; i ++) { if(solve(i)){ cout<<i+1; return 0; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...