結果
問題 | No.1250 汝は倍数なりや? |
ユーザー | brthyyjp |
提出日時 | 2020-10-09 21:27:46 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 777 bytes |
コンパイル時間 | 321 ms |
コンパイル使用メモリ | 87,004 KB |
実行使用メモリ | 80,748 KB |
最終ジャッジ日時 | 2023-09-27 14:30:53 |
合計ジャッジ時間 | 5,162 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 77 ms
75,928 KB |
testcase_01 | AC | 78 ms
71,716 KB |
testcase_02 | AC | 77 ms
71,524 KB |
testcase_03 | AC | 78 ms
71,664 KB |
testcase_04 | AC | 80 ms
71,724 KB |
testcase_05 | AC | 76 ms
71,692 KB |
testcase_06 | AC | 77 ms
71,856 KB |
testcase_07 | AC | 78 ms
71,696 KB |
testcase_08 | AC | 77 ms
71,688 KB |
testcase_09 | AC | 78 ms
71,608 KB |
testcase_10 | AC | 76 ms
71,656 KB |
testcase_11 | AC | 81 ms
71,812 KB |
testcase_12 | AC | 81 ms
71,620 KB |
testcase_13 | AC | 77 ms
71,740 KB |
testcase_14 | AC | 76 ms
71,724 KB |
testcase_15 | AC | 79 ms
71,672 KB |
testcase_16 | AC | 79 ms
71,364 KB |
testcase_17 | AC | 78 ms
71,496 KB |
testcase_18 | AC | 77 ms
71,552 KB |
testcase_19 | AC | 76 ms
71,652 KB |
testcase_20 | AC | 79 ms
71,660 KB |
testcase_21 | TLE | - |
testcase_22 | -- | - |
testcase_23 | -- | - |
testcase_24 | -- | - |
testcase_25 | -- | - |
testcase_26 | -- | - |
testcase_27 | -- | - |
testcase_28 | -- | - |
testcase_29 | -- | - |
testcase_30 | -- | - |
testcase_31 | -- | - |
testcase_32 | -- | - |
testcase_33 | -- | - |
testcase_34 | -- | - |
testcase_35 | -- | - |
testcase_36 | -- | - |
testcase_37 | -- | - |
testcase_38 | -- | - |
testcase_39 | -- | - |
testcase_40 | -- | - |
testcase_41 | -- | - |
testcase_42 | -- | - |
testcase_43 | -- | - |
testcase_44 | -- | - |
testcase_45 | -- | - |
testcase_46 | -- | - |
testcase_47 | -- | - |
testcase_48 | -- | - |
testcase_49 | -- | - |
testcase_50 | -- | - |
testcase_51 | -- | - |
ソースコード
n,h = map(int, input().split()) A = list(map(int, input().split())) import math def factorize(n): d = {} temp = int(math.sqrt(n))+1 for i in range(2, temp): while n%i== 0: n //= i if i in d: d[i] += 1 else: d[i] = 1 if d == {}: d[n] = 1 else: if n in d: d[n] += 1 elif n != 1: d[n] =1 return d d = factorize(h) from collections import defaultdict c = defaultdict(lambda:0) for a in A: for k in d.keys(): cnt = 0 while a%k == 0: a //= k cnt += 1 c[k] += cnt #print(c) #print(d) for k, v in c.items(): if d[k] > v: print('NO') exit() else: print('YES')