时间超限的问题
为什么这个程序在有些网站运行出来说时间超限???#include <stdio.h>
#include <stdlib.h>
long long unsigned bn[100000000];
int findBKNum(int start,int end,long long unsigned bkNum)
{
int mid;
while(start<=end){
mid=(start+end)/2;
if(bkNum==bn[mid])
return mid;
if(bkNum>bn[mid])
start=mid+1;
else
end=mid-1;
}
return -1;
}
int main()
{
int n,i,k;
long long unsigned bkNum;
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%llu",&bn[i]);
scanf("%d",&k);
while(k--){
scanf("%llu",&bkNum);
printf("%d\n",findBKNum(0,n-1,bkNum));
}
return 0;
}