結果
| 問題 | No.1063 ルートの計算 / Sqrt Calculation |
| コンテスト | |
| ユーザー |
wolgnik
|
| 提出日時 | 2020-05-29 21:26:01 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 44 ms / 2,000 ms |
| コード長 | 333 bytes |
| コンパイル時間 | 170 ms |
| コンパイル使用メモリ | 82,416 KB |
| 実行使用メモリ | 59,880 KB |
| 最終ジャッジ日時 | 2024-11-06 02:25:00 |
| 合計ジャッジ時間 | 1,598 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 14 |
ソースコード
import sys
from collections import Counter
input = sys.stdin.readline
N = int(input())
c = Counter()
x = 2
while x * x <= N:
while N % x == 0:
c[x] += 1
N //= x
x += 1
if x > 1: c[N] += 1
resa = 1
resb = 1
for x in c.keys():
if c[x] >= 2: resa *= x ** (c[x] // 2)
if c[x] % 2: resb *= x * (c[x] % 2)
print(resa, resb)
wolgnik