結果

問題 No.1250 汝は倍数なりや?
ユーザー kaede2020
提出日時 2020-10-10 16:43:23
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 119 ms / 1,000 ms
コード長 757 bytes
コンパイル時間 3,634 ms
コンパイル使用メモリ 228,688 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-20 16:04:02
合計ジャッジ時間 6,186 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 49
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
template <typename T> bool chmax(T &u, const T z) { if (u < z) {u = z; return true;} else return false; }
template <typename T> bool chmin(T &u, const T z) { if (u > z) {u = z; return true;} else return false; }
#define ll long long
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
typedef pair<ll, ll> P;
//const ll INF = 1LL << 60;
using mint = modint1000000007;
//using mint = modint998244353;
const int MOD = 1000000007;
ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }

int main(){
 ll n,h;
 cin>>n>>h;
 vector<ll>a(n);
 rep(i,n)cin>>a[i];
 rep(i,n){
   ll tmp=gcd(a[i],h);
   h/=tmp;
 }
 if(h==1)cout<<"YES"<<endl;
 else cout<<"NO"<<endl;
 return 0;
}
0