結果
問題 | No.1063 ルートの計算 / Sqrt Calculation |
ユーザー | kit84 |
提出日時 | 2020-05-29 21:48:22 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 34 ms / 2,000 ms |
コード長 | 632 bytes |
コンパイル時間 | 134 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-11-06 03:36:51 |
合計ジャッジ時間 | 1,407 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 14 |
ソースコード
import sys input = sys.stdin.readline import collections #from bisect import * def linput(_t=int): return list(map(_t, input().split())) def gcd(n,m): while m: n,m = m, n%m return n def lcm(n,m): return n*m//gcd(n,m) def prime_factorize(n): r = [] rapp = r.append while n%2<1: rapp(2); n//=2 f = 3 while f*f<=n: if n%f<1: rapp(f); n//=f else: f+=2 if n != 1: rapp(n) return r def main(): N = int(input()) #N,P,C,M = linput() #res = 0 cc = collections.Counter(prime_factorize(N)) res = 1 for p,c in cc.items(): res *= p**(c//2) print(res, N//(res**2)) #print("{:.5f}".format(res/R)) main()