DP,increasing sequence, binary sezrch