結果
| 問題 | No.537 ユーザーID | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2022-10-24 18:43:23 | 
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 785 bytes | 
| コンパイル時間 | 75 ms | 
| コンパイル使用メモリ | 12,544 KB | 
| 実行使用メモリ | 10,880 KB | 
| 最終ジャッジ日時 | 2024-07-02 21:50:27 | 
| 合計ジャッジ時間 | 2,317 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 18 WA * 13 RE * 1 | 
ソースコード
from functools import reduce
from itertools import accumulate, count
from operator import mul
def calc_positive_divisors(num: int) -> dict[int, int]:
    if num < 2:
        raise ValueError
    divisors = {}
    for divisor in count(2):
        if divisor ** 2 > num:
            if num != 1:
                divisors[num] = 1
            break
        while num % divisor == 0 and num != 1:
            try:
                divisors[divisor] += 1
            except KeyError:
                divisors[divisor] = 1
            num //= divisor
    return divisors
def main():
    N = int(input())
    divisors = calc_positive_divisors(N)
    divisors_num = reduce(mul, map(lambda num: num + 1, divisors.values()))
    print(divisors_num)
if __name__ == "__main__":
    main()
            
            
            
        