HBC17141Substring题解

arkfactor 算法基础篇 48 0
想要成为编程高手?那就来试试全网最全C++题库,让您在练习中快速成长。
Two strings u1 u2 ... uk and v1 v2 ... vl are isomorphic if and only if k = l and there exists a injection g such that ui = g for all i ∈ {1, 2, ..., k}. Note that a function f is injection if and only if f ≠ f for all x ≠ y. Bobo would like to choose some strings from all n/2 substrings of the given string s1 s2 ... sn. Find out the maximum number of strings he may choose so that no two chosen strings are isomorphic.

Two strings u1 u2 ... uk and v1 v2 ... vl are isomorphic if and only if k = l and there exists a injection g such that ui = g(vi) for all i ∈ {1, 2, ..., k}. Note that a function f is injection if and only if f(x) ≠ f(y) for all x ≠ y. Bobo would like to choose some strings from all n(n +1)/2 substrings of the given string s1 s2 ... sn. Find out the maximum number of strings he may choose so that no two chosen strings are isomorphic.

HBC17141Substring题解
-第1张图片-东莞河马信息技术
(图片来源网络,侵删)
不断学习,不断挑战,才能在编程领域中脱颖而出!全网最全C++题库,助您成为编程高手!

标签: HBC17141Substring题解