結果

問題 No.300 平方数
ユーザー akitsugu777
提出日時 2018-11-30 11:08:38
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 488 bytes
コンパイル時間 88 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 17,700 KB
最終ジャッジ日時 2024-06-26 23:08:55
合計ジャッジ時間 3,690 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17 TLE * 1 -- * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

x = int(input())

if x == 1:
    print(1)

else:
    d = {}
    s = 0
    while s == 0:
        for i in range(2, x+1):
            if x % i == 0:
                x = x// i
                if not i in d:
                    d[i] = 1
                else:
                    d[i] += 1
                if x == 1:
                    s = 1
                break
    
    keys = [k for k, v in d.items() if v % 2 != 0]
    
    ans = 1
    for i in keys:
        ans *= i
    
    print(ans)
0