Source Code
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define f first
#define s second
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()

const int inf = 2e9;
const ll infll = 1e18;
const int M = 1000000007;
const int N = 2e5;

int n, d, a[N];
int main(){
    scanf("%d%d", &n, &d);
    int ans = 0;
    for(int i = 0; i < n; ++i){
        scanf("%d", &a[i]);
        ans |= (a[i] == d);
    }

    printf("%d\n", ans);

}

Copy
Legendary Hambubger
GNU G++17
3 ms
776 KB
Wrong Answer