{"problem":{"name":"[ICPC 2022 Xi'an R] Perfect Word","description":{"content":"You are given $n$ strings and required to find the length of the longest *perfect word*. A string $t$ is called a *perfect word*, if and only if every non-empty substring of $t$ appears in the given ","description_type":"Markdown"},"platform":"Luogu","limit":{"time_limit":1000,"memory_limit":524288},"difficulty":{"LuoguStyle":"P4"},"is_remote":true,"is_sync":true,"sync_url":null,"sign":"LGP9364"},"statements":[{"statement_type":"Markdown","content":"You are given $n$ strings and required to find the length of the longest *perfect word*.\n\nA string $t$ is called a *perfect word*, if and only if every non-empty substring of $t$ appears in the given strings.\n\nA string $s$ is called a substring of $t$ if and only if it can be obtained by removing several (possibly zero) characters from the beginning or end of $t$.\n\n## Input\n\nThe first line contains a single integer $n$ ($1 \\leq n \\leq 10 ^ 5$).\n\nEach of the next $n$ lines contains a string consisting of lowercase English letters.\n\nIt is guaranteed that the total length of the given strings is no more than $10 ^ 5$.\n\n## Output\n\nOutput an integer, representing the length of the longest perfect word.\n\n[samples]\n\n## Note\n\n**Source**: The 2022 ICPC Asia Xi'an Regional Contest Problem G.\n\n**Author**: MonkeyKing.","is_translate":false,"language":"English"}],"meta":{"iden":"LGP9364","tags":["2022","O2优化","ICPC","西安"],"sample_group":[["4\na\nt\nb\nab\n","2\n"]],"created_at":"2026-03-03 11:09:25"}}