1. 문제1 11479번: 서로 다른 부분 문자열의 개수 2 (acmicpc.net) 11479번: 서로 다른 부분 문자열의 개수 2 첫째 줄에 문자열 S가 주어진다. S는 알파벳 소문자로만 이루어져 있고, 길이는 1,000,000 이하이다. www.acmicpc.net 2. 풀이 1) "모든 부분 문자열은 접미사들의 접두사이다" suffix array를 구한다면 suffix_array[i]는 사전순으로 오름차순 정렬된 i번째 접미사의 위치를 알 수 있다 그러면 문자열의 길이가 n이라면 i번째 접미사의 길이는 얼마일까? 당연히 n - suffix_array[i]이다. "ABAAB"에 대하여 suffix array를 생각해보자. index suffix array 2 AAB 3 AB 0 ABAAB 4 B 1..
1. 반복되는 부분 문자열 찾기 전체 문자열에서 적어도 두번 이상 나타나는 부분문자열 보통 "가장 긴 반복 부분 문자열"을 찾는 것에 관심 있다 예를 들어 "abcefgabc"에서 "abc"가 두번 나타나면서, 가장 긴 반복 부분 문자열이다. 찾는 방법은 생각보다 간단한데, https://en.wikipedia.org/wiki/Substring Substring - Wikipedia From Wikipedia, the free encyclopedia Not to be confused with subsequence, a generalization of substring. "string" is a substring of "substring" In formal language theory and compute..
1. 최적화 이전 문자열 자료구조 suffix array를 만드는 manber-myers 알고리즘은 O(Nlog2N)의 시간복잡도를 가진다. https://deepdata.tistory.com/967 문자열 핵심 자료구조 suffix array와 lcp(longest common prefix)배열 구하는법 배우기(Manber-Myers, kasai) https://cp-algorithms.com/string/suffix-array.html#definition Suffix Array - Algorithms for Competitive Programming Suffix Array Definition Let s be a string of length n. The i-th suffix of ..
https://cp-algorithms.com/string/suffix-array.html#definition Suffix Array - Algorithms for Competitive Programming Suffix Array Definition Let s be a string of length n. The i-th suffix of s is the substring s[i…n−1]. A suffix array will contain integers that represent the starting indexes of the all the suffixes of a given string, after the aforemen cp-algorithms.com https:/..
내 블로그 - 관리자 홈 전환 |
Q
Q
|
---|---|
새 글 쓰기 |
W
W
|
글 수정 (권한 있는 경우) |
E
E
|
---|---|
댓글 영역으로 이동 |
C
C
|
이 페이지의 URL 복사 |
S
S
|
---|---|
맨 위로 이동 |
T
T
|
티스토리 홈 이동 |
H
H
|
단축키 안내 |
Shift + /
⇧ + /
|
* 단축키는 한글/영문 대소문자로 이용 가능하며, 티스토리 기본 도메인에서만 동작합니다.