結果

問題 No.1250 汝は倍数なりや?
ユーザー momoyuumomoyuu
提出日時 2022-08-03 03:10:33
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 229 ms / 1,000 ms
コード長 343 bytes
コンパイル時間 331 ms
コンパイル使用メモリ 87,300 KB
実行使用メモリ 101,520 KB
最終ジャッジ日時 2023-10-01 03:50:49
合計ジャッジ時間 7,913 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,276 KB
testcase_01 AC 70 ms
71,464 KB
testcase_02 AC 71 ms
71,276 KB
testcase_03 AC 72 ms
71,488 KB
testcase_04 AC 70 ms
71,332 KB
testcase_05 AC 71 ms
71,188 KB
testcase_06 AC 70 ms
71,124 KB
testcase_07 AC 72 ms
71,364 KB
testcase_08 AC 70 ms
71,284 KB
testcase_09 AC 71 ms
71,508 KB
testcase_10 AC 70 ms
71,360 KB
testcase_11 AC 70 ms
71,500 KB
testcase_12 AC 70 ms
71,308 KB
testcase_13 AC 70 ms
71,436 KB
testcase_14 AC 71 ms
71,516 KB
testcase_15 AC 72 ms
71,584 KB
testcase_16 AC 69 ms
71,416 KB
testcase_17 AC 71 ms
71,264 KB
testcase_18 AC 71 ms
71,492 KB
testcase_19 AC 70 ms
71,120 KB
testcase_20 AC 71 ms
71,304 KB
testcase_21 AC 69 ms
71,420 KB
testcase_22 AC 71 ms
71,276 KB
testcase_23 AC 91 ms
75,740 KB
testcase_24 AC 89 ms
75,532 KB
testcase_25 AC 84 ms
75,916 KB
testcase_26 AC 74 ms
71,304 KB
testcase_27 AC 87 ms
75,864 KB
testcase_28 AC 71 ms
71,220 KB
testcase_29 AC 78 ms
75,660 KB
testcase_30 AC 75 ms
75,544 KB
testcase_31 AC 72 ms
71,568 KB
testcase_32 AC 75 ms
75,496 KB
testcase_33 AC 225 ms
100,496 KB
testcase_34 AC 142 ms
91,872 KB
testcase_35 AC 167 ms
101,520 KB
testcase_36 AC 209 ms
99,552 KB
testcase_37 AC 173 ms
92,140 KB
testcase_38 AC 179 ms
94,864 KB
testcase_39 AC 157 ms
92,236 KB
testcase_40 AC 162 ms
93,252 KB
testcase_41 AC 196 ms
96,888 KB
testcase_42 AC 149 ms
86,912 KB
testcase_43 AC 229 ms
99,484 KB
testcase_44 AC 198 ms
87,508 KB
testcase_45 AC 176 ms
99,664 KB
testcase_46 AC 177 ms
84,232 KB
testcase_47 AC 172 ms
94,628 KB
testcase_48 AC 70 ms
71,364 KB
testcase_49 AC 72 ms
71,120 KB
testcase_50 AC 70 ms
71,304 KB
testcase_51 AC 70 ms
71,516 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,H = map(int,input().split())
A = list(map(int,input().split()))
def gcd(x,y):
    """
    最大公約数を求める。
    O(log(min(x,y)))
    """

    if x<y:
        x,y = y,x
    if y == 0:
        return x
    return gcd(y,x%y)

for i in range(N):
    a = gcd(abs(A[i]),H)
    H //= a
if H == 1:
    print("YES")
else:
    print("NO")
0