結果

問題 No.2846 Birthday Cake
ユーザー 已经死了
提出日時 2025-06-18 23:39:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 953 ms / 2,000 ms
コード長 903 bytes
コンパイル時間 313 ms
コンパイル使用メモリ 82,672 KB
実行使用メモリ 86,044 KB
最終ジャッジ日時 2025-06-18 23:39:30
合計ジャッジ時間 20,907 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

diff #

import os,sys,random,threading
from random import randint
from types import GeneratorType
from functools import lru_cache
from bisect import bisect_left,bisect_right
from collections import Counter,defaultdict,deque
from itertools import accumulate,combinations,permutations
from heapq import  heapify,heappop,heappush
from typing import Generic,Iterable,Iterator,TypeVar,Union,List
from math import sqrt,log,log10,log2
from sys import stdin, stdout, setrecursionlimit
input = lambda: sys.stdin.readline().rstrip("\r\n")
MI = lambda :map(int,input().split())
li = lambda :list(MI())
ii = lambda :int(input())
inf=1<<60


#14进制

lcm=55440

k,n=li()

f=[0]*(lcm+1)
f[0]=1

for _ in range(k):
    g=[0]*(lcm+1)
    for i in range(lcm+1):
        for j in range(1,n+1):
            if lcm%j==0 and i+lcm//j<=lcm:
                g[i+lcm//j]+=f[i]
    f=g

res=f[lcm]

if lcm%k!=0:
    res+=1

print(res)
0