#Z15303. 基因相关性

基因相关性

Description

To determine the functional and structural similarity between gene sequences, it is often necessary to align several different DNA sequences to assess whether the aligned DNA sequences are related.
Given two DNA sequences of the same length, define the bases at the same position in the two sequences as a base pair. If the two bases in a base pair are identical, it is referred to as a matching base pair.
Next, calculate the proportion of matching base pairs relative to the total number of base pairs. If this proportion is greater than or equal to a given threshold, the two DNA sequences are considered related; otherwise, they are unrelated.

Input Format

There are three lines of input:

  • The first line contains the threshold used to determine whether the two DNA sequences are related.
  • The next two lines contain the two DNA sequences (each with a length not exceeding 500).

Output Format

If the two DNA sequences are related, output "yes"; otherwise, output "no".

Example Input:
0.5
ATCG
ATGC

Example Output:
yes

Explanation:

  • The two sequences have 3 matching base pairs (A-A, T-T, G-G) out of 4 total base pairs.
  • The proportion is 3/4 = 0.75, which is greater than the threshold of 0.5.
  • Therefore, the output is "yes".
0.85
ATCGCCGTAAGTAACGGTTTTAAATAGGCC
ATCGCCGGAAGTAACGGTCTTAAATAGGCC

yes