{"trustable":true,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n div.illustration {\n float: right;\n padding-left: 20px;\n }\n div.illustration .illustration {\n width: 100%;\n border-radius: 4px;\n }\n pre {\n display: block;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n color: #333;\n word-break: break-all;\n word-wrap: break-word;\n }\n\u003c/style\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\[\u0027, right: \u0027\\\\]\u0027, display: true}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\n \u003cdiv style\u003d\"width:35.00%\" class\u003d\"illustration\"\u003e\n \u003cimg src\u003d\"CDN_BASE_URL/06a0e644eee919b4a737cd58a21a9721?v\u003d1715835554\" alt\u003d\"/problems/keywords/file/statement/en/img-0001.jpg\" class\u003d\"illustration\"\u003e\n \n \u003c/div\u003e\n \u003cp\u003eCatherine is a brilliant software engineer, but she has been\n having difficulty landing a job, despite having submitted a\n superb resume to dozens of tech companies. After doing some\n research, she discovered that most tech companies in her area\n use an algorithm to prescreen resumes by scanning for certain\n keywords before the resume is even seen by a human. Any resume\n that does not contain sufficiently many technology-related\n keywords is automatically rejected!\u003c/p\u003e\n \u003cp\u003eCatherine has devised a plan to outwit the prescreening\n algorithm: she intends to cram as many keywords as possible\n into her resume to maximize her chances of passing the\n prescreening process. As a first step, she has downloaded a\n list of the most common tech buzzwords from an online data bank\n that includes entries such as “machine learning”, “Big data”,\n “AI”, “C++”, “Neural-network”, “unix”, “cryptography”, etc.\n (Note that \u003cem\u003ekeyword\u003c/em\u003e sometimes really means\n \u003cem\u003ekeyphrase\u003c/em\u003e.)\u003c/p\u003e\n \u003cp\u003eIn the early stages of drafting her new resume, Catherine\n notices that many keywords from the data bank are very similar\n to each other (e.g., “Machine-learning” vs. “machine learning”,\n or “MySQL” vs. “MySql”). Since she suspects that including\n nearly identical keywords won’t help her fool the prescreening\n algorithm, she wants to filter out such similar keywords in\n order to save room on her resume. Catherine considers two\n keywords \u003cspan class\u003d\"tex2jax_process\"\u003e$k_1$\u003c/span\u003e and\n \u003cspan class\u003d\"tex2jax_process\"\u003e$k_2$\u003c/span\u003e to be similar if,\n after replacing hyphens with spaces and ignoring\n capitalization, \u003cspan class\u003d\"tex2jax_process\"\u003e$k_1$\u003c/span\u003e is\n the same as \u003cspan class\u003d\"tex2jax_process\"\u003e$k_2$\u003c/span\u003e.\u003c/p\u003e\n \u003cp\u003eCan you help Catherine craft the perfect resume to land her\n a job?\u003c/p\u003e\n \u003ch2\u003eInput\u003c/h2\u003e\n \u003cp\u003eThe first line contains an integer, \u003cspan class\u003d\"tex2jax_process\"\u003e$n$\u003c/span\u003e \u003cspan class\u003d\"tex2jax_process\"\u003e$(1\n \\leq n \\leq 40\\, 000)$\u003c/span\u003e, the number of keywords in the\n data bank. This is followed by \u003cspan class\u003d\"tex2jax_process\"\u003e$n$\u003c/span\u003e lines, each of which contains a\n keyword string \u003cspan class\u003d\"tex2jax_process\"\u003e$k$\u003c/span\u003e that is\n between \u003cspan class\u003d\"tex2jax_process\"\u003e$1$\u003c/span\u003e and\n \u003cspan class\u003d\"tex2jax_process\"\u003e$25$\u003c/span\u003e characters in length\n (inclusive). All characters in a keyword are guaranteed to fall\n in the \u003cspan class\u003d\"tex2jax_process\"\u003e$[32, 126]$\u003c/span\u003e ASCII\n range, and no keyword begins or ends with a space or a\n hyphen.\u003c/p\u003e\n \u003ch2\u003eOutput\u003c/h2\u003e\n \u003cp\u003eOutput a single line containing the number of (pairwise)\n non-similar keywords in the data bank.\u003c/p\u003e\n \u003ch2\u003eSample 1\u003c/h2\u003e\u003cbody\u003e\u003ctable class\u003d\"vjudge_sample\"\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\u003e4\nc++\nC++\nc\nc#\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e3\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/body\u003e\n \u003ch2\u003eSample 2\u003c/h2\u003e\u003cbody\u003e\u003ctable class\u003d\"vjudge_sample\"\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\u003e5\ncryptography\nblockchain\nArtificial intelligence\nMachine-Learning\nLinux\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e5\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/body\u003e\n \u003ch2\u003eSample 3\u003c/h2\u003e\u003cbody\u003e\u003ctable class\u003d\"vjudge_sample\"\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\u003e2\nMySQL\nMySql\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/body\u003e\n "}}]}