int mid = (max-min)>>1+min;
if (mid>=0&&min<=max&&mid<=max){
if (search[mid]==target){
return mid;
}
if (search[mid]>target){
return towPointSerch2(search,target,min,mid-1);
}else {
return towPointSerch2(search,target,mid+1,max);
}
}
return -1;
2循環(huán)比賽
if (n==1){
arr[n-1][n-1]=1;
}else {
int m = n>>1;
CircleCom(arr,m);
//右上角的方格數(shù)據(jù)
for (int i = 0;i<m;i++){
for (int j = m;j<n;j++){
arr[i][j] = arr[i][j-m]+m;
}
}
//左下角
for (int i = m;i<n;i++){
for (int j = 0;j<m;j++){
arr[i][j] = arr[i-m][j+m];
}
}
//右下角的方格數(shù)據(jù)
for (int i = m;i<n;i++){
for (int j = m;j<n;j++){
arr[i][j] = arr[i-m][j-m];
}
}
}
int[] road = new int[account+1];
for (int i = 1;i<road.length;i++){
road[i] = 1000;
}
for (int i = 1;i<road.length;i++){
for (int j = 0;j<coins.length;j++){
if (coins[j]<=i){
road[i] = Math.min(road[i],road[i-coins[j]]+1);
}
}
}
return road[account]==1000?-1:road[account];