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

建议使用的浏览器:

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

1816:Wild Words

题目描述
A word is a string of lowercases. A word pattern is a string of lowercases, '?'s and '*'s. In a pattern, a '?' matches any single lowercase, and a '*' matches none or more lowercases.

There are many word patterns and some words in your hand. For each word, your task is to tell which patterns match it.
输入解释
The first line of input contains two integers N (0 < N <= 100000) and M (0 < M <=100), representing the number of word patterns and the number of words. Each of the following N lines contains a word pattern, assuming all the patterns are numbered from 0 to N-1. After those, each of the last M lines contains a word.

You can assume that the length of patterns will not exceed 6, and the length of words will not exceed 20.
输出解释
For each word, print a line contains the numbers of matched patterns by increasing order. Each number is followed by a single blank. If there is no pattern that can match the word, print "Not match".
输入样例
5 4
t*
?h*s
??e*
*s
?*e
this
the
an
is
输出样例
0 1 3 
0 2 4 
Not match
3

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

题目来源 POJ Monthly

源链接: POJ-1816

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

共提交 0

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