在Web中搜索 Searching the Web

题意翻译

输入$n$篇文章和$m$个请求($n < 100\text{,}m \leq 50000$),每个请求都是$4$种格式之一。 - $A:$ 找包含关键字$A$的文章。 - $A\ AND\ B:$ 找同时包含关键字$A$和$B$的文章。 - $A\ OR\ B:$ 找包含关键字$A$或$B$的文章。 - $NOT\ A:$ 找不包含关键字$A$的文章。 处理询问时需要对每篇文章输出证据。前$3$种询问输出所有至少包含一个关键字的行。第$4$种询问输出不包含$A$的整篇文章。关键字只由小写字母组成,查找时忽略大小写。每行$\text{不超过}80$字符,一共不超过$1500$行。

题目描述

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=448&page=show_problem&problem=4472 [PDF](https://uva.onlinejudge.org/external/15/p1597.pdf)

输入输出格式

输入格式


输出格式


输入输出样例

输入样例 #1

4
A manufacturer, importer, or seller of
digital media devices may not (1) sell,
or offer for sale, in interstate commerce,
or (2) cause to be transported in, or in a
manner affecting, interstate commerce,
a digital media device unless the device
includes and utilizes standard security
technologies that adhere to the security
system standards.
**********
Of course, Lisa did not necessarily
intend to read his books. She might
want the computer only to write her
midterm. But Dan knew she came from
a middle-class family and could hardly
afford the tuition, let alone her reading
fees. Books might be the only way she
could graduate
**********
Research in analysis (i.e., the evaluation
of the strengths and weaknesses of
computer system) is essential to the
development of effective security, both
for works protected by copyright law
and for information in general. Such
research can progress only through the
open publication and exchange of
complete scientific results
**********
I am very very very happy!
What about you?
**********
6
computer
books AND computer
books OR protected
NOT security
very
slick

输出样例 #1

want the computer only to write her
---------
computer system) is essential to the
==========
intend to read his books. She might
want the computer only to write her
fees. Books might be the only way she
==========
intend to read his books. She might
fees. Books might be the only way she
---------
for works protected by copyright law
==========
Of course, Lisa did not necessarily
intend to read his books. She might
want thea computer only to write her
midterm. But Dan knew she came from
a middle-class family and could hardly
afford the tuition, let alone her reading
fees. Books might be the only way she
could graduate
---------
I am very very very happy!
What about you?
==========
I am very very very happy!
==========
Sorry, I found nothing.
==========