{"trustable":true,"prependHtml":"\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003e谷歌、百度等搜索引擎已经成为了互连网中不可或缺的一部分。在本题中,你的任务也是设计一个搜索论文的搜索引擎,当然,本题的要求比起实际的需求要少了许多。\u003cbr\u003e本题的输入将首先给出一系列的论文,对于每篇论文首先给出标题,然后给出它被引用的次数。然后会有一系列的搜索询问,询问标题中包含特定关键词的论文有哪些。\u003cbr\u003e每一个询问可能包含多个关键词,你需要找出标题包含所有关键词的论文。\u003cbr\u003e“包含”必须是标题中有一个词正好是给定的关键词,不区分大小写。\u003cbr\u003e对每个询问,都按被引用的次数从多到少输出满足条件的论文的标题。如果有被引用的次数相同的论文,则按照论文在输入中的顺序排列,先给出的论文排在前面。\u003cbr\u003e\u003cimg style\u003d\"max-width:100%;\" src\u003d\"CDN_BASE_URL/b1fac56707aff1386b32a9ec5045c5fd?v\u003d1713677317\"\u003e\u003cbr\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"输入包含多组数据。\u003cbr\u003e每组数据首先有一行包含一个整数N(1\u0026lt;\u003dN\u0026lt;\u003d1000),表示论文的数目,N\u003d0表示输入结束。每组论文的信息第一行是论文的标题,由字母(大小写均可)和空格组成,不超过10个词,每个词不超过20个字符,标题总共不超过250个字符。第二行是一个整数K(0\u0026lt;\u003dK\u0026lt;\u003d108),表示它被引用的次数。在论文信息结束以后,有一行包含一个整数M(1\u0026lt;\u003dM\u0026lt;\u003d100),表示询问的数目。接下来有M行,每行是一个询问,由L(1\u0026lt;\u003dL\u0026lt;\u003d10)个空格分开的词构成,每个词不超过20个字符。\u003cbr\u003e\u003cbr\u003e"}},{"title":"Output","value":{"format":"HTML","content":"对每个询问,按照题目给定的顺序输出满足条件的论文的标题;如果没有满足条件的论文,就不输出。在每组询问的输出之后输出一行”***”,在每组数据的输出之后输出一行”---”。"}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e6\r\nFinding the Shortest Path\r\n120\r\nFinding the k Shortest Path\r\n80\r\nFind Augmenting Path in General Graph\r\n80\r\nMatching in Bipartite Graph\r\n200\r\nFinding kth Shortest Path\r\n50\r\nGraph Theory and its Applications\r\n40\r\n6\r\nshortest path\r\nk shortest path\r\ngraph\r\npath\r\nfind\r\napplication\r\n0\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eFinding the Shortest Path\r\nFinding the k Shortest Path\r\nFinding kth Shortest Path\r\n***\r\nFinding the k Shortest Path\r\n***\r\nMatching in Bipartite Graph\r\nFind Augmenting Path in General Graph\r\nGraph Theory and its Applications\r\n***\r\nFinding the Shortest Path\r\nFinding the k Shortest Path \r\nFind Augmenting Path in General Graph\r\nFinding kth Shortest Path\r\n***\r\nFind Augmenting Path in General Graph\r\n***\r\n***\r\n---\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}