Submission #262465

#TimeUsernameProblemLanguageResultExecution timeMemory
262465sckmdGenetics (BOI18_genetics)C++14
46 / 100
2082 ms18424 KiB
#include <bits/stdc++.h> using namespace std; #define MAXN 4101 int decode[678]; bitset <MAXN> b0[MAXN]; bitset <MAXN> b1[MAXN]; bitset <MAXN> b2[MAXN]; bitset <MAXN> b3[MAXN]; int n,m,k; vector <int> z; bool check(int idx) { z.clear(); for(int j = 0; j < n; j++)z.push_back(j); random_shuffle(z.begin(),z.end()); for(auto id:z) { if(id==idx)continue; int r = 0; r += (b0[idx]^b0[id]).count(); r += (b1[idx]^b1[id]).count(); r += (b2[idx]^b2[id]).count(); r += (b3[idx]^b3[id]).count(); if(r != 2*k)return false; } return true; } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); decode['A']=0;decode['C']=1;decode['T']=2;decode['G']=3; cin >> n >> m >> k; for(int i = 0; i < n; i++) { for(int j = 0; j < m; j++) { int a; char c; cin >> c; a=decode[c]; if(a==0)b0[i].set(j); if(a==1)b1[i].set(j); if(a==2)b2[i].set(j); if(a==3)b3[i].set(j); } } vector <int> vec; for(int i = 0; i < n; i++)vec.push_back(i); random_shuffle(vec.begin(),vec.end()); for(auto x:vec) { if(check(x)) { cout << x+1 << "\n"; return 0; } } return 0; }

Compilation message (stderr)

genetics.cpp: In function 'int main()':
genetics.cpp:46:16: warning: array subscript has type 'char' [-Wchar-subscripts]
   46 |       a=decode[c];
      |                ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...