結果

問題 No.1063 ルートの計算 / Sqrt Calculation
ユーザー Alex WiceAlex Wice
提出日時 2020-05-29 21:22:03
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 86 ms / 2,000 ms
コード長 579 bytes
コンパイル時間 381 ms
コンパイル使用メモリ 76,928 KB
実行使用メモリ 76,544 KB
最終ジャッジ日時 2024-04-23 19:50:43
合計ジャッジ時間 2,410 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
75,392 KB
testcase_01 AC 78 ms
75,136 KB
testcase_02 AC 78 ms
75,520 KB
testcase_03 AC 86 ms
75,392 KB
testcase_04 AC 79 ms
75,392 KB
testcase_05 AC 77 ms
75,520 KB
testcase_06 AC 79 ms
75,648 KB
testcase_07 AC 80 ms
76,544 KB
testcase_08 AC 80 ms
75,648 KB
testcase_09 AC 82 ms
76,160 KB
testcase_10 AC 79 ms
75,264 KB
testcase_11 AC 80 ms
75,136 KB
testcase_12 AC 86 ms
76,288 KB
testcase_13 AC 80 ms
75,392 KB
testcase_14 AC 78 ms
75,520 KB
testcase_15 AC 81 ms
75,136 KB
testcase_16 AC 78 ms
75,520 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

FAST_IO = 0
if FAST_IO:
    import io, sys, atexit
    rr = iter(sys.stdin.read().splitlines()).next
    sys.stdout = _OUTPUT_BUFFER = io.BytesIO()
    @atexit.register
    def write():
        sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())
else:
    rr = raw_input
rri = lambda: int(rr())
rrm = lambda: map(int, rr().split())

####

N = rri()

ans = 1
bns = 1

d=2
while d * d <= N:
    e = 0
    while N%d == 0:
        N //= d
        e += 1
    if e:
        q,r = e//2, e%2
        ans *= (d)**q
        bns *= d**r
    d += 1 + (d&1)

if N > 1:
    bns *= N
print ans,bns
0