Source Code
#include<iostream>
#include<fstream>
#include<cmath>
#include<algorithm>
#include<list>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<utility>
#include<stack>
#include<queue>
#include<iterator>
#include<time.h>
#include<sstream>
#include<iomanip>
using namespace std;

int main()
{

    int n,d;
    cin>>n>>d;
    long long x[n];
    bool ans=false;
    for(int i=0; i<n; i++)
    {
        cin>>x[i];
        if(x[i]==d)
            ans=true;
    }

    if(ans)
        cout<<1<<endl;
    else
        cout<<0<<endl;

}
Copy
Legendary Abbro
GNU G++17
2 ms
872 KB
Wrong Answer