# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
640980 | SheikhPh | Genetics (BOI18_genetics) | C++17 | 98 ms | 6984 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;
vector<int> w;
int main()
{
int n, m, k;
cin >> n >> m >> k;
vector<vector<int>> miss(m, vector<int>(4, 0));
auto trans = [](char c){
string str = "ACTG";
for(int j =0; j < 4; j++)
{
if(str[j] == c)
return j;
}
assert(false);
};
w = vector<int>(n);
int sum = 0;
for(int i =0; i <n; i++)
{
w[i] = rand() % 137;
sum+= w[i];
}
vector<string> lin(n);
for(int i =0; i < n; i++)
{
cin >> lin[i];
}
for(int i = 0; i < m; i++)
{
for(int j= 0; j < n; j++)
{
miss[i][trans(lin[j][i])] += w[j];
}
}
for(int i =0; i < n; i ++)
{
bool flag = true;
int ans = 0;
for(int j= 0; j < m; j++)
{
for(int ii =0; ii < 4; ii ++)
{
if("ACTG"[ii] != lin[i][j])
ans += miss[j][ii];
}
}
if(ans == k* (sum - w[i]))
{
cout << i +1;
return 0;
}
}
assert(false);
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... |