結果
| 問題 |
No.1063 ルートの計算 / Sqrt Calculation
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-05-29 23:55:35 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 513 bytes |
| コンパイル時間 | 190 ms |
| コンパイル使用メモリ | 82,600 KB |
| 実行使用メモリ | 66,828 KB |
| 最終ジャッジ日時 | 2024-11-06 09:13:10 |
| 合計ジャッジ時間 | 1,646 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 6 WA * 7 RE * 1 |
ソースコード
n = int(input())
# n = 12
n_org = n
def b(l):
if len(l) == 0:
return 1
ans = 1
for i in l:
ans *= i[0] ** i[1]
return ans
fac = []
i = 2
while True:
if i * i > n_org:
break
if n % i == 0:
ex = 0 # 指数
while n % i == 0:
ex += 1
n /= i
fac.append((i, ex))
i += 1
if n != 1:
fac.append((int(n), 1))
if fac[0][1] % 2 == 0:
print(int(fac[0][0] ** (fac[0][1] / 2)), b(fac[1:]))
else:
print(b(fac))