F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Two strings

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 3406    Accepted Submission(s): 1138


Problem Description
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 ¡°*¡±.
 

Input
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).
 

Output
For each test case, print ¡°yes¡± if the two strings are matched, otherwise print ¡°no¡±.
 

Sample Input
3 aa a* abb a.* abb aab
 

Sample Output
yes yes no
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-02 09:49:20, Gzip enabled