QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 256 MB Total points: 100

#3220. 辞書

Statistics

Snuke の辞書には、互いに異なる $n$ 個の単語 $s_1, \ldots, s_n$ が載っています。各単語は英小文字からなります。単語は辞書順に並んでおり、すなわち $s_1 < \cdots < s_n$ です。残念ながら、辞書の一部の文字が読めません。あなたはそれらの文字を「?」に置き換えました。それぞれの「?」を英小文字に置き換えて有効な辞書にする方法の数を、$1\,000\,000\,007$ で割った余りを求めてください。

入力

入力の最初の行には整数 $n$($1 \le n \le 50$)が与えられます。続く $n$ 行のうち、$i$ 行目には単語 $s_i$($1 \le |s_i| \le 20$、$s_i$ の各文字は英小文字または「?」)が与えられます。

出力

答えを出力してください。

入出力例

入力 1

2
?sum??mer
c??a??mp

出力 1

703286064

入力 2

3
snuje
????e
snule

出力 2

1

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.