v9做的网站被攻击链接吧跳转,怎样改变wordpress的封面,网站开发 专有名词,合肥市建设通网站Problem - 985E - Codeforces
题意#xff1a; 思路#xff1a;
首先肯定需要排个序#xff0c;然后分段DP
但是平常写的分段DP都是n^2的#xff0c;这里的可以发现单调性#xff0c;因此考虑双指针转移
这里两个指针都代表两个段的右端点
Code#xff1a;
#includ…Problem - 985E - Codeforces
题意 思路
首先肯定需要排个序然后分段DP
但是平常写的分段DP都是n^2的这里的可以发现单调性因此考虑双指针转移
这里两个指针都代表两个段的右端点
Code
#include bits/stdc.h//#define int long longusing namespace std;const int mxn5e510;int N,K,D;
int a[mxn],dp[mxn];void solve(){cinNKD;for(int i1;iN;i) cina[i];sort(a1,a1N);int j1;dp[0]1;for(int i0;iN;i){if(dp[i]){jmax(j,iK);while(jNa[j]-a[i1]D) dp[j]1,j;}}if(dp[N]1) coutYES\n;else coutNO\n;
}
signed main(){ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);int __1;//cin__;while(__--)solve();return 0;
}