long long firstBadVersion(int n) {
long long l=1;
long long r=n;
long long mid=1;
//执行完之后l=r 即为答案
while(l<r){
mid=(l+r)/2;
mid = left + (right - left) / 2; // 防止计算时溢出
if(isBadVersion(mid)){
r=mid;
}else{
l=mid+1;
}
}
return r;
}