結果

問題 No.1250 汝は倍数なりや?
ユーザー nak2yoshi
提出日時 2020-10-09 23:03:27
言語 D
(dmd 2.109.1)
結果
WA  
実行時間 -
コード長 400 bytes
コンパイル時間 1,694 ms
コンパイル使用メモリ 172,684 KB
実行使用メモリ 13,448 KB
最終ジャッジ日時 2024-06-22 09:24:06
合計ジャッジ時間 3,774 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 34 WA * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

import std;

void main() {
    auto input = readln.split.to!(long[]);
    auto N = input[0], H = input[1];
    auto A = readln.split.to!(long[]);

    long P = 1;
    foreach (i; 0 .. N) {
        if (A[i] == 0) {
            writeln("NO");
            return;
        }
        P *= A[i];
        if (P % H == 0) {
            writeln("YES");
            return;
        }
    }
    writeln("NO");
}
0