SHARE
TWEET

codeforce - next test

jakaria_hossain May 26th, 2019 66 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
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top