2015-2016 ACM ICPC Baltic Selection Contest
K. Profact
time limit per test:1 second
memory limit per test:256 megabytes
Alice is bored out of her mind by her math classes. She craves for something much more exciting. That is why she invented a new type of numbers, theprofacts. Alice calls a positive integer number a profact if it can be expressed as a product of one or several factorials.
Just today Alice received n bills. She wonders whether the costs on the bills are profact numbers. But th

该博客介绍了ACM ICPC Baltic Selection Contest中的一个问题,即判断大整数是否能表示为一个或多个阶乘的乘积。博主通过DFS搜索并结合剪枝策略解决这个问题,考虑到19!超过10^18,预先计算了1到19的阶乘,并在搜索过程中处理素数阶乘的情况,以避免超时。
最低0.47元/天 解锁文章
983

被折叠的 条评论
为什么被折叠?



