In this post, the Next Test Codeforces Solution is given. Here is the Question details : Codeforces Beta Round #27 (Codeforces format, Div. 2), problem: (A) Next Test.
Next Test Codeforces Solution
#include<bits/stdc++.h> using namespace std; const int MOD=1000000007; #define ll long long #define Fastio ios_base::sync_with_stdio(false); cin.tie(NULL); int main() { Fastio; ll n,x; cin>>n; vector<ll> v(3005); for(int i=0;i<n;i++) { cin>>x; v[x]++; } for(ll i=1;i<v.size();i++) { if(v[i]==0) { cout<<i<<endl; break; } } } |
The solution of the above program is contributed by Vishal Vaibhab (IIT BHU). If you like TheCode11, then do follow us on Facebook, Twitter and Instagram.