MCPcopy Create free account
hub / github.com/SuprDewd/CompetitiveProgramming / lis_dp

Function lis_dp

code/other/lis.test.cpp:4–14  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2
3map<int,int> mem;
4int lis_dp(const vi &arr, int last) {
5 if (mem.find(last) != mem.end())
6 return mem[last];
7 int res = 1;
8 rep(i,0,last) {
9 if (arr[i] < arr[last]) {
10 res = max(res, 1 + lis_dp(arr, i));
11 }
12 }
13 return mem[last] = res;
14}
15
16void check(int n) {
17 vi arr(n);

Callers 1

checkFunction · 0.85

Calls 1

findMethod · 0.45

Tested by

no test coverage detected