結果
| 問題 | No.1063 ルートの計算 / Sqrt Calculation |
| コンテスト | |
| ユーザー |
wolgnik
|
| 提出日時 | 2020-05-29 21:26:01 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 28 ms / 2,000 ms |
| + 827µs | |
| コード長 | 333 bytes |
| 記録 | |
| コンパイル時間 | 110 ms |
| コンパイル使用メモリ | 81,212 KB |
| 実行使用メモリ | 63,756 KB |
| 最終ジャッジ日時 | 2026-10-12 07:39:20 |
| 合計ジャッジ時間 | 1,742 ms |
|
ジャッジサーバーID (参考情報) |
judge4_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 16 |
ソースコード
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