# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
952960 | 2024-03-25T07:49:40 Z | koukirocks | Genetics (BOI18_genetics) | C++17 | 124 ms | 9172 KB |
#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 #pragma GCC optimize("O3") #pragma GCC target("avx2") 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=4200+10,P=1e9+7; const ll INF=0x3f3f3f3f,oo=0x3f3f3f3f3f3f3f3f; int n,m,k; struct gene{ int id; bitset<MAX> seq[4]; }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].seq[0][j]=(c=='A'); gne[i].seq[1][j]=(c=='T'); gne[i].seq[2][j]=(c=='C'); gne[i].seq[3][j]=(c=='G'); } } random_shuffle(gne+1,gne+1+n); 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].seq[0]^gne[j].seq[0]).count()+(gne[i].seq[1]^gne[j].seq[1]).count()+(gne[i].seq[2]^gne[j].seq[2]).count()+(gne[i].seq[3]^gne[j].seq[3]).count()!=2*k) { flag=false; break; } } if (flag) { ans=gne[i].id; break; } } cout<<ans<<"\n"; return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 9052 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 124 ms | 9172 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 124 ms | 9172 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 9052 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |