結果

問題 No.1250 汝は倍数なりや?
ユーザー hiragnhiragn
提出日時 2022-11-23 09:50:01
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 369 bytes
コンパイル時間 666 ms
コンパイル使用メモリ 11,880 KB
実行使用メモリ 41,140 KB
最終ジャッジ日時 2023-10-24 20:44:37
合計ジャッジ時間 5,824 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
10,056 KB
testcase_01 AC 28 ms
10,056 KB
testcase_02 AC 29 ms
10,056 KB
testcase_03 AC 29 ms
10,056 KB
testcase_04 AC 29 ms
10,056 KB
testcase_05 AC 29 ms
10,056 KB
testcase_06 AC 29 ms
10,056 KB
testcase_07 AC 28 ms
10,056 KB
testcase_08 AC 29 ms
10,056 KB
testcase_09 AC 29 ms
10,056 KB
testcase_10 AC 29 ms
10,056 KB
testcase_11 AC 28 ms
10,056 KB
testcase_12 AC 28 ms
10,056 KB
testcase_13 AC 28 ms
10,060 KB
testcase_14 AC 28 ms
10,060 KB
testcase_15 AC 28 ms
10,060 KB
testcase_16 AC 28 ms
10,060 KB
testcase_17 AC 28 ms
10,056 KB
testcase_18 AC 29 ms
10,060 KB
testcase_19 AC 29 ms
10,056 KB
testcase_20 AC 28 ms
10,060 KB
testcase_21 AC 28 ms
10,056 KB
testcase_22 AC 28 ms
10,060 KB
testcase_23 AC 29 ms
10,176 KB
testcase_24 AC 29 ms
10,176 KB
testcase_25 AC 29 ms
10,204 KB
testcase_26 AC 28 ms
10,120 KB
testcase_27 AC 28 ms
10,196 KB
testcase_28 AC 28 ms
10,140 KB
testcase_29 AC 29 ms
10,120 KB
testcase_30 AC 29 ms
10,204 KB
testcase_31 AC 29 ms
10,124 KB
testcase_32 AC 29 ms
10,204 KB
testcase_33 AC 160 ms
41,140 KB
testcase_34 AC 86 ms
25,972 KB
testcase_35 AC 137 ms
39,332 KB
testcase_36 AC 144 ms
39,944 KB
testcase_37 AC 93 ms
26,576 KB
testcase_38 AC 99 ms
26,964 KB
testcase_39 AC 86 ms
25,844 KB
testcase_40 AC 87 ms
26,056 KB
testcase_41 AC 110 ms
28,112 KB
testcase_42 AC 70 ms
19,604 KB
testcase_43 AC 144 ms
40,784 KB
testcase_44 AC 71 ms
19,656 KB
testcase_45 AC 142 ms
40,024 KB
testcase_46 AC 59 ms
17,196 KB
testcase_47 AC 92 ms
26,732 KB
testcase_48 AC 28 ms
10,056 KB
testcase_49 AC 28 ms
10,056 KB
testcase_50 WA -
testcase_51 AC 28 ms
10,056 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    n, h = map(int, input().split())
    arr = set(map(int, input().split()))

    if h == 1 or 0 in arr or h in arr:
        exit(print("YES"))

    cur = 1
    for a in arr:
        if a < 0:
            a *= -1
        cur = (cur * (a % h)) % h

    if cur == 0:
        print("YES")
    else:
        print("NO")


if __name__ == "__main__":
    main()
0