QOJ.ac

QOJ

Süre Sınırı: 2 s Bellek Sınırı: 256 MB Toplam puan: 100

#3220. 字典

İstatistikler

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.