广州网站制作长沙,成全视频免费观看在线看小说原著叫什么,犀牛云做网站怎么这么贵,天元建设集团电话【传送门#xff1a;BZOJ4590】 简要题意#xff1a; 有l秒时间#xff0c;AC了k道题#xff0c;给出每秒写的代码行数#xff08;行数0表示写#xff0c;0表示删除#xff0c;如果剩下的行数不够删#xff0c;则为0#xff09;#xff0c;假设行数n时能…【传送门BZOJ4590】 简要题意 有l秒时间AC了k道题给出每秒写的代码行数行数0表示写0表示删除如果剩下的行数不够删则为0假设行数n时能够提交AC一道题求出n的最小值和最大值 题解 两个二分找最大值最小值判断的时候只要mid就提交 然后对于不存在的情况只要没有记录过答案就表示不存在 参考代码 #includecstdio
#includecstring
#includecstdlib
#includealgorithm
#includecmath
using namespace std;
typedef long long LL;
LL a[110000];int n;
int check(LL x)
{LL d0;int s0;for(int i1;in;i){da[i];if(dx) s,d0;if(d0) d0;}return s;
}
int main()
{int k;scanf(%d%d,n,k);for(int i1;in;i) scanf(%lld,a[i]);LL l1,r1LL63-1;LL nn-1,mid,mm-1;while(lr){mid(lr)/2;int tcheck(mid);if(tk){if(tk) nnmid;rmid-1;}else lmid1;}l1,r1LL63-1;while(lr){mid(lr)/2;int tcheck(mid);if(tk){if(tk) mmmid;lmid1;}else rmid-1;}if(nn-1||mm-1) printf(-1\n);else printf(%lld %lld\n,nn,mm);return 0;
} 转载于:https://www.cnblogs.com/Never-mind/p/8624280.html