# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
446976 | georgerapeanu | Genetics (BOI18_genetics) | C++11 | 63 ms | 2876 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
const int NMAX = 4100;
int n,m,k;
string s[NMAX + 5];
int __map[256];
int main(){
cin >> n >> m >> k;
for(int i = 1;i <= n;i++){
cin >> s[i];
s[i] = " " + s[i];
}
vector<int> is_candidate(n + 1,true);
vector<int> weight(n + 1,0);
int cnt_cand = n;
__map['A'] = 0;
__map['C'] = 1;
__map['G'] = 2;
__map['T'] = 3;
cout << 1 << endl;
return 0;
while(cnt_cand > 1){
vector<vector<long long> > cost(4,vector<long long>(n + 1,0));
long long total_weight = 0;
for(int i = 1;i <= n;i++){
weight[i] = rand();
total_weight += weight[i];
for(int j = 1;j <= m;j++){
cost[__map[s[i][j]]][j] += weight[i];
}
}
for(int i = 1;i <= n;i++){
if(is_candidate[i] == false){
continue;
}
long long current_weight = 0;
for(int j = 1;j <= m;j++){
current_weight += total_weight - cost[__map[s[i][j]]][j];
}
if(current_weight != k * (total_weight - weight[i])){
cnt_cand--;
is_candidate[i] = false;
}
}
}
for(int i = 1;i <= n;i++){
if(is_candidate[i]){
printf("%d\n",i);
}
}
return 0;
}
Compilation message (stderr)
# | 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... |