結果

問題 No.2318 Phys Bone Maker
ユーザー yupoohyupooh
提出日時 2023-05-26 22:16:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 904 ms / 3,000 ms
コード長 1,046 bytes
コンパイル時間 730 ms
コンパイル使用メモリ 87,300 KB
実行使用メモリ 79,268 KB
最終ジャッジ日時 2023-08-26 12:01:18
合計ジャッジ時間 13,061 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,640 KB
testcase_01 AC 77 ms
71,664 KB
testcase_02 AC 904 ms
79,268 KB
testcase_03 AC 97 ms
76,136 KB
testcase_04 AC 101 ms
76,024 KB
testcase_05 AC 99 ms
76,368 KB
testcase_06 AC 98 ms
76,172 KB
testcase_07 AC 94 ms
77,084 KB
testcase_08 AC 108 ms
76,660 KB
testcase_09 AC 96 ms
76,092 KB
testcase_10 AC 110 ms
76,184 KB
testcase_11 AC 102 ms
76,028 KB
testcase_12 AC 119 ms
76,944 KB
testcase_13 AC 124 ms
77,056 KB
testcase_14 AC 103 ms
76,196 KB
testcase_15 AC 99 ms
76,276 KB
testcase_16 AC 99 ms
76,184 KB
testcase_17 AC 109 ms
75,956 KB
testcase_18 AC 119 ms
77,068 KB
testcase_19 AC 91 ms
75,952 KB
testcase_20 AC 105 ms
76,012 KB
testcase_21 AC 97 ms
75,956 KB
testcase_22 AC 96 ms
75,888 KB
testcase_23 AC 97 ms
76,252 KB
testcase_24 AC 108 ms
76,352 KB
testcase_25 AC 101 ms
76,132 KB
testcase_26 AC 113 ms
76,784 KB
testcase_27 AC 107 ms
76,092 KB
testcase_28 AC 95 ms
76,124 KB
testcase_29 AC 95 ms
76,084 KB
testcase_30 AC 91 ms
76,256 KB
testcase_31 AC 111 ms
76,088 KB
testcase_32 AC 105 ms
76,184 KB
testcase_33 AC 78 ms
71,708 KB
testcase_34 AC 104 ms
76,176 KB
testcase_35 AC 205 ms
78,204 KB
testcase_36 AC 553 ms
79,036 KB
testcase_37 AC 482 ms
78,656 KB
testcase_38 AC 475 ms
78,332 KB
testcase_39 AC 684 ms
78,812 KB
testcase_40 AC 691 ms
79,100 KB
testcase_41 AC 872 ms
79,184 KB
testcase_42 AC 747 ms
78,992 KB
testcase_43 AC 128 ms
76,884 KB
testcase_44 AC 206 ms
77,740 KB
testcase_45 AC 212 ms
78,252 KB
testcase_46 AC 870 ms
78,584 KB
testcase_47 AC 112 ms
76,276 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
n=int(input())
mod=998244353
l=[]
sn=int(n**0.5)+5
for i in range(1,sn):
  if i*i>n:
    break
  if n%i==0:
    l.append(i)
    if n//i!=i:
      l.append(n//i)
l.sort()
dp=[1]*len(l)
import math
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+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
fac=factorization(n)
f=[]
for i,j in fac:
  f.append(i)
yaku=[[] for _ in range(len(l))]
for i in range(1,len(l)):
  now=l[i]
  for j in f:
    num=0
    while now%j==0:
      num+=1
      now//=j
    yaku[i].append(num)
for i in range(1,len(l)):
  for j in range(i+1,len(l)):
    if l[j]%l[i]==0:
      val=1
      for k in range(len(f)):
        if yaku[i][k]==yaku[j][k]:
          val*=(1+yaku[j][k])
      dp[j]+=(dp[i]*val)
      dp[j]%=mod
print(dp[-1])
0