jakaria_hossain

codeforce - next test

May 26th, 2019
74
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. int n;
  6. scanf("%d",&n);
  7. int ara[n+1];
  8. map<int,int>mp;
  9. for(int i=0;i<n;i++)
  10. {
  11. scanf("%d",&ara[i]);
  12. mp[ara[i]]++;
  13. }
  14. int cnt=1;
  15. while(cnt)
  16. {
  17. if(mp[cnt]==0)break;
  18. cnt++;
  19. }
  20. printf("%d\n",cnt);
  21. return 0;
  22. }
RAW Paste Data