結果

問題 No.1250 汝は倍数なりや?
ユーザー toshiro_yanagitoshiro_yanagi
提出日時 2022-07-09 12:21:05
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 527 bytes
コンパイル時間 269 ms
コンパイル使用メモリ 86,568 KB
実行使用メモリ 99,824 KB
最終ジャッジ日時 2023-08-28 23:16:25
合計ジャッジ時間 7,359 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
71,300 KB
testcase_01 AC 65 ms
71,092 KB
testcase_02 AC 66 ms
71,016 KB
testcase_03 AC 66 ms
71,244 KB
testcase_04 AC 66 ms
71,012 KB
testcase_05 AC 68 ms
71,252 KB
testcase_06 AC 65 ms
71,248 KB
testcase_07 AC 64 ms
71,140 KB
testcase_08 AC 64 ms
71,156 KB
testcase_09 AC 66 ms
71,064 KB
testcase_10 AC 66 ms
71,024 KB
testcase_11 WA -
testcase_12 AC 67 ms
71,112 KB
testcase_13 AC 66 ms
71,208 KB
testcase_14 AC 67 ms
71,252 KB
testcase_15 AC 66 ms
70,992 KB
testcase_16 AC 67 ms
70,924 KB
testcase_17 AC 68 ms
70,928 KB
testcase_18 AC 69 ms
71,080 KB
testcase_19 AC 67 ms
71,224 KB
testcase_20 AC 67 ms
71,020 KB
testcase_21 AC 67 ms
71,188 KB
testcase_22 AC 68 ms
71,128 KB
testcase_23 AC 72 ms
74,760 KB
testcase_24 AC 72 ms
74,832 KB
testcase_25 AC 70 ms
75,128 KB
testcase_26 AC 65 ms
71,212 KB
testcase_27 AC 73 ms
74,948 KB
testcase_28 AC 67 ms
71,016 KB
testcase_29 AC 70 ms
74,908 KB
testcase_30 AC 71 ms
75,024 KB
testcase_31 AC 68 ms
71,020 KB
testcase_32 AC 71 ms
75,412 KB
testcase_33 AC 176 ms
99,824 KB
testcase_34 AC 110 ms
85,504 KB
testcase_35 AC 129 ms
92,876 KB
testcase_36 AC 159 ms
94,284 KB
testcase_37 AC 138 ms
86,640 KB
testcase_38 AC 143 ms
87,828 KB
testcase_39 AC 108 ms
85,624 KB
testcase_40 AC 110 ms
86,208 KB
testcase_41 AC 155 ms
88,852 KB
testcase_42 AC 118 ms
82,728 KB
testcase_43 AC 171 ms
94,400 KB
testcase_44 AC 114 ms
82,816 KB
testcase_45 AC 142 ms
94,244 KB
testcase_46 AC 115 ms
80,540 KB
testcase_47 AC 117 ms
87,876 KB
testcase_48 AC 67 ms
71,180 KB
testcase_49 AC 68 ms
71,228 KB
testcase_50 AC 67 ms
71,252 KB
testcase_51 AC 67 ms
71,020 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

bufio_scanner = []


def main():
    n, h = [int(fmt_scan()) for _ in range(2)]
    a = [int(x) for x in input().split()]

    for _, v in enumerate(a):
        if v % gcd(h, v) == 0:
            h //= gcd(h, v)

    print("YES" if h == 1 else "NO")


def fmt_scan() -> str:
    sc = bufio_scanner
    if len(sc) == 0:
        for v in reversed(input().split()):
            sc.append(v)
    return sc.pop()


def gcd(a, b) -> int:
    a, b = max(a, b), min(a, b)
    while b > 0:
        a, b = b, a % b
    return a


main()
0