Submission #900722

#TimeUsernameProblemLanguageResultExecution timeMemory
900722Darren0724Genetics (BOI18_genetics)C++17
100 / 100
445 ms36572 KiB
#pragma GCC optimize("Ofast","O3","unroll-loops") #pragma GCC target("avx2") #include <bits/stdc++.h> #include <bits/extc++.h> using namespace std; #define int long long #define LCBorz ios_base::sync_with_stdio(false); cin.tie(0); #define all(x) x.begin(), x.end() #define endl '\n' const int N=15005; const int mod=1e9+9; __gnu_cxx::sfmt19937 rnd(time(0)); map<char,int> m1={{'A',0},{'T',1},{'C',2},{'G',3}}; int32_t main() { LCBorz; int n,m,k;cin>>n>>m>>k; vector<int> a(n); vector<string> str(n); vector v(4,vector<int>(m,0)); int total=0; for(int i=0;i<n;i++){ a[i]=rnd(); total+=a[i]; cin>>str[i]; for(int j=0;j<m;j++){ v[m1[str[i][j]]][j]+=a[i]; } } for(int i=0;i<n;i++){ int p=-total*(m-k); for(int j=0;j<m;j++){ p+=v[m1[str[i][j]]][j]; } if(p==a[i]*k){ cout<<i+1<<endl; return 0; } } 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...