QOJ.ac

QOJ

Límite de tiempo: 1.0 s Límite de memoria: 32 MB Puntuación total: 50

#16428. VJEKO

Estadísticas

在闲暇时间,Vjeko 喜欢浏览目录中的文件。不幸的是,他的电脑控制台似乎坏了,现在无法正确打印出与特定模式匹配的文件名。

模式是一个由英文小写字母和恰好一个星号(*)组成的字符串。 如果可以通过将星号替换为任意英文小写字母组成的字符串(也可以是空字符串),使得模式字符串与文件名相同,则称该文件名与该模式匹配。例如,字符串 abcdadanestonestod 都与模式 a*d 匹配,而字符串 bcd 则不匹配。

编写一个程序,在给定模式和文件名的情况下,输出每个文件名是否与该模式匹配。

输入格式

第一行包含一个整数 $N$ ($1 \le N \le 100$),表示文件数量。

第二行包含一个字符串,仅由英文小写字母和恰好一个星号(ASCII 值为 42)组成。该字符串的长度不超过 100,且星号不会位于字符串的开头或结尾。

接下来的 $N$ 行,每行包含一个文件名。文件名仅由英文小写字母组成,且长度不超过 100。

输出格式

输出 $N$ 行。如果第 $i$ 个文件名与模式匹配,则第 $i$ 行应输出 DA(克罗地亚语中的“是”);如果第 $i$ 个文件名与模式不匹配,则输出 NE(克罗地亚语中的“否”)。

样例

输入样例 1

3
a*d
abcd
anestonestod
facebook

输出样例 1

DA
DA
NE

输入样例 2

6
h*n
huhovdjestvarnomozedocisvastan
honijezakon
atila
je
bio
hun

输出样例 2

DA
DA
NE
NE
NE
DA

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.