結果

問題 No.2682 Visible Divisible
ユーザー SnowBeenDiding
提出日時 2024-03-20 21:36:42
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 443 bytes
コンパイル時間 4,680 ms
コンパイル使用メモリ 308,860 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-09-30 07:25:53
合計ジャッジ時間 8,558 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 7 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

#include <atcoder/all>
#define rep(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++)
using namespace std;
using namespace atcoder;

typedef long long ll;

int main() {
    int n;
    ll k;
    cin >> n >> k;
    ll lc = 1;
    rep(i, 0, n) {
        ll x;
        cin >> x;
        lc = lcm(lc, x);
        lc = gcd(lc, k);
    }
    if (k == lc)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
}
0