fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int t;
  6. cin >> t;
  7. while(t--)
  8. {
  9. int n,k,c=0;
  10. cin >> n >> k;
  11. for(int i=0;i<n;i++)
  12. {
  13. int a;
  14. cin >> a;
  15. if(a==k)
  16. {
  17. c++;
  18. }
  19. }
  20. if(c>0)
  21. {
  22. cout << "YES" <<endl;
  23. }
  24. else
  25. {
  26. cout << "NO" << endl;
  27. }
  28. }
  29. return 0;
  30. }
Success #stdin #stdout 0s 5304KB
stdin
7
5 4
1 4 3 4 1
4 1
2 3 4 4
5 6
43 5 60 4 2
2 5
1 5
4 1
5 3 3 1
1 3
3
5 3
3 4 1 5 5
stdout
YES
NO
NO
YES
YES
YES
YES