1. 程式人生 > >2015ACM/ICPC亞洲區瀋陽站 HDU

2015ACM/ICPC亞洲區瀋陽站 HDU

Ladies and gentlemen, please sit up straight.
Don't tilt your head. I'm serious.

For n given strings S1,S2,,Sn, labelled from 1 to n, you should find the largest i(1in) such that there exists an integer j(1j<i) and Sj is not a substring of Si.

A substring of a string Si is another string that occurs in Si. For example, ``ruiz" is a substring of ``ruizhang", and ``rzhang" is not a substring of ``ruizhang".