码迷,mamicode.com
首页 > 其他好文 > 详细

ural 1269. Obscene Words Filter

时间:2015-11-26 22:59:07      阅读:251      评论:0      收藏:0      [点我收藏+]

标签:

1269. Obscene Words Filter

Time limit: 0.5 second
Memory limit: 8 MB
There is a problem to check messages of web-board visitors for the obscene words. Your elder colleagues commit this problem to you. You are to write a program, which check if there is at least one obscene word from the given list in the given text as a substring.

Input

The first line consists of integer n (1 ≤ n ≤ 10000) — an amount of words. The next n lines contain the list of words that we can’t allow to use in our well-educated society. A word may contain any symbol but the ones with codes 0, 10 and 13. The length of each word doesn’t exceed 10000 symbols. The total list of words doesn’t exceed 100 KB. Then there is an integer m — the number of lines of the text. A size of the text doesn’t exceed 900 KB.

Output

the number of line and the number of position separated with a space, where an obscene word occurs for the first time. If there are no obscene words, output “Passed”.

Sample

inputoutput
5
dear
sweetie
angel
dream
baby
8
Had I the heavens‘ embroidered cloths, 
Enwrought with golden and silver light, 
The blue and the dim and the dark cloths 
Of night and light and the half-light, 
I would spread the cloths under your feet: 
But I, being poor, have only my dreams; 
I have spread my dreams under your feet; 
Tread softly because you tread on my dreams.
6 33
Problem Author: Pavel Atnashev
Problem Source: Ural State University championship, October 25, 2003

ural 1269. Obscene Words Filter

标签:

原文地址:http://www.cnblogs.com/StupidBoy/p/4999059.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!