# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
135677 | Plurm | Genetics (BOI18_genetics) | C++11 | 2036 ms | 20124 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
char dna[4200][4200];
bitset<4200> enc1[4200];
bitset<4200> enc2[4200];
int cnt[4200][4];
inline int getMask(int x){
switch(x){
case 'A':
return 0;
case 'T':
return 1;
case 'C':
return 2;
case 'G':
return 3;
}
}
int main(){
int n,m,k;
scanf("%d%d%d",&n,&m,&k);
for(int i = 1; i <= n; i++){
scanf("%s",dna[i]+1);
for(int j = 1; j <= m; j++){
cnt[j][getMask(dna[i][j])]++;
if(dna[i][j] == 'A' || dna[i][j] == 'T'){
enc1[i][j] = 0;
}else{
enc1[i][j] = 1;
}
if(dna[i][j] == 'A' || dna[i][j] == 'C'){
enc2[i][j] = 0;
}else{
enc2[i][j] = 1;
}
}
}
vector<int> v;
for(int i = 1; i <= n; i++){
int diffcnt = 0;
int ccnt = 0;
int nx = i % n + 1;
for(int j = 1; j <= m; j++){
diffcnt += n - cnt[j][getMask(dna[i][j])];
if(dna[i][j] != dna[nx][j]) ccnt++;
}
if(true){
v.push_back(i);
}
}
for(int i : v){
bool ok = true;
for(int o = 1; o <= n; o++){
if(o == i) continue;
int cur = ((enc1[i] ^ enc1[o]) | (enc2[i] ^ enc2[o])).count();
if(cur != k){
ok = false;
break;
}
}
if(ok){
printf("%d\n",i);
return 0;
}
}
}
컴파일 시 표준 에러 (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... |