0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-05 13:18:47 +00:00
OI-codes/AcWing/895/895.cpp

24 lines
435 B
C++
Raw Normal View History

#include <bits/stdc++.h>
using namespace std;
int n, a[1005], f[1005], ans;
int main() {
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> a[i];
}
for (int i = 1; i <= n; i++) {
f[i] = 1;
for (int j = 1; j < i; j++) {
if (a[j] < a[i]) {
f[i] = max(f[i], f[j] + 1);
}
}
ans = max(ans, f[i]);
}
cout << ans << endl;
return 0;
}