Submission #769421

#TimeUsernameProblemLanguageResultExecution timeMemory
769421_Avocado_Genetics (BOI18_genetics)C++17
0 / 100
31 ms3468 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[65] = 0; mp[67] = 1; mp[71] = 2; mp[84] = 3; for(int i = 0; i<n; ++i){ string s; cin>>s; input[i] = s; for(int j = 0; j<m; ++j){ int index = (int)s[j]; ++v[j][mp[index]]; } } 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){ int index = (int)input[i][j]; if(kk == mp[index]) 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...