結果
| 問題 | No.1250 汝は倍数なりや? | 
| コンテスト | |
| ユーザー |  a01sa01to | 
| 提出日時 | 2024-01-24 00:29:13 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 859 bytes | 
| コンパイル時間 | 1,913 ms | 
| コンパイル使用メモリ | 200,400 KB | 
| 最終ジャッジ日時 | 2025-02-18 22:28:38 | 
| ジャッジサーバーID (参考情報) | judge5 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 38 WA * 4 TLE * 7 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
  #include "settings/debug.cpp"
  #define _GLIBCXX_DEBUG
#else
  #define Debug(...) void(0)
#endif
#define rep(i, n) for (int i = 0; i < (n); ++i)
using ll = long long;
using ull = unsigned long long;
int main() {
  int n, h;
  cin >> n >> h;
  vector<int> a(n);
  rep(i, n) cin >> a[i];
  map<int, int> mp;
  for (int x : a) {
    for (int i = 2; i * i <= x; i++) {
      if (x % i == 0) {
        mp[i]++;
        while (x % i == 0) x /= i, mp[i]++;
      }
    }
    if (x != 1) mp[x]++;
  }
  for (int i = 2; i * i <= h; i++) {
    if (h % i == 0) {
      if (mp[i] == 0) {
        cout << "NO" << endl;
        return 0;
      }
      while (h % i == 0) h /= i, mp[i]--;
    }
  }
  if (h != 1 && mp[h] == 0) {
    cout << "NO" << endl;
  }
  else {
    cout << "YES" << endl;
  }
  return 0;
}
            
            
            
        