개발자 톡

연습문제 톡 [HSAT 6회 정기 코딩 인증평가 기출] 염기서열 커버

[HSAT 6차] 염기서열 오답 원인?

등록일
2023-05-12 17:54:49
조회수
1172
작성자
lyuhit


import sys

n,m = map(int, input().split())
first = input()
agcts = [list(first)]

for i in range(n-1):
    now = list(input())

    # 선발된 염기서열 하나씩 비교
    for agct in agcts:
        same = True
        # 염기서열 한 자리 씩 비교
        for j in range(m):
            if now[j] != agct[j] and now[j] != "." and agct[j] != "." :
                same = False
        if same :
            for k in range(m):
                if agct[k] == "." and now[k] != ".":
                    agct[k] = now[k]
            break
    else:
        agcts.append(now)

print(len(agcts))



#[hsat_6회_정기_코딩_인증평가_기출]_염기서열_커버
#[hsat_6차]_염기서열

이 카테고리의 톡 더보기