Responsive image

问题 J: Two strings

问题 J: Two strings

时间限制: 2 Sec  内存限制: 128 MB
提交: 3  解决: 3
[提交][状态][讨论版][命题人:]

题目描述

Giving two strings and you should judge if they are matched.
The first string contains lowercase letters and uppercase letters.
The second string contains lowercase letters, uppercase letters, and special symbols: “.” and “*”.
. can match any letter, and * means the front character can appear any times. For example, “a.b” can match “acb” or “abb”, “a*” can match “a”, “aa” and even empty string. ( “*” will not appear in the front of the string, and there will not be two consecutive “*”.
 

输入描述

The first line contains an integer T implying the number of test cases. (T≤15)
For each test case, there are two lines implying the two strings (The length of the two strings is less than 2500).
 

输出描述

For each test case, print “yes” if the two strings are matched, otherwise print “no”.
 

样例输入

3
aa
a*
abb
a.*
abb
aab

样例输出

yes
yes
no
[提交][状态]
ACM算法攻关部