# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
895711 | pcc | Genetics (BOI18_genetics) | C++14 | 2067 ms | 11092 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,popcnt")
#define ll long long
#define pll pair<ll,ll>
#define pii pair<int,int>
#define fs first
#define sc second
#define tlll tuple<ll,ll,ll>
const int mxn = 4140;
bitset<mxn> dp[mxn][5];
int N,M,K;
bitset<mxn> no;
int main(){
ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
cin>>N>>M>>K;
for(int i = 0;i<N;i++){
string s;
cin>>s;
for(int j = 0;j<M;j++){
if(s[j] == 'A')dp[i][0][j] = 1;
else if(s[j] == 'T')dp[i][1][j] = 1;
else if(s[j] == 'G')dp[i][2][j] = 1;
else dp[i][3][j] = 1;
}
}
/*
for(int i = 0;i<N;i++){
cout<<i<<":"<<endl;
for(int j = 0;j<4;j++){
for(int k = 0;k<M;k++)cout<<dp[i][j][k];
cout<<endl;
}
cout<<endl;
}
*/
for(int i =0;i<N;i++){
if(no[i])continue;
bool flag = true;
for(int j = 0;j<N;j++){
if(i == j)continue;
if(((dp[i][0]^dp[j][0])|(dp[i][1]^(dp[j][1]))|(dp[i][2]^dp[j][2])|(dp[i][3]^dp[j][3])).count() != K){
flag = false;
no[i] = no[j] = true;
break;
}
}
if(flag){
cout<<i+1;
return 0;
}
}
assert(false);
}
컴파일 시 표준 에러 (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... |