CodeForces 515C. Drazil and Factorial】的更多相关文章

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…
原文链接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 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…
[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…
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(n)=n这个数各个位置上的数的阶乘的乘积; 给你a; 让你另外求一个不含0和1的最大的数字b; 使得f(a)==f(b) [题解] 对a的每一个大于1的数字进行分解; 看看它能够组合成的最多的比它小的数字的阶乘的乘积是哪些; 比如 4!=3!∗(2!)2 每个都找最多数目的:数目相同找大的数的组合; 求出2..9!的组合就好; 最后根据每个数字的分解方案; 求出所有的数字; 然…