Source Code
#include<bits/stdc++.h>
using namespace std;

const int N = 2e5 + 5;

void solve(){
    int n,d;
    cin>>n>>d;
    for(int i =0 ; i<n ; i++){
        int x;
        cin>>x;
        if(x == d){
            cout<<1;
            return;
        }
    }
    cout<<0;
}
 
int main(){
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
    #ifndef ONLINE_JUDGE
        freopen("input.in","r",stdin);
    #endif


    int tt = 1;
    // cin>>tt;
    while(tt--)
        solve();
}   
Copy
Legendary YouKn0wWho
GNU G++17
3 ms
788 KB
Wrong Answer