Musical Theme Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 25348 Accepted: 8546 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…
Musical Theme Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 16757 Accepted: 5739 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…
#include<bits/stdc++.h> #define LL long long #define fi first #define se second #define mk make_pair #define pii pair<int, int> #define y1 skldjfskldjg #define y2 skldfjsklejg using namespace std; ; ; const int inf = 0x3f3f3f3f; const LL INF =…
poj1743 题意 给出一个数字序列(串),现在要去寻找一个满足下列条件的子串: 长度不小于 5 存在重复的子串(如果把一个子串的所有数字都加上或减去一个值,与另一子串的数字对应相同,我们称它们重复) 重复的子串之间不能重叠 分析 把相邻的数字作差(后面的减前面的)得到一个新的数列. 那么我们去二分答案 m ,判断串上是否存在两个不重叠但是完全相同的长度为 m 的子串. 判断不重叠:在分组时,记录最大最小 sa 值,如果最大减最小的值大于 m ,说明不重叠(这样其实是要至少隔一个位置,注意最后…
题目链接:https://vjudge.net/problem/POJ-1743 Musical Theme Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 32402 Accepted: 10808 Description A musical melody is represented as a sequence of N (1<=N<=20000)notes that are integers in the ra…