CSPST4 95pts 求助
查看原帖
CSPST4 95pts 求助
222057
joy2010WonderMaker楼主2023/10/24 21:47

捞

改了一下,还是 WA ON #19

bool checkp(long long st,int i,long long ed){
	if(c[i]*ed+b[i]>=1){
		if(c[i]>=1&&(ed+st)*(ed-st+1)/2>=a[i]/c[i]+1)
			return true;
		else
			return c[i]*((ed+st)*(ed-st+1)/2)+(ed-st+1)*b[i]>=a[i];
	}
	long long s=b[i]/(-c[i]);
	if(b[i]%(-c[i])==0)
		s--;
	return b[i]*(s-st+1)+c[i]*((s+st)*(s-st+1)/2)+ed-s>=a[i];
}

省略了除了 checkp 以外的

2023/10/24 21:47
加载中...