最少拦截系统
Implemented with one of all possible algorithms
///@author Sycamore ///@date 8/8/2017 #include<bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int n; while (cin >> n) { int pre = 30005, now, ans = 0; multiset<int>cur; while (n--) { cin >> now; auto lb = cur.lower_bound(now); if (lb == cur.end()) ans++; else cur.erase(lb); cur.insert(now); //pre = now; } cout << ans << '\n'; } return 0; }