結果
問題 | No.1063 ルートの計算 / Sqrt Calculation |
ユーザー |
![]() |
提出日時 | 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 sysinput = sys.stdin.readlineimport collections#from bisect import *def linput(_t=int): return list(map(_t, input().split()))def gcd(n,m):while m: n,m = m, n%mreturn ndef lcm(n,m): return n*m//gcd(n,m)def prime_factorize(n):r = []rapp = r.appendwhile n%2<1: rapp(2); n//=2f = 3while f*f<=n:if n%f<1: rapp(f); n//=felse: f+=2if n != 1: rapp(n)return rdef main():N = int(input())#N,P,C,M = linput()#res = 0cc = collections.Counter(prime_factorize(N))res = 1for p,c in cc.items():res *= p**(c//2)print(res, N//(res**2))#print("{:.5f}".format(res/R))main()