結果

問題 No.300 平方数
ユーザー c-yanc-yan
提出日時 2020-12-13 01:06:49
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 76 ms / 1,000 ms
コード長 567 bytes
コンパイル時間 398 ms
コンパイル使用メモリ 11,864 KB
実行使用メモリ 10,176 KB
最終ジャッジ日時 2023-10-20 02:53:29
合計ジャッジ時間 3,732 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,088 KB
testcase_01 AC 30 ms
10,088 KB
testcase_02 AC 30 ms
10,116 KB
testcase_03 AC 30 ms
10,088 KB
testcase_04 AC 31 ms
10,088 KB
testcase_05 AC 30 ms
10,176 KB
testcase_06 AC 30 ms
10,116 KB
testcase_07 AC 30 ms
10,176 KB
testcase_08 AC 30 ms
10,088 KB
testcase_09 AC 30 ms
10,116 KB
testcase_10 AC 29 ms
10,176 KB
testcase_11 AC 30 ms
10,176 KB
testcase_12 AC 33 ms
10,176 KB
testcase_13 AC 76 ms
10,176 KB
testcase_14 AC 30 ms
10,088 KB
testcase_15 AC 30 ms
10,176 KB
testcase_16 AC 30 ms
10,116 KB
testcase_17 AC 30 ms
10,176 KB
testcase_18 AC 30 ms
10,116 KB
testcase_19 AC 29 ms
10,176 KB
testcase_20 AC 37 ms
10,176 KB
testcase_21 AC 30 ms
10,176 KB
testcase_22 AC 31 ms
10,116 KB
testcase_23 AC 37 ms
10,176 KB
testcase_24 AC 43 ms
10,176 KB
testcase_25 AC 69 ms
10,176 KB
testcase_26 AC 42 ms
10,176 KB
testcase_27 AC 53 ms
10,176 KB
testcase_28 AC 68 ms
10,176 KB
testcase_29 AC 58 ms
10,116 KB
testcase_30 AC 59 ms
10,116 KB
testcase_31 AC 60 ms
10,116 KB
testcase_32 AC 57 ms
10,176 KB
testcase_33 AC 46 ms
10,116 KB
testcase_34 AC 72 ms
10,116 KB
testcase_35 AC 58 ms
10,176 KB
testcase_36 AC 53 ms
10,176 KB
testcase_37 AC 49 ms
10,176 KB
testcase_38 AC 32 ms
10,116 KB
testcase_39 AC 49 ms
10,176 KB
testcase_40 AC 48 ms
10,116 KB
testcase_41 AC 44 ms
10,176 KB
testcase_42 AC 31 ms
10,176 KB
testcase_43 AC 36 ms
10,116 KB
testcase_44 AC 48 ms
10,176 KB
testcase_45 AC 43 ms
10,176 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def prime_factorize(n):
    result = []
    if n % 2 == 0:
        t = 0
        while n % 2 == 0:
            n //= 2
            t += 1
        result.append((2, t))
    for i in range(3, int(n ** 0.5) + 1, 2):
        if n % i != 0:
            continue
        t = 0
        while n % i == 0:
            n //= i
            t += 1
        result.append((i, t))
        if n == 1:
            break
    if n != 1:
        result.append((n, 1))
    return result


X = int(input())

Y = 1
for p, e in prime_factorize(X):
    if e % 2 == 1:
        Y *= p
print(Y)
0