#include using namespace std;// To execute C++, please define "int main()"// The TestCase is shown below// Input : 1 2// Output : 3/*int main() {int n;cin>>n;vector b(n);vector result(n,0); int maxLen = 0;for(int i=0;icin>>b[i];int l = 0;int r = maxLen;while(l int mid = l + (r - l)/2;if(result[mid] l = mid + 1;}else {r = mid;}}result[l] = b[i]; if(l == maxLen)maxLen++;}cout return 0;}*/int main(){ int n; cin>>n; vector b(n); vector result(n,1); int maxLen = 0; for(int i=0;i cin>>b[i]; } for(int i=1;i for(int j=0;j if(b[i] > b[j])result[i] = max(result[j] + 1,result[i]); } } cout return 0;}