| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 4 초 | 512 MB | 53 | 21 | 15 | 40.541% |
Snuke’s dictionary contains n distinct words s1, . . . , sn. Each word consists of English lowercase letters. The words are sorted lexicographically, i.e., s1 < · · · < sn. Unfortunately, you can’t read some characters in his dictionary. You replaced those characters with ’?’. Compute the number of ways to replace each ’?’ with an English lowercase letter and make a valid dictionary, modulo 1,000,000,007.
First line of the input contains one integer n (1 ≤ n ≤ 50). Then n lines follow, i’th of then contains word si (1 ≤ |si| ≤ 20, each character in si is an English lowercase letter or a ‘?’).
Print the answer.
2 ?sum??mer c??a??mp
703286064
3 snuje ????e snule
1