SalesforceOA #36
Replace '?' to Avoid Adjacent Duplicates
估计中等可在线判题
The string consists of lowercase letters and question marks; each question mark may be replaced with any lowercase letter, and fixed letters cannot be changed. Find the number of replacements after which no two adjacent characters are equal, modulo 1000000007.
输入格式
One line containing s. Full original bounds: 1≤|s|≤100000, and the characters are only a..z or ?.
输出格式
Output one integer answer.
样例 1
输入:
??
输出:
650
样例 2
输入:
a?a
输出:
25
样例 3
输入:
aa
输出:
0
样例说明
The outputs of the three public examples are, in order: 650; 25; 0. They have been checked by independent enumeration or direct simulation.