题解 | #Redraiment的走法#
Redraiment的走法
https://www.nowcoder.com/practice/24e6243b9f0446b081b1d6d32f2aa3aa
#include <vector>
#include <iostream>
using namespace std;
int main() {
int n;
int t;
cin >> n;
vector<int> l;
for(int i=0;i<n;i++){
cin >> t;
l.push_back(t);
}
int a[200] ={0};
int max = -1;
for(int i=0;i<l.size();i++){
for(int j=0;j<i;j++){
if(l[i] > l[j]){
if (a[i] < a[j] +1){
a[i] = a[j] + 1;
}
}
}
if(max < a[i]){
max = a[i];
}
}
cout << max + 1 << endl;
}
// 64 位输出请用 printf("%lld")
