Submit Info #3009

Problem Lang User Status Time Memory
Factorize python3 taq225 TLE 10000 ms 3.91 MiB

ケース詳細
Name Status Time Memory
big2_00 TLE 10000 ms -1 Mib
big2_01 TLE 10000 ms -1 Mib
big2_02 TLE 10000 ms -1 Mib
example_00 AC 20 ms 3.91 MiB
random_00 TLE 10000 ms -1 Mib
random_01 TLE 10000 ms -1 Mib
random_02 TLE 10000 ms -1 Mib
small_00 AC 20 ms 3.91 MiB
small_01 AC 21 ms 3.91 MiB
small_02 AC 20 ms 3.88 MiB

def prime_factorization(n): ''' Trial division. Input: n : a positive integer Output: a dictionary of #(each prime factors) of n, ''' result = [] app = result.append if n < 2: return [] while n % 2 == 0: app(2) n //= 2 p = 3 while p*p <= n: while n % p == 0: app(p) n //= p p += 2 if n > 1: app(n) return result Q = int(input()) for _ in range(Q): a = int(input()) fact = prime_factorization(a) print(len(fact), *fact)