#include #include #include #include using namespace std; vectorarr; int dp[25]; mapmp; int lis(int pos) { if(dp[pos]!=0) return dp[pos]; dp[pos]=1; int i=0,v=0; for(i=0;i>n; for(i=0;i>x; mp[x]=i;//mapping the position of the elements } while(cin>>x) { arr.clear(); dp[0]=0; x=mp[x]; arr.push_back(x); for(i=1;i>x; x=mp[x]; arr.push_back(x);//storing the position of the elements to check for disorder dp[i]=0; } max=lis(n-1); cout<