首页 > TAG信息列表 > POJ1743

POJ1743 Musical Theme(后缀数组 二分)

Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 33462   Accepted: 11124 Description A musical melody is represented as a sequence of N (1<=N<=20000)notes that are integers in the range 1..88, each representing a key on the piano. It

POJ1743 Musical Theme(后缀数组求不可重叠最长重复子串)

描述 传送门:我是传送门 A musical melody is represented as a sequence of N (1<=N<=20000)notes that are integers in the range 1..88, each representing a key on the piano. It is unfortunate but true that this representation of melodies ignores the notion of mus

POJ1743 Musical Theme

有N(1<=N<=20000)个音符的序列来表示一首乐曲,每个音符都是1..88范围内的整数,现在要找一个重复的子串,它需要满足如下条件:1.长度至少为5个音符。 2.在乐曲中重复出现(就是出现过至少两次)。(可能经过转调,“转调”的意思是主题序列中每个音符都被加上或减去了同一个整数值) 3.重复出现

POJ1743(不可重叠最长重复子串 SA+二分)

题目 题意: 给你n个数字代表此时的钢琴按键。问最长的重复的节拍。 就转化为n-1个值得不可重叠最长重复子串。题目要求节拍对应的串>=5 意思就是这个最长重复节拍应>=4。 思路: 二分答案这个子串最长为mid(下面用k),先然满足二分单调性。 将n个后缀按字典序排列后,然后将公共前

poj1743 Musical Theme 后缀数组

                DescriptionA musical melody is represented as a sequence of N (1<=N<=20000)notes that are integers in the range 1..88, each representing a key on the piano. It is unfortunate but true that this representation of melodies ign

题解:POJ1743 Musical Theme 【后缀数组】

传送门 这个题目的题意就是差分一下,求差分数组的不可重叠的最长重复子串 这个题目的暴力很简单,就不多扯了(考试打了四个暴力的蒟蒻捂脸走开) 于是我们考虑二分这个子串的长度,然后运用后缀数组进行判断 #include <algorithm> #include <iostream> #include <cstdio> using namespa

POJ1743 Musical Theme

POJ1743 Musical Theme 题目描述 传送门 题目分析 分析出题目是让我们求两个最长的重复的不相交的子串。 考虑到两个后缀有相同的前缀就会有那么长的重复的子串,使用后缀数组。 变调什么的差分一下还是一样做。 二分答案,同时记录后缀出现位置,题目保证不相交。注意最后二分出的答案