import java.util.*;public class Main{ public static void main(String[] args) { int[] nums={1,-1,2,-3,4,-5,6,-7}; int len=nums.length; int[] maxNum=new int[len+1]; maxNum[1]=nums[0]; maxNum[0]=Integer.MIN_VALUE; int maxLength=1; for(int i=1;imaxNum[end]){ maxLength=end+1; maxNum[maxLength]=nums[i]; continue; } while(start<=end){ int mid=start+(end-start)/2; if(maxNum[mid]>nums[i]){ end=mid-1; }else if(maxNum[mid] maxNum[end] && nums[i]