@@ -0,0 +1,1541 @@
+package me.dslztx.assist.algorithm.dp.lis;%0A%0Apublic class LIS %7B%0A%0A    int%5B%5D sequence;%0A%0A    int%5B%5D tail;%0A%0A    public LIS(int%5B%5D sequence) %7B%0A        this.sequence = sequence;%0A    %7D%0A%0A    public int lengthOfLIS() %7B%0A        int%5B%5D dp = new int%5Bsequence.length + 1%5D;%0A%0A        dp%5B1%5D = sequence%5B0%5D;%0A%0A        int len = 1;%0A%0A        for (int pos = 1; pos %3C sequence.length; pos++) %7B%0A            if (dp%5Blen%5D %3C sequence%5Bpos%5D) %7B%0A                dp%5B++len%5D = sequence%5Bpos%5D;%0A            %7D else %7B%0A                int left = 1, right = len, mid;%0A                while (left %3C= right) %7B%0A                    mid = (left + right) %3E%3E 1;%0A%0A                    if (dp%5Bmid%5D %3C sequence%5Bpos%5D) %7B%0A                        left = mid + 1;%0A                    %7D else %7B%0A                        right = mid - 1;%0A                    %7D%0A                %7D%0A%0A                dp%5Bleft%5D = sequence%5Bpos%5D;%0A            %7D%0A        %7D%0A%0A        return len;%0A    %7D%0A%0A//    public int solutionsOfLIS() %7B%0A//        if (tail == null) %7B%0A//            int len = lengthOfLIS();%0A//        %7D%0A//%0A//        int%5B%5D number = new int%5Bsequence.length%5D;%0A//%0A//        for (int i = 0; i %3C sequence.length; i++) %7B%0A//            int num = 0;%0A//            for (int j = 0; j %3C i; j++) %7B%0A//                if (sequence%5Bj%5D %3C sequence%5Bi%5D) %7B%0A//                    if (tail%5Bj%5D + 1 == tail%5Bi%5D) %7B%0A//                        num += number%5Bj%5D;%0A//                    %7D%0A//                %7D%0A//            %7D%0A//            if (num == 0) %7B%0A//                num = 1;%0A//            %7D%0A//%0A//            number%5Bi%5D = num;%0A//        %7D%0A//    %7D%0A%7D%0A

update LIS