Submission #601388

#TimeUsernameProblemLanguageResultExecution timeMemory
601388penguinhackerGenetics (BOI18_genetics)C++17
46 / 100
2025 ms38984 KiB
#include <bits/stdc++.h> #pragma GCC target("popcnt") using namespace std; #define ll long long #define ar array const int mxN=4100; int n, m, k, mp[256]; string s[mxN]; bitset<mxN> oc[mxN][4]; bool bad[mxN]; int main() { ios::sync_with_stdio(0); cin.tie(0); mp['A']=0, mp['C']=1, mp['T']=2, mp['G']=3; cin >> n >> m >> k; for (int i=0; i<n; ++i) { cin >> s[i]; for (int j=0; j<m; ++j) oc[i][mp[s[i][j]]][j]=1; } for (int i=0; i<n; ++i) { if (bad[i]) continue; for (int j=0; j<n; ++j) if (i!=j) { int same=0; for (int l=0; l<4; ++l) same+=(oc[i][l]&oc[j][l]).count(); if (m-same!=k) { bad[i]=bad[j]=1; break; } } if (!bad[i]) { cout << i+1; return 0; } } return 0; }

Compilation message (stderr)

genetics.cpp: In function 'int main()':
genetics.cpp:22:20: warning: array subscript has type 'char' [-Wchar-subscripts]
   22 |    oc[i][mp[s[i][j]]][j]=1;
      |                    ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...