fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. bool answer = false;
  6. int N,X;
  7. cin >> N >> X;
  8. vector<int>A(N);
  9. for(int i=0; i<N; i++){
  10. cin >> A[i];
  11. }
  12.  
  13. for(int i=0; i<N; i++){
  14. if(A[i]==X){
  15. cout << "Yes";
  16. answer = true;
  17. break;
  18. }
  19. }
  20.  
  21. if(!answer){
  22. cout << "No";
  23. }
  24. // your code goes here
  25. return 0;
  26. }
Success #stdin #stdout 0.01s 5312KB
stdin
6 28
30 10 40 10 50 90
stdout
No