Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int n;
- cin >> n;
- vector<ll> v(n);
- map<ll, bool> m;
- for (auto &i : v)
- {
- cin >> i;
- m[i] = true;
- }
- for (int i = 0; i <= 2000; i++)
- {
- if (!m[i])
- {
- cout << i << endl;
- return;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment