結果

問題 No.1250 汝は倍数なりや?
ユーザー aqua_tenhouaqua_tenhou
提出日時 2020-10-09 21:30:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 125 ms / 1,000 ms
コード長 649 bytes
コンパイル時間 818 ms
コンパイル使用メモリ 86,696 KB
実行使用メモリ 102,056 KB
最終ジャッジ日時 2023-09-27 14:47:49
合計ジャッジ時間 6,024 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
71,772 KB
testcase_01 AC 63 ms
71,708 KB
testcase_02 AC 62 ms
71,496 KB
testcase_03 AC 59 ms
71,772 KB
testcase_04 AC 61 ms
71,652 KB
testcase_05 AC 61 ms
71,876 KB
testcase_06 AC 61 ms
71,776 KB
testcase_07 AC 63 ms
71,844 KB
testcase_08 AC 62 ms
71,704 KB
testcase_09 AC 61 ms
71,712 KB
testcase_10 AC 60 ms
71,768 KB
testcase_11 AC 60 ms
71,536 KB
testcase_12 AC 59 ms
71,600 KB
testcase_13 AC 61 ms
71,776 KB
testcase_14 AC 64 ms
71,732 KB
testcase_15 AC 63 ms
71,716 KB
testcase_16 AC 64 ms
71,772 KB
testcase_17 AC 59 ms
71,580 KB
testcase_18 AC 61 ms
71,600 KB
testcase_19 AC 62 ms
71,712 KB
testcase_20 AC 61 ms
71,496 KB
testcase_21 AC 60 ms
71,508 KB
testcase_22 AC 61 ms
71,740 KB
testcase_23 AC 61 ms
71,648 KB
testcase_24 AC 64 ms
76,320 KB
testcase_25 AC 66 ms
76,368 KB
testcase_26 AC 64 ms
76,196 KB
testcase_27 AC 66 ms
76,164 KB
testcase_28 AC 63 ms
76,024 KB
testcase_29 AC 61 ms
71,364 KB
testcase_30 AC 66 ms
75,784 KB
testcase_31 AC 63 ms
71,360 KB
testcase_32 AC 65 ms
76,192 KB
testcase_33 AC 125 ms
100,256 KB
testcase_34 AC 92 ms
92,148 KB
testcase_35 AC 111 ms
102,056 KB
testcase_36 AC 123 ms
99,348 KB
testcase_37 AC 94 ms
92,516 KB
testcase_38 AC 97 ms
94,156 KB
testcase_39 AC 94 ms
92,084 KB
testcase_40 AC 92 ms
92,224 KB
testcase_41 AC 92 ms
96,708 KB
testcase_42 AC 89 ms
86,828 KB
testcase_43 AC 118 ms
99,396 KB
testcase_44 AC 88 ms
86,952 KB
testcase_45 AC 117 ms
99,656 KB
testcase_46 AC 80 ms
83,064 KB
testcase_47 AC 96 ms
94,316 KB
testcase_48 AC 61 ms
71,400 KB
testcase_49 AC 61 ms
71,720 KB
testcase_50 AC 58 ms
71,816 KB
testcase_51 AC 59 ms
71,600 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def fact(A): #fact(int)
    c0 = A
    r = 2
    lis = []
    count = 1
    while A != 1:
        if A%r == 0:
            A = A//r
            lis.append(r)
            r = 2
        else:
            r += 1
        if r > int(pow(c0,0.5))+1:
            lis.append(A)
            break
    return(lis)

n,h = map(int,input().split())
a = list(map(int,input().split()))
lis = fact(h)
lis_bool = [0]*len(lis)

for x in a:
    q = x
    for j,y in enumerate(lis):
        
        if lis_bool[j] == 0:
            if q%y == 0:
                lis_bool[j] = 1
                q = q//y

if 0 in lis_bool:
    print("NO")
else:
    print("YES")
        
0