原文链接http://www.cnblogs.com/zhouzhendong/p/8990592.html 题目传送门 - CodeForces 516A 题意 对于一个正整数$x$,$f(x)=x$各个数位的阶乘之积. 给定一个数$a$,满足$f(a)>1$,求一个最大的不含有$0$或者$1$的$x$满足$f(x)=f(a)$. $a<10^{16}$ 题解 我们将$f(a)$分解质因数并统计各个质因数个数作为状态. 首先考虑到每一个数位都是$2$~$9$的,质因数只可能有$4$种. 而且…
C. Drazil and Factorial time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Drazil is playing a math game with Varda. Let's define for positive integer x as a product of factorials of its digi…
题目链接:http://codeforces.com/problemset/problem/515/C 题目意思:给出含有 n 个只有阿拉伯数字的字符串a(可能会有前导0),设定函数F(a) = 每个数字的阶乘乘积.例如 F(135) = 1! * 3! * 5! .需要找出 x,使得F(x) = F(a),且组成 x 的数字中没有0和1.求最大的 x 为多少. 这个我是看了每个数字的转换才知道怎么做的. 0, 1     —— >  empty(用空串表示) 2         —— > …
题意:给出含有 n 个只有阿拉伯数字的字符串a,设定函数F(a) = 每个数字的阶乘乘积 .需要找出 x,使得F(x) = F(a),且组成 x 的数字中没有0和1.求最大的 x 为多少. 析:最大,那么首先是位数最多,然后是前面尽量大,所以我们要让位数最大,那么就转化,2-2, 3-3, 4-322, 5-5, 6-53, 7-7, 8-7222, 9-733. 然后排序就好了. 代码如下: #pragma comment(linker, "/STACK:1024000000,10240000…
[codeforces 516]A. Drazil and Factorial 试题描述 Drazil is playing a math game with Varda. Let's define  for positive integer x as a product of factorials of its digits. For example, . First, they choose a decimal number a consisting of n digits that con…
A. Drazil and Factorial 题目连接: http://codeforces.com/contest/516/problem/A Description Drazil is playing a math game with Varda. Let's define for positive integer x as a product of factorials of its digits. For example, . First, they choose a decimal…
题目链接: C. Drazil and Factorial time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Drazil is playing a math game with Varda. Let's define  for positive integer x as a product of factorials of i…
C. Drazil and Factorial time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Drazil is playing a math game with Varda. Let's define  for positive integer x as a product of factorials of its dig…
Drazil and Factorial time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Drazil is playing a math game with Varda. Let's define  for positive integer x as a product of factorials of its digits…
题目链接:http://codeforces.com/contest/515/problem/C 给出一个公式例如:F(135) = 1! * 3! * 5!; 现在给你一个有n位的数字a,让你求这样一个x,满足x中没有0和1,F(a) = F(x),然后就是x要最大. 当x的位数比a多或者从高位开始x的数某一位要大于a的某一位,然后第二种显然是不可能的,所以我们寻找如何把a变长的方法. 例如数字 4! = 1 * 2 * 3 * 4 =3! * 2 * 2 =3! * 2! * 2! 所以当a…