結果

問題 No.1611 Minimum Multiple with Double Divisors
ユーザー brthyyjpbrthyyjp
提出日時 2022-03-01 18:06:24
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 1,065 bytes
コンパイル時間 1,125 ms
コンパイル使用メモリ 86,996 KB
実行使用メモリ 88,652 KB
最終ジャッジ日時 2023-09-22 08:24:57
合計ジャッジ時間 9,457 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
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 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import io, os
input = io.BytesIO(os.read(0,os.fstat(0).st_size)).readline

import math

def sieve(n):
    ass = []
    is_prime = [True]*(n+1)
    is_prime[0] = False
    is_prime[1] = False

    for i in range(2, int(math.sqrt(n))+1):
        if not is_prime[i]:
            continue
        for j in range(i*2, n+1, i):
            is_prime[j] = False
    for i in range(n+1):
        if is_prime[i]:
            ass.append(i)
    return(ass)

P = sieve(35)

t = int(input())
for _ in range(t):
    x = int(input())
    ans = -1
    for i in range(2, 32):
        cnt1 = [0]*len(P)
        cnt2 = [0]*len(P)
        y = x
        z = i*x
        for j, p in enumerate(P):
            while y%p == 0:
                cnt1[j] += 1
                y //= p
            while z%p == 0:
                cnt2[j] += 1
                z //= p
        c1 = 1
        for c in cnt1:
            c1 *= (c+1)
        c2 = 1
        for c in cnt2:
            c2 *= (c+1)
        if c2%c1 == 0 and c2//c1 == 2:
            ans = i*x
            break
    print(ans)
0