Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include<bits/stdc++.h>
- #include<utility>
- #include <queue>
- #define ll long long
- #define ull unsigned long long
- #define pi 3.14159
- #define OO 2000000000
- //#define ceil(w, m) (((w) / (m)) + ((w) % (m) ? 1 : 0))
- using namespace std;
- void yasmeen_fakhri(){
- ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
- #ifndef ONLINE_JUDGE
- freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
- #endif
- }
- int main() {
- yasmeen_fakhri();
- int n , k ; cin>>n>>k;
- int arr[n]; int freq[1005]={0};
- for(int i=1 ; i<=n; i++){
- cin>>arr[i];
- freq[arr[i]]++;
- }
- int arr1[1005]={0};
- int c =1;
- for(int i=1 ; i<=1005 ; i++){
- int m=i ;
- if(freq[m] == 0) {
- arr1[c] = m ;
- c++;
- }
- }
- cout<<arr1[k];
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement