結果

問題 No.1250 汝は倍数なりや?
ユーザー hiragnhiragn
提出日時 2022-11-23 09:50:44
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 122 ms / 1,000 ms
コード長 370 bytes
コンパイル時間 658 ms
コンパイル使用メモリ 11,896 KB
実行使用メモリ 30,380 KB
最終ジャッジ日時 2023-10-24 20:44:50
合計ジャッジ時間 4,563 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
10,032 KB
testcase_01 AC 26 ms
10,032 KB
testcase_02 AC 26 ms
10,032 KB
testcase_03 AC 26 ms
10,032 KB
testcase_04 AC 26 ms
10,032 KB
testcase_05 AC 27 ms
10,032 KB
testcase_06 AC 26 ms
10,032 KB
testcase_07 AC 26 ms
10,032 KB
testcase_08 AC 26 ms
10,032 KB
testcase_09 AC 26 ms
10,032 KB
testcase_10 AC 27 ms
10,032 KB
testcase_11 AC 26 ms
10,032 KB
testcase_12 AC 26 ms
10,032 KB
testcase_13 AC 26 ms
10,036 KB
testcase_14 AC 26 ms
10,036 KB
testcase_15 AC 26 ms
10,036 KB
testcase_16 AC 26 ms
10,036 KB
testcase_17 AC 26 ms
10,032 KB
testcase_18 AC 26 ms
10,036 KB
testcase_19 AC 27 ms
10,032 KB
testcase_20 AC 26 ms
10,036 KB
testcase_21 AC 26 ms
10,032 KB
testcase_22 AC 27 ms
10,036 KB
testcase_23 AC 27 ms
10,124 KB
testcase_24 AC 27 ms
10,120 KB
testcase_25 AC 27 ms
10,152 KB
testcase_26 AC 27 ms
10,056 KB
testcase_27 AC 27 ms
10,136 KB
testcase_28 AC 26 ms
10,080 KB
testcase_29 AC 26 ms
10,056 KB
testcase_30 AC 27 ms
10,148 KB
testcase_31 AC 27 ms
10,060 KB
testcase_32 AC 27 ms
10,148 KB
testcase_33 AC 122 ms
30,380 KB
testcase_34 AC 68 ms
20,200 KB
testcase_35 AC 101 ms
27,780 KB
testcase_36 AC 111 ms
28,656 KB
testcase_37 AC 75 ms
21,072 KB
testcase_38 AC 81 ms
21,988 KB
testcase_39 AC 69 ms
20,076 KB
testcase_40 AC 70 ms
20,552 KB
testcase_41 AC 92 ms
23,664 KB
testcase_42 AC 60 ms
17,464 KB
testcase_43 AC 109 ms
28,620 KB
testcase_44 AC 61 ms
17,516 KB
testcase_45 AC 106 ms
28,736 KB
testcase_46 AC 52 ms
15,388 KB
testcase_47 AC 75 ms
21,492 KB
testcase_48 AC 26 ms
10,032 KB
testcase_49 AC 26 ms
10,032 KB
testcase_50 AC 26 ms
10,032 KB
testcase_51 AC 26 ms
10,032 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    n, h = map(int, input().split())
    arr = list(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