T3000

Untitled

Mar 29th, 2022
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4. using ll = long long;
  5.  
  6. int main()
  7. {
  8.     ll x, y;
  9.     cin >> x >> y;
  10.     map<ll, ll> z2;
  11.     while (y-- > 0)
  12.     {
  13.         ll a;
  14.         cin >> a;
  15.         z2[a] += 1;
  16.     }
  17.     vector<ll> z1(x);
  18.     ll ans = 0;
  19.     for (auto iz : z2)
  20.     {
  21.         z1.at(iz.first) += 1;
  22.         ans += 1;
  23.     }
  24.  
  25.     for (int i = 0; i < x; i++)
  26.     {
  27.         if (z1.at(i) == 0)
  28.         {
  29.             cout << i << endl;
  30.         }
  31.     }
  32.     cout << "Mario got " << ans << " of the dangerous obstacles." << endl;
  33.     return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment