Source Code
#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
using namespace std;

#define int long long
#define printv(x) for(int i : x) cout << i << " "; cout << endl;

#define fl(x) for(int i = 0 ; i < x.size(); i++ )
#define yes cout << "YES" << endl;
#define no cout << "NO" << endl


void solve() {
    int n ,d ;
    cin >> n >> d;

    vector<int>v(n);

    int ans = 0 ;
    for (int i = 0; i < n; ++i) {
        cin >> v[i];

        if(v[i] == d )
            ans = 1 ;
    }

    cout << ans << endl;

}

int32_t main() {
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);   
    #endif
//    int t ; cin >> t; while(t--) solve();
    solve();

    return 0;

}
Copy
Legendary Momen-G-Ar
GNU G++17
3 ms
644 KB
Wrong Answer