IMohammedNasr

Untitled

Mar 26th, 2022
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. int n;
  2. cin >> n;
  3. vector<ll> v(n);
  4. map<ll, bool> m;
  5. for (auto &i : v)
  6. {
  7. cin >> i;
  8. m[i] = true;
  9. }
  10. for (int i = 0; i <= 2000; i++)
  11. {
  12. if (!m[i])
  13. {
  14. cout << i << endl;
  15. return;
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment