From ec957d224610d5efb322ecadebbf0ee02fbc30bb Mon Sep 17 00:00:00 2001 From: AbhiYMCA <33192574+AbhiYMCA@users.noreply.github.com> Date: Sun, 29 Oct 2017 12:07:25 +0530 Subject: [PATCH] Create mex --- mex | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 mex diff --git a/mex b/mex new file mode 100644 index 0000000..067e7ea --- /dev/null +++ b/mex @@ -0,0 +1,27 @@ +#include +using namespace std; +int main() +{ + ios_base::sync_with_stdio(false); + long int t; + cin>>t; + while(t--) + { + long long int n,k,i=0; + cin>>n>>k; + long long int num,h[200005]={0}; + for(i=0;i>num; + h[num]++; + } + i=0; + while(k>=0) + { + if(!h[i]) + k--; + i++; + } + cout<