二分答案.. 一开始二分的初始右边界太小了然后WA,最后一气之下把它改成了INF... ------------------------------------------------------------------------ #include<cstdio> #include<cstring> #include<algorithm> #include<iostream> #define rep( i , n ) for( int i = 0 ;…
#include<iostream> #include<cstdio> #include<algorithm> using namespace std; const int N=1000005; int n,a[N],b[N]; long long m,f[N],s[N]; int ok(int w) { long long ans=0; for(int i=1;i<=n;i++) b[i]=a[i]; for(int i=2;i<=n;i++) if(b[…