結果
問題 | No.300 平方数 |
ユーザー |
|
提出日時 | 2015-11-17 22:35:45 |
言語 | Python2 (2.7.18) |
結果 |
AC
|
実行時間 | 124 ms / 1,000 ms |
コード長 | 414 bytes |
コンパイル時間 | 452 ms |
コンパイル使用メモリ | 6,912 KB |
実行使用メモリ | 6,912 KB |
最終ジャッジ日時 | 2024-09-13 16:54:05 |
合計ジャッジ時間 | 2,868 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 43 |
ソースコード
#!/usr/bin/pythonfrom collections import defaultdictfrom operator import muldef factorize(n):res = defaultdict(int)d = 2while d * d <= n:while n % d == 0:res[d] += 1n /= dd += 1if n > 1:res[n] += 1return resx = int(raw_input())filtered = [k for k, v in factorize(x).items() if v & 1] or [1]res = reduce(mul, filtered)print res