codeforces 487 B. Strip
题意:一个数列分成若干段,满足两个条件,1.每一段长度l>=s,2.每一段mx-mi分析:一个很常见的思路,先预处理每个数最左边可行位置pre[i],动态方程,dp[i]=min(dp[k]+1),pre[i]-1#include#include#include#include#include#include#include#include#include#include#