結果

問題 No.1250 汝は倍数なりや?
ユーザー weaken
提出日時 2020-10-11 13:48:32
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 800 bytes
コンパイル時間 2,060 ms
コンパイル使用メモリ 198,920 KB
最終ジャッジ日時 2025-01-15 06:36:28
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 26 WA * 22 RE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define fastIO (cin.tie(0), cout.tie(0), ios::sync_with_stdio(false))
using namespace std;

vector<int> divEnumerate(int num) {
  vector<int> res;
  if (num == 1) {
    res.emplace_back(1);
    return res;
  }

  for (int i = 2; i * i <= num;) {
    if (num % i == 0) {
      res.emplace_back(i);
      num /= i;
    } else {
      i == 2 ? i++ : i += 2;
    }
  }
  res.emplace_back(num);
  return res;
}

int main() {
  fastIO;
  int n, h;
  cin >> n >> h;

  vector<int> A(n);
  for (auto &a : A)
    cin >> a;

  sort(A.begin(), A.end());
  reverse(A.begin(), A.end());

  for (const auto mod : A) {
    if (h % mod == 0) {
      h /= mod;
    }

    if (h == 1 || h == mod) {
      cout << "YES" << '\n';
      return 0;
    }
  }

  cout << "NO" << '\n';
  return 0;
}
0