Source Code
#include <stdio.h>
int main(){
  long long n,d;
  scanf("%lld%lld",&n,&d);
  long long a;
  for(long long i = 0; i < n; i++){
    scanf("%lld",&a);
    if(a == d){
      printf("%lld",d);
      return 0;
    }
  }
  printf("0");
  return 0;

}
Copy
Legendary Ayoooy
GNU G++17
2 ms
204 KB
Wrong Answer