Topic links:
L2-014 train schedule (25 points)
ideas:
with greedy look a little thought you can know the rise longest sequence in which questions seeking original sequence of
the code:
#include<bits/stdc++.h>
using namespace std;
const int maxn = 123456;
const int INF = 1 << 30;
int a[maxn];
int main() {
#ifdef MyTest
freopen("Sakura.txt", "r", stdin);
#endif
int n;
scanf("%d", &n);
fill(a, a + n, INF);
for(int i = 0; i < n; ++i) {
int x;
scanf("%d", &x);
*lower_bound(a, a + n, x) = x;
}
cout << lower_bound(a, a + n, INF) - a;
return 0;
}