Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- #include <set>
- using namespace std;
- ifstream F ("calcule.in");
- ofstream G ("calcule.out");
- int n, k, x;
- multiset <int> s;
- multiset<int>::iterator lwr;
- int main()
- {
- F >> n >> k;
- for(int i = 0; i < n; ++ i)
- {
- F >> x;
- lwr = s.lower_bound(x);
- if(lwr != s.begin())
- {
- s.erase(lwr);
- }
- s.insert(x);
- }
- G << s.size();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement