Logo
(追記) (追記ここまで)

18329번 - Nivelle 서브태스크스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB48292859.574%

문제

Original task description has been altered due to excessive violence. The following program is suitable for minors.

Bojan sees N cute little fluffy edible toys (yaay!) on a store shelf, ordered from 1 to N. Each fluffy toy is colored in one of 26 different colors. Each color is denoted by a lowercase letter from the English alphabet. Bojan wants to eat some of these toys (drool).

For any set of toys, we can define its colorfulness as the number of different colors of toys in a set, divided by the total number of toys in a set. Bojan hates colorfulness. Bojan is very hungry. Bojan wants to eat a contiguous subsequence of toys.

Help Bojan find a contiguous subsequence of toys whose colorfulness is as small as possible.

입력

The first line contains an integer N (1 ≤ N ≤ 100 000), the length of array of toys from task description.

The second line contains a string S of length N. The i-th character of the string represents the color of i-th toy from the shelf.

출력

Output two indices L and R (1 ≤ L ≤ R ≤ N), which denote that the sought contiguous subsequence of toys is located at positions L, L + 1, . . . , R.

If there exists more than one contiguous subsequence with the same minimal colorfulness, you can output L and R which define any of them.

제한

서브태스크

번호배점제한
17

N ≤ 100

217

N ≤ 2 000

313

S contains only letters 'a' and 'b'

425

S contains only letters 'a', 'b', 'c', 'd' and 'e'

548

No additional constraints.

예제 입력 1

4
honi

예제 출력 1

1 4

예제 입력 2

7
nivelle

예제 출력 2

4 7

예제 입력 3

6
ananas

예제 출력 3

1 5

힌트

출처

Contest > Croatian Open Competition in Informatics > COCI 2019/2020 > Contest #4 5번

채점 및 기타 정보

  • 예제는 채점하지 않는다.
(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /