結果
| 問題 | No.3692 Calculate Mu |
| コンテスト | |
| ユーザー |
detteiuu
|
| 提出日時 | 2026-09-06 21:48:20 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 69 ms / 2,000 ms |
| + 398µs | |
| コード長 | 532 bytes |
| 記録 | |
| コンパイル時間 | 240 ms |
| コンパイル使用メモリ | 96,084 KB |
| 実行使用メモリ | 83,072 KB |
| 最終ジャッジ日時 | 2026-09-06 21:48:26 |
| 合計ジャッジ時間 | 2,410 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 12 |
ソースコード
from math import isqrt
def factorization(n):
arr = []
temp = n
for i in range(2, isqrt(n)+1):
if temp%i == 0:
cnt = 0
while temp%i == 0:
cnt += 1
temp //= i
arr.append([i, cnt])
if temp != 1:
arr.append([temp, 1])
if arr == []:
arr.append([n, 1])
return arr
N = int(input())
if N == 1:
exit(print(1))
fact = factorization(N)
ans = 1
for n, c in fact:
ans *= -1
if 2 <= c:
ans *= 0
print(ans)
detteiuu