結果

問題 No.1063 ルートの計算 / Sqrt Calculation
ユーザー kit84kit84
提出日時 2020-05-29 21:48:22
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 32 ms / 2,000 ms
コード長 632 bytes
コンパイル時間 90 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-04-23 21:17:19
合計ジャッジ時間 1,268 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,624 KB
testcase_01 AC 30 ms
10,624 KB
testcase_02 AC 32 ms
10,752 KB
testcase_03 AC 30 ms
10,624 KB
testcase_04 AC 31 ms
10,752 KB
testcase_05 AC 29 ms
10,496 KB
testcase_06 AC 30 ms
10,752 KB
testcase_07 AC 29 ms
10,496 KB
testcase_08 AC 30 ms
10,752 KB
testcase_09 AC 29 ms
10,624 KB
testcase_10 AC 27 ms
10,496 KB
testcase_11 AC 28 ms
10,496 KB
testcase_12 AC 28 ms
10,752 KB
testcase_13 AC 28 ms
10,752 KB
testcase_14 AC 28 ms
10,624 KB
testcase_15 AC 27 ms
10,624 KB
testcase_16 AC 28 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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()
0