結果

問題 No.2682 Visible Divisible
ユーザー Maffy-0Maffy-0
提出日時 2024-03-20 21:52:54
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 119 ms / 2,000 ms
コード長 496 bytes
コンパイル時間 2,213 ms
コンパイル使用メモリ 203,704 KB
実行使用メモリ 6,548 KB
最終ジャッジ日時 2024-03-20 21:52:59
合計ジャッジ時間 5,067 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 90 ms
6,548 KB
testcase_01 AC 91 ms
6,548 KB
testcase_02 AC 100 ms
6,548 KB
testcase_03 AC 95 ms
6,548 KB
testcase_04 AC 103 ms
6,548 KB
testcase_05 AC 99 ms
6,548 KB
testcase_06 AC 119 ms
6,548 KB
testcase_07 AC 114 ms
6,548 KB
testcase_08 AC 2 ms
6,548 KB
testcase_09 AC 2 ms
6,548 KB
testcase_10 AC 2 ms
6,548 KB
testcase_11 AC 92 ms
6,548 KB
testcase_12 AC 100 ms
6,548 KB
testcase_13 AC 90 ms
6,548 KB
testcase_14 AC 97 ms
6,548 KB
testcase_15 AC 97 ms
6,548 KB
testcase_16 AC 101 ms
6,548 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

void fast_io() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
}

signed main(void) {
    fast_io();
    long N, K;
    cin >> N >> K;
    vector<long> A(N);
    long l = 1;
    for (int i = 0; i < N; i++) {
        cin >> A[i];
        A[i] = gcd(A[i], K);
        l = lcm(l, A[i]);
        // cout << A[i] << " ";
    }
    // cout << endl;
    // cout << l << endl;
    

    cout << (l % K == 0 ? "Yes\n" : "No\n");
    return 0;
}
0