結果
| 問題 |
No.300 平方数
|
| コンテスト | |
| ユーザー |
kichirb3
|
| 提出日時 | 2018-03-24 23:37:40 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 649 bytes |
| コンパイル時間 | 143 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-06-25 03:19:00 |
| 合計ジャッジ時間 | 5,195 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 WA * 26 |
ソースコード
# -*- coding: utf-8 -*-
"""
No.300 平方数
https://yukicoder.me/problems/no/300
"""
import sys
from sys import stdin
from collections import Counter
input = stdin.readline
def calc_divisors(N):
divisors = []
for i in range(2, int(N**0.5)+1):
while N % i == 0:
divisors.append(i)
N //= i
return divisors
def solve(X):
divisors = calc_divisors(X)
ans = 1
for v, fre in Counter(divisors).most_common():
if fre % 2 == 1:
ans *= v
return ans
def main(args):
X = int(input())
ans = solve(X)
print(ans)
if __name__ == '__main__':
main(sys.argv[1:])
kichirb3