프로그램 명: coci_dvaput
제한시간: 1 초

[문제요약]하나의 문자열이 주어질 때 두 번이상 나오는 가장 긴 스트링의 크기를 구하는 문제.

sabcabcfabc , sabcabcfabc , sabcabcfabc

trutrutiktiktappop , trutrutiktiktappop 

Ivana won the bet (Zvonko hadn't foreseen this and suspects that it is due to outside interference) and now Zvonko is waiting for her at the movies. While he is waiting, he is observing messages on a screen above him.

As Ivana is running late, Zvonko has been looking at the screen for a while and noticed that some messages appeared on the screen more than once. Naturally, he's been writing down all messages on a piece of paper. He wants to know the length of the longest string that appeared at least twice (appears in two different positions on the paper).

입력

출력

Output the length of the longest string that appears twice on a single line. If there is no such string, output zero.

입출력 예

input 

11 
sabcabcfabc 

output 

3 

input 

18 
trutrutiktiktappop 

output 

4

input 

6 
abcdef 

output 

0
출처:coci/2006-2007/contest5 6

[질/답] [제출 현황] [푼 후(0)]
[ 채 점 ] [홈으로]  [뒤 로]