結果

問題 No.2682 Visible Divisible
ユーザー SnowBeenDidingSnowBeenDiding
提出日時 2024-03-20 21:42:04
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 213 ms / 2,000 ms
コード長 491 bytes
コンパイル時間 5,345 ms
コンパイル使用メモリ 308,504 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-03-20 21:42:15
合計ジャッジ時間 9,745 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 213 ms
6,676 KB
testcase_01 AC 198 ms
6,676 KB
testcase_02 AC 208 ms
6,676 KB
testcase_03 AC 206 ms
6,676 KB
testcase_04 AC 199 ms
6,676 KB
testcase_05 AC 200 ms
6,676 KB
testcase_06 AC 202 ms
6,676 KB
testcase_07 AC 203 ms
6,676 KB
testcase_08 AC 2 ms
6,676 KB
testcase_09 AC 2 ms
6,676 KB
testcase_10 AC 2 ms
6,676 KB
testcase_11 AC 204 ms
6,676 KB
testcase_12 AC 203 ms
6,676 KB
testcase_13 AC 192 ms
6,676 KB
testcase_14 AC 203 ms
6,676 KB
testcase_15 AC 191 ms
6,676 KB
testcase_16 AC 196 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

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;
        x = gcd(x, k);
        lc = gcd(lc, k);
        lc = lcm(lc, x);
        lc = gcd(lc, k);
    }
    if (k == lc)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
}
0