結果
| 問題 |
No.1611 Minimum Multiple with Double Divisors
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-09-10 14:11:11 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 788 bytes |
| コンパイル時間 | 386 ms |
| コンパイル使用メモリ | 81,932 KB |
| 実行使用メモリ | 79,060 KB |
| 最終ジャッジ日時 | 2025-01-03 05:27:30 |
| 合計ジャッジ時間 | 13,630 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 27 WA * 10 |
ソースコード
from collections import defaultdict
def prime_factorization(n):
arr = defaultdict(int)
for i in range(2, int(n**0.5)+1):
while n % i == 0:
arr[i] += 1
n //= i
if n != 1:
arr[n] += 1
return arr
t = int(input())
ans = []
primes = [2, 3, 5, 7, 11, 13, 17, 23, 29, 31]
options = [prime_factorization(i) for i in range(0, 32)]
for i in range(t):
x = int(input())
d = defaultdict(int)
for p in primes:
temp = x
while temp % p == 0:
d[p] += 1
temp //= p
for i in range(2, 32):
xnum = 1
opnum = 1
for p in options[i]:
xnum *= (d[p]+1)
opnum *= (d[p] + options[i][p] + 1)
if 2*xnum == opnum:
break
print(i*x)