# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
952829 | koukirocks | Genetics (BOI18_genetics) | C++17 | 357 ms | 9820 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 speed ios_base::sync_with_stdio(0); cin.tie(0)
#define all(x) (x).begin(),(x).end()
#define F first
#define S second
namespace{using namespace std;}
typedef long long ll;
typedef double db;
typedef long double ldb;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MAX=2e3+10,P=1e9+7;
const ll INF=0x3f3f3f3f,oo=0x3f3f3f3f3f3f3f3f;
int n,m,k;
bitset<2000> gne[MAX];
int main() {
speed;
cin>>n>>m>>k;
for (int i=1;i<=n;i++) {
for (int j=0;j<m;j++) {
char c;
cin>>c;
gne[i][j]=(c=='A');
}
}
int ans=-1;
for (int i=1;i<=n;i++) {
bool flag=true;
for (int j=1;j<=n;j++) {
if (i==j) continue;
if ((gne[i]^gne[j]).count()!=k) {
flag=false;
break;
}
}
if (flag) {
ans=i;
break;
}
}
cout<<ans<<"\n";
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... |