結果

問題 No.2682 Visible Divisible
ユーザー downer
提出日時 2024-03-20 21:55:57
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 196 ms / 2,000 ms
コード長 423 bytes
コンパイル時間 2,808 ms
コンパイル使用メモリ 247,704 KB
実行使用メモリ 6,528 KB
最終ジャッジ日時 2024-09-30 07:46:02
合計ジャッジ時間 6,702 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
    long long N, K;
    cin >> N >> K;
    vector<long long> A(N);
    for(int i = 0; i < N; i++) {
        cin >> A[i];
    }

    vector<long long> G(N);
    long long L = 1;
    for(int i = 0; i < N; i++) {
        G[i] = gcd(A[i], K);
        L = lcm(L, G[i]);
    }

    if(L % K == 0) cout << "Yes" << endl;
    else cout << "No" << endl;



    return 0;
}
0