fork download
  1. //ssenseeeeeeeeeeeeeeeeeeeeeeeeeeeee
  2. #include<bits/stdc++.h>
  3. #define startt ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
  4. typedef unsigned long long ull;
  5. typedef long long ll;
  6. #define MOD 1000000007
  7. #define MX 1000000000
  8. #define MXL 1000000000000000000
  9. #define PI 3.14159265
  10. #define pb push_back
  11. using namespace std;
  12. #define sc second
  13. #define endl '\n'
  14. #define fr first
  15.  
  16. int primes[26] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97};
  17.  
  18. int main(){
  19. startt
  20. map<int, int> mp;
  21. int n, k;
  22. cin >> n >> k;
  23. int a[n+1];
  24. for(int i = 0; i < n; i++)
  25. {
  26. cin >> a[i];
  27. }
  28. if(k%2 == 0)
  29. {
  30. cout << "NO" << endl;
  31. return 0;
  32. }
  33. for(int i = 0; i < n; i++)
  34. {
  35. for(int j = 0; j < 25; j++)
  36. {
  37. if(a[i]%primes[j] == 0)
  38. {
  39. mp[j]++;
  40. }
  41. }
  42. }
  43. for(int i = 0; i < 25; i++)
  44. {
  45. if(mp[i] >= n-1)
  46. {
  47. cout << "YES" << endl;
  48. return 0;
  49. }
  50. }
  51. cout << "NO" << endl;
  52. }
  53.  
Runtime error #stdin #stdout 0s 4432KB
stdin
Standard input is empty
stdout
Standard output is empty