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



int main(){
int n, d;
	scanf("%d%d", &n, &d);
	int a[n];
	bool f = 0;
	int cnt = 0;
	for (int i = 0; i < n; i++) {
		scanf("%d", &a[i]);
		if (a[i] == d)f = 1;
		if(!a[i])cnt++;
	}

    if(!d){
        cout<<cnt<<endl;
        return 0;
    }

	 puts("0");

}
Copy
Legendary lafi-Odeh
GNU G++17
2 ms
304 KB
Wrong Answer