結果

問題 No.2682 Visible Divisible
ユーザー hitonanode
提出日時 2024-04-04 02:16:30
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 95 ms / 2,000 ms
コード長 415 bytes
コンパイル時間 800 ms
コンパイル使用メモリ 86,836 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-01 00:12:50
合計ジャッジ時間 3,522 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
    cin.tie(nullptr)->sync_with_stdio(false);

    int N;
    long long K;
    cin >> N >> K;
    long long den = 1;
    while (N--) {
        long long a;
        cin >> a;
        a = std::gcd(K, a);
        den = std::lcm(den, a);
    }

    if (den == K) {
        puts("Yes");
    } else {
        puts("No");
    }
}
0