当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

2493:Rdeaalbe

题目描述
Background
As you probably know, the human information processor is a wonderful text recognizer that can handle even sentences that are garbled like the following:
The ACM Itrenntaoial Clloegaite Porgarmmnig Cnotset (IPCC)
porvdies clolgee stuetnds wtih ooppriuntetiis to itnrecat
wtih sutednts form ohetr uinevsrtieis.

Problem
People have claimed that understanding these sentences works in general when using the following rule: The first and last letters of each word remain unmodified and all the characters in the middle can be reordered freely.
Since you are a skeptical ACM programmer, you immediately set on to write the following program:
Given a sentence and a dictionary of words, how many different sentences can you find that could potentially be mapped to the same encoding?
输入解释
The first line contains the number of scenarios. Each scenario begins with a line containing the number n of words in the dictionary (0 <= n <= 10000), which are printed on the following n lines. After this there is a line containing the numbermof sentences that should be tested with the preceding dictionary (0 <= m <= 10000) and then m lines containing those sentences. The sentences consist of letters from a..z, A..Z and spaces only and have a maximal length of 10000 characters. For each word in the dictionary a limitation of 100 characters can be assumed.
输出解释
The output for every scenario begins with a line containing "Scenario #i:", where i is the number of the scenario starting at 1. For each sentence output the number of sentences that can be formed on an individual line. It is guaranteed that this number can be expressed using a signed 32-bit datatype. Terminate the output for the scenario with a blank line.
输入样例
2
3
ababa
aabba
abcaa
2
ababa
abbaa
14
bakers
brakes
breaks
binary
brainy
baggers
beggars
and
in
the
blowed
bowled
barn
bran
1
brainy bakers and beggars bowled in the barn
输出样例
Scenario #1:
2
2

Scenario #2:
48

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-2493

最后修改于 2020-10-29T06:33:58+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 65536