# def sol(s):
# prefix=[[s[:i+1],i] for i in range(len(s))]
# prefix.sort(key= lambda x: x[0])
# for i in prefix:
# print(i[1])
#
s=input()
for i in range(len(s)):
print(i)
https://www.acmicpc.net/problem/13322
13322번: 접두사 배열
접미사 배열(suffix array)이란, 어떤 문자열의 모든 접미사를 사전 순으로 정렬한 뒤, 각 접미사의 시작 위치를 기록한 배열을 의미한다. 예를 들어 'banana' 라는 문자열에 대해 접미사 배열을 구한
www.acmicpc.net
주석 부분이 실제 접두사 배열 구현내역인데 생각해보니 필요없네요 ^^;
In comment , There is a code to implement Prefix Array, But I don't need that, just think
반응형
'python-algorithm' 카테고리의 다른 글
백준 25314 코딩은 체육과목 입니다 (0) | 2022.10.30 |
---|---|
백준 12606 Reverse Words (Large) (0) | 2022.10.30 |
백준 9455 박스 (0) | 2022.10.29 |
백준 2456 나는 학급회장이다 (0) | 2022.10.29 |
백준 4641 Doubles (0) | 2022.10.29 |
댓글