結果

問題 No.2318 Phys Bone Maker
ユーザー cleanttedcleantted
提出日時 2023-02-26 03:35:28
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,888 bytes
コンパイル時間 156 ms
コンパイル使用メモリ 82,004 KB
実行使用メモリ 95,740 KB
最終ジャッジ日時 2023-10-18 16:58:46
合計ジャッジ時間 24,020 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 161 ms
91,096 KB
testcase_02 AC 2,159 ms
95,740 KB
testcase_03 AC 177 ms
91,724 KB
testcase_04 WA -
testcase_05 AC 182 ms
91,244 KB
testcase_06 WA -
testcase_07 AC 175 ms
91,736 KB
testcase_08 AC 186 ms
91,824 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 217 ms
91,840 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 194 ms
91,724 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 177 ms
91,636 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 194 ms
91,748 KB
testcase_27 AC 187 ms
91,244 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 163 ms
91,092 KB
testcase_34 AC 188 ms
91,744 KB
testcase_35 AC 367 ms
91,964 KB
testcase_36 AC 1,064 ms
93,132 KB
testcase_37 AC 1,051 ms
92,900 KB
testcase_38 AC 1,179 ms
93,356 KB
testcase_39 AC 1,558 ms
94,756 KB
testcase_40 AC 1,543 ms
94,108 KB
testcase_41 AC 1,800 ms
95,504 KB
testcase_42 AC 1,807 ms
94,976 KB
testcase_43 AC 215 ms
91,776 KB
testcase_44 AC 568 ms
92,208 KB
testcase_45 AC 531 ms
92,180 KB
testcase_46 AC 2,056 ms
95,680 KB
testcase_47 AC 190 ms
91,240 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from collections import deque, Counter
from math import gcd, log10, pi, sqrt, ceil
from bisect import bisect, bisect_left, bisect_right, insort
from typing import Iterable, TypeVar, Union, Tuple, Iterator, List
import copy
import heapq
import itertools
import math
import random
from fractions import Fraction
from functools import lru_cache, partial, cmp_to_key
import operator
input = sys.stdin.readline
sys.setrecursionlimit(10000000)
mod = 998244353
INF = 1 << 61
DIFF = 10 ** -9
DX = [1, 0, -1, 0, 1, 1, -1, -1]
DY = [0, 1, 0, -1, 1, -1, 1, -1]

def read_values(): return map(int, input().split())
def read_index(): return map(lambda x: int(x) - 1, input().split())
def read_list(): return list(read_values())
def read_lists(N): return [read_list() for _ in range(N)]


def prime_factors(n):
    P = []
    for m in range(2, int(n ** 0.5) + 1):
        if n % m:
            continue

        P.append(m)
        while n % m == 0:
            n //= m
    return P


def divisor(n):
    D = []
    for m in range(1, int(n ** 0.5) + 1):
        if n % m:
            continue
        D.append(m)
        if m * m != n:
            D.append(n // m)
    D.sort()
    return D


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

    P = prime_factors(N)
    D = divisor(N)

    dp = {d: 0 for d in D}
    dp[1] = 1
    for i, d1 in enumerate(D):
        for d2 in D[i+1:]:
            if d2 % d1:
                continue

            r = 1
            x1, x2 = d1, d2
            for p in P:
                k = 0
                while x1 % p == 0 and x2 % p == 0:
                    x1 //= p
                    x2 //= p
                    k += 1

                if x2 % p == 0:
                    continue

                r *= k + 1
                r %= mod
            dp[d2] += dp[d1] * r % mod
            dp[d2] %= mod
    
    print(dp[N])


if __name__ == "__main__":
    main()
0