# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
777774 | TheSahib | Genetics (BOI18_genetics) | C++14 | 2041 ms | 18932 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>
#define ll long long
#define oo 1e9
#define pii pair<int, int>
using namespace std;
bitset<4100> st[4100];
void solve(){
int n, m, k; scanf("%d%d%d", &n, &m, &k);
for (int i = 0; i < n; i++)
{
getchar();
for (int j = 0; j < m; j++)
{
char c = getchar();
st[i][j] = (c == 'C');
}
}
vector<int> v;
v.resize(n);
iota(v.begin(), v.end(), 0);
random_shuffle(v.begin(), v.end());
for (int i:v)
{
bool pos = true;
for (int j:v)
{
if(i == j) continue;
if((st[i] ^ st[j]).count() != k){
pos = false;
break;
}
}
if(pos){
cout << i + 1 << '\n';
return;
}
}
}
int main()
{
solve();
}
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... |