結果

問題 No.1063 ルートの計算 / Sqrt Calculation
ユーザー akitsugu777akitsugu777
提出日時 2020-12-01 14:44:03
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 338 bytes
コンパイル時間 430 ms
コンパイル使用メモリ 10,484 KB
実行使用メモリ 7,996 KB
最終ジャッジ日時 2023-10-11 03:34:52
合計ジャッジ時間 2,125 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,824 KB
testcase_01 AC 16 ms
7,752 KB
testcase_02 AC 16 ms
7,936 KB
testcase_03 WA -
testcase_04 AC 17 ms
7,816 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 20 ms
7,960 KB
testcase_08 AC 17 ms
7,808 KB
testcase_09 AC 18 ms
7,904 KB
testcase_10 AC 19 ms
7,816 KB
testcase_11 AC 18 ms
7,872 KB
testcase_12 AC 19 ms
7,788 KB
testcase_13 AC 19 ms
7,828 KB
testcase_14 AC 19 ms
7,748 KB
testcase_15 AC 16 ms
7,788 KB
testcase_16 AC 18 ms
7,820 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
L = []

for i in range(2, int(N**0.5)+1):
    while N % i == 0:
        L += [i]
        N //= i
if N > 1:
    L += [N]

D = {}
for j in L:
    if not j in D:
        D[j] = 1
    else:
        D[j] += 1

x = 1
y = 1
for k, v in D.items():
    if v % 2 == 0:
        x *= k ** (v//2)
    else:
        y *= k

print(x, y)
0