Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <vector>
- #include <iostream>
- #include <list>
- #include <algorithm>
- using namespace std;
- int main()
- {
- size_t n;
- size_t k;
- vector<int64_t> a;
- std::cin>>n>>k;
- for(size_t i = 0 ; i != n; ++i)
- {
- cin>>a[i];
- }
- int64_t cnt = 0;
- int64_t cnt2 = 0;
- std::sort(a.begin(), a.end());
- int64_t u = a[0];
- for(auto b : a)
- {
- if(b == u)
- {
- cnt++;
- }
- else {
- cnt2++;
- u = b;
- }
- }
- cnt--;
- std::cout<<cnt<<cnt2;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement