結果
問題 |
No.1250 汝は倍数なりや?
|
ユーザー |
![]() |
提出日時 | 2024-07-01 12:22:37 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 607 bytes |
コンパイル時間 | 213 ms |
コンパイル使用メモリ | 81,720 KB |
実行使用メモリ | 66,048 KB |
最終ジャッジ日時 | 2024-07-01 12:22:42 |
合計ジャッジ時間 | 5,085 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 TLE * 1 -- * 30 |
ソースコード
def factorization(n): arr = [] temp = n for i in range(2, int(-(-n**0.5 // 1)) + 1): if temp % i == 0: cnt = 0 while temp % i == 0: cnt += 1 temp //= i arr.append([i, cnt]) if temp != 1: arr.append([temp, 1]) return arr N, H = map(int, input().split()) A = list(map(int, input().split())) for k, v in factorization(H): cnt = 0 for i in range(N): while A[i] % k == 0: A[i] //= k cnt += 1 if cnt < v: print("NO") exit() print("YES")