結果

問題 No.537 ユーザーID
ユーザー GrayCoderGrayCoder
提出日時 2017-06-30 23:54:18
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 550 bytes
コンパイル時間 159 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-10-04 21:53:29
合計ジャッジ時間 2,127 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 5 WA * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    N = int(input())

    if N == 1:
        print(1)
        return

    n = set(primefactor(N))
    x = set()
    for i in n:
        j = N // i
        x.add((min(i, j), max(i, j)))

    ans = 0
    for i in x:
        if i[0] == i[1]:
            ans += 1
        else:
            ans += 2

    print(ans + 2)

def primefactor(n):
    i = 2
    ret = []
    while i ** 2 <= n:
        if n % i:
            i += 1
        else:
            n //= i
            ret.append(i)
    if n > 1:
        ret.append(n)
    return ret

main()
0