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

建议使用的浏览器:

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

1437:Chat Rooms

题目描述
Suppose there are a number of good users using an Internet chat room, which is a shared text chat space. Now there are some bad guys in the Internet who would come to this room and would have no respect or interest in the topic of discussion in the group. They would start typing strings of garbage characters, start unsolicited advertisements of certain URLs or businesses, or paste same string again and again just to disturb others in the room.

When I asked about this problem to Prof Banku (naturally not as smart as Prof Shanku) he suggested the following scheme. Let us define consonants to be all letters in a-z and A-Z except a, e, i, o, u, y, A, E, I, O, U and Y.

A user should be able to send a line to the chat room unless

- the line has more than 5 consecutive consonants, or

- the line contains at least one word which has more than 4 consecutive consonants and the user sent more than 2 such lines in last 10 lines sent, or

- the user sent the same line more than once in last 10 sentences sent.
输入解释
Input consists of several lines. The first line contains an integer n, which is the number of lines in the shared text space. Then follow n lines each consisting of not more than 255 ASCII characters.
输出解释
For each line of input print y if the line is acceptable according to the criteria set above and n otherwise in separate lines. See the sample output for example.
输入样例
12
hello
how r u?
where r u from?
kjhh kh kgkjhg jhg
where r u from?
i am from London, Ontario, Canada
how r you nxw?
now
where r u from?
kjhh kh kgkjhg jhg
very good
it is very cold here.
输出样例
y
y
y
n
y
y
y
y
n
n
y
y

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

题目来源 Dhaka 2002

源链接: POJ-1437

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

共提交 0

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