Submission #753259

#TimeUsernameProblemLanguageResultExecution timeMemory
753259vjudge1Genetics (BOI18_genetics)C++17
100 / 100
1274 ms148524 KiB
#include<bits/stdc++.h> #define int long long using namespace std; int n, m, k, tot, sum[4101][4], dna[4101][4101], w[4101]; signed main() { cin >> n >> m >> k; mt19937 rng(12874); for(int i = 1; i <= n; i++) { char c; tot+=w[i]=rng(); for(int j = 0; j < m; j++) { cin >> c; if(c=='C')dna[i][j]=1; if(c=='G')dna[i][j]=2; if(c=='T')dna[i][j]=3; sum[j][dna[i][j]]+=w[i]; } } for(int i = 1; i <= n; i++) { int x = 0; for(int j = 0; j < m; j++) { x+=tot-sum[j][dna[i][j]]; } if(x==k*(tot-w[i])) cout << i << '\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...