一秒懵逼,数学不好,场上当然只能干瞪眼。
顺便提一句,如果用cin输入,会超时的。
#include<stdio.h>
#include<iostream>
#include<math.h>
#include<string.h>
#include<iomanip>
#include<stdlib.h>
#include<ctype.h>
#include<algorithm>
#include<deque>
#include<functional>
#include<iterator>
#include<vector>
#include<list>
#include<map>
#include<queue>
#include<set>
#include<stack>
#define CPY(A, B) memcpy(A, B, sizeof(A))
typedef long long LL;
typedef unsigned long long uLL;
const int MOD = int (1e9) + 7;
const int INF = 0x3f3f3f3f;
const LL INFF = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-9;
const double OO = 1e20;
const double PI = acos (-1.0);
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, 1, 0, -1};
using namespace std;
LL gcd (LL a,LL b) {return b==0?a:gcd (b,a%b);} //最大公约数
LL lcm (LL a,LL b) {return a*b/gcd (a,b);}//最小公倍数
int main() {
int n; LL k, x;
scanf ("%d %lld",&n,&k);
LL ans = 1;
for (int i=0; i<n; ++i) {
scanf ("%lld",&x);
ans=lcm (ans,x) %k;
}
if (!ans) {puts ("Yes");} //如果能整除就是可以的
else {puts ("No");}//如果给出的n个数的最小公倍数是k的倍数,那么就输出Yes
return 0;
}