結果

問題 No.300 平方数
ユーザー lllllll88938494
提出日時 2023-04-27 09:44:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 62 ms / 1,000 ms
コード長 278 bytes
コンパイル時間 335 ms
コンパイル使用メモリ 81,792 KB
実行使用メモリ 59,264 KB
最終ジャッジ日時 2024-11-16 17:57:48
合計ジャッジ時間 4,077 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 43
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
x=int(input())
t=x
dic=defaultdict(int)
for i in range(2,int(x**0.5) + 1):
    while t%i == 0:
        dic[i] += 1
        t//=i

if t != 1:
    dic[t] += 1

ans = 1
for i,j in dic.items():
    if j%2!=0:
        ans *= i

print(ans)
        
0