-->
当前位置:首页 > 题库

PROGRAMMING:Restoring gene chain

Luz5年前 (2021-05-10)题库614
The richest person in the world must have known that it's garden. Because garden has too much money, he has invested a lot of money in the scientific research laboratory. But recently, the scientific research laboratory found some missing gene chains, and they can't immediately restore the gene chain. Therefore, garden plans to offer a heavy reward for the warrior who can restore these gene chains.
First, give a string containing only 'a', 'C', 'g','t ','? ', 5 characters, of which? The gene with missing code is known as Mammoth gene, that is, the number of ACGT nucleotides in the gene chain is equal. Now we need to restore the original gene chain. If there are multiple answers, the gene chain with the smallest dictionary order will be output.
###Input format:
The first line contains the integer n (4 ≤ n ≤ 255) - the length of the genome.
The second line contains the genome encoded by a string of length n. It consists of the characters' a ',' C ',' g ','t' and '?' form.
###Output format:
If you can decode the genome, output it. If there are multiple answers, output the gene chain with the smallest dictionary order. If not possible, output - 1
###Input example:
Here is a set of inputs. For example:
```in
eight
AG?C?? CT
four
AGCT
six
???? G?
```
###Output example:
The corresponding output is given here. For example:
```out
AGACGTCT
AGCT
-1
```







answer:If there is no answer, please comment