A795.Bovine Genetics--Gold
省选/NOI-
USACO
通过率:0%
时间限制:1.00s
内存限制:128MB
题目描述
After sequencing the genomes of his cows, Farmer John has moved onto genomic editing! A genome is a string consisting of the letters A, C, G, and T.
Farmer John edits a genome by performing these steps:
- Split the genome between every pair of consecutive equal characters.
- Reverse each resulting substring.
- Concatenate the reversed substrings in their original order.
For example, starting with AGGCTTT:
- Split it into
AG | GCT | T | T. - Reverse each substring to get
GA | TCG | T | T. - Concatenate them to get
GATCGTT.
Farmer John's computer crashed after editing, and he lost the original genome. Some characters in the edited genome were also replaced by question marks.
Given the edited genome, count how many original genomes could have produced it. Output the answer modulo 109+7.
输入格式
A non-empty string. Each character is one of A, G, C, T, or ?.
输出格式
Output the number of possible original genomes modulo 109+7.
输入输出样例
输入#1
?
输出#1
4
说明/提示
A question mark can represent any of A, G, C, or T.
数据范围:
| 测试点 | 字符串长度 |
|---|---|
| 01–04 | $1<>e |
| 05–11 | $1<>e |
| 12–20 | $1<>e |
输入解题思路,AI测评打分。不知道怎么写?