#865
Platinum III
DVAPUT
시간 제한
1s
메모리 제한
32MB
제출
6
정답
1
맞힌 사람
1
정답 비율
16.7%

문제

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).

입력

The first line of input contains an integer LL (1L2000001 \le L \le 200\,000), the length of the string Zvonko wrote down.

The second line contains a string of LL lowercase letters of the English alphabet.

출력

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

예제 입력 1

11
sabcabcfabc

예제 출력 1

3

예제 입력 2

18
trutrutiktiktappop

예제 출력 2

4

예제 입력 3

6
abcdef

예제 출력 3

0
코드 제출

코드를 제출하려면 로그인이 필요합니다.

로그인
내 제출
제출 내역이 없습니다.
맞은 사람
#순위사용자언어시간메모리코드 길이
5665🥇
안우진
Python566ms54752KB622B
난이도 투표
Platinum III1명 투표· 약 1개월 전
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출
#사용자문제결과언어시간메모리코드 길이제출 시간
5665
맞았습니다
Python566ms54752KB622B2026. 04. 28. 21:40
5664
틀렸습니다
Python--609B2026. 04. 28. 21:39
5663
틀렸습니다
Python--613B2026. 04. 28. 21:38
5662
런타임 에러
Python--712B2026. 04. 28. 21:36
5661
틀렸습니다
Python--736B2026. 04. 28. 21:35
5660
틀렸습니다
Python--564B2026. 04. 28. 21:29