int n,L;
int a[N];
bool check(int mid,int x){
int ans = (L/2)*(mid-1)*(L-(L/2));
return ans >= x;
}
void solve(){
cin>>n>>L;For(i,1,n) cin>>a[i];
For(i,1,n){
int l=1,r=2e5+5,mid;
while(l+5<r){
mid=(l+r)>>1;
if(check(mid,a[i]))r=mid;
else l=mid;
}int out=0;
For(j,l,r) if(check(j,a[i])){
out=j-1;break;
}
cout<<out<<endl;
}
}
蒟蒻写了二分不会判断-1,请问这个写法对吗?-1 咋判