This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |