#499
Unrated
Bovine Genetics
시간 제한
2s
메모리 제한
1024MB
제출
0
정답
0
맞힌 사람
0
정답 비율
0.0%

문제

After sequencing the genomes of his cows, Farmer John has moved onto genomic editing! As we know, a genome can be represented by a string consisting of As, Cs, Gs, and Ts. The maximum length of a genome under consideration by Farmer John is 10510^5.

Farmer John starts with a single genome and edits it by performing the following steps:

Split the genome between every two consecutive equal characters.Reverse each of the resulting substrings.Concatenate the reversed substrings together in the same order.

For example, if FJ started with the genome AGGCTTT then he would perform the following steps:

Split between the consecutive Gs and Ts to get AG | GCT | T | T.Reverse each substring to get GA | TCG | T | T.Concatenate the substrings together to get GATCGTT.

Unfortunately, after editing the genome, Farmer John's computer crashed and he lost the sequence of the genome he originally started with. Furthermore, some parts of the edited genome have been damaged, meaning that they have been replaced by question marks.

Given the sequence of the edited genome, help FJ determine the number of possibilities for the original genome, modulo 109+710^9+7.

입력

A non-empty string where each character is one of A, G, C, T, or ?.

출력

The number of possible original genomes modulo 109+710^9+7.

예제 입력 1

?

예제 출력 1

4

예제 입력 2

GAT?GTT

예제 출력 2

3

점수

In test cases 1-4, the genome has length at most 1010.In test cases 5-11, the genome has length at most 10210^2.In test cases 12-20, there are no additional constraints.

코드 제출

코드를 제출하려면 로그인이 필요합니다.

로그인
내 제출
제출 내역이 없습니다.
맞은 사람
아직 맞은 사람이 없습니다.
난이도 투표
Unrated0명 투표
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출
제출 내역이 없습니다.