Submission #769404

#TimeUsernameProblemLanguageResultExecution timeMemory
769404_Avocado_Genetics (BOI18_genetics)C++14
0 / 100
30 ms6000 KiB
#include <bits/stdc++.h> #define int int64_t using namespace std; //a, c, g, t signed main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); //freopen("input.in", "r", stdin); //freopen("output.out", "w", stdout); int n, m, k; cin>>n>>m>>k; vector<array<int, 4>>v(n, array<int, 4>()); vector<string>input(n); vector<int>mp(100); mp[(int)'A'] = 0; mp[(int)'C'] = 1; mp[(int)'G'] = 2; mp[(int)'T'] = 3; for(int i = 0; i<n; ++i){ string s; cin>>s; input[i] = s; for(int j = 0; j<m; ++j){ ++v[j][mp[(int)s[j]]]; } } int ans = 0; for(int i = 0; i<n; ++i){ int cur = 0; for(int j = 0; j<m; ++j){ for(int kk = 0; kk<4; ++kk){ if(kk == mp[(int)input[i][j]]) continue; cur += v[j][kk]; } } if(cur == (n-1)*k) ans = i+1; } cout<<ans; cout<<'\n'; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...