結果

問題 No.2682 Visible Divisible
ユーザー だれ
提出日時 2023-12-15 21:04:44
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 182 ms / 2,000 ms
コード長 338 bytes
コンパイル時間 1,003 ms
コンパイル使用メモリ 80,384 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-27 06:29:59
合計ジャッジ時間 5,686 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <numeric>
using namespace std;

int main() {
    int n;
    long long k;
    cin >> n >> k;
    long long l = 1;
    for (int i = 0; i < n; i++) {
        long long a;
        cin >> a;
        a = gcd(k, a);
        l = lcm(l, a);
    }
    if (l == k) cout << "Yes" << endl;
    else cout << "No" << endl;
}
0