0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-09 01:38:48 +00:00
OI-codes/S2OJ/1034/1034.cpp

23 lines
364 B
C++

#include <bits/stdc++.h>
using namespace std;
int n, l, x, ans;
set<int> s;
int main() {
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> x;
auto it = s.upper_bound(x);
if (it == s.end()) {
ans++;
} else {
s.erase(*it);
}
s.insert(x);
}
cout << ans << endl;
return 0;
}