D. Beautiful numbers Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/55/problem/D Description Volodya is an odd boy and his taste is strange as well. It seems to him that a positive integer number is beautiful if and only i…
题目链接:https://codeforces.com/contest/55/problem/D 题目大意:给你一段区间[l,r],要求这段区间中可以整除自己每一位(除0意外)上的数字的整数个数,例如15,因为15既可以整除1也可以整除5,所以15符合要求. (1 ≤ li ≤ ri ≤ 9 ·1018). Examples input Copy 11 9 output Copy 9 input Copy 112 15 output Copy 2 解题思路:很明显的数位dp,首先我们可以想一个数…
D. Beautiful numbers time limit per test 4 seconds memory limit per test 256 megabytes input standard input output standard output Volodya is an odd boy and his taste is strange as well. It seems to him that a positive integer number is beautiful if…
2018 ACM 国际大学生程序设计竞赛上海大都会赛重现赛 J Beautiful Numbers (数位DP) 链接:https://ac.nowcoder.com/acm/contest/163/J?&headNav=acm来源:牛客网 时间限制:C/C++ 8秒,其他语言16秒 空间限制:C/C++ 262144K,其他语言524288K 64bit IO Format: %lld 题目描述 NIBGNAUK is an odd boy and his taste is strange a…
Codeforces Beta Round #16 (Div. 2 Only) E. Fish 题目链接:## 点击打开链接 题意: 有 \(n\) 条鱼,每两条鱼相遇都会有其中一只吃掉对方,现在给你一个 \(n * n\)的矩阵,表示 \(i\) 吃掉 \(j\) 的概率,最后问你每条鱼存活的概率. 题解: 最多有 \(18\) 条鱼,吃掉的概率都不一样,可以用状态压缩,设\(dp[1<<n]\)种状态,最多有 \(1<<18\) 种状态. $ dp[i]$ 表示当前鱼的状态为…
题意:一个数能整除它所有的位上的数字(除了0),统计这样数的个数. 注意离散化,为了速度更快需存入数组查找. 不要每次memset,记录下已有的长度下符合条件的个数. 数位dp肯定是从高位到低位. 记录数字已经有多大,还有lcm,递归传下去. #include <iostream> #include <cstdio> #include <cmath> #include <algorithm> #include <vector> #include…
D. Beautiful numbers time limit per test 4 seconds memory limit per test 256 megabytes input standard input output standard output Volodya is an odd boy and his taste is strange as well. It seems to him that a positive integer number is beautiful if…
D. Magic Numbers 题目连接: http://www.codeforces.com/contest/628/problem/D Description Consider the decimal presentation of an integer. Let's call a number d-magic if digit d appears in decimal presentation of the number on even positions and nowhere els…
链接: https://vjudge.net/problem/CodeForces-55D 题意: Volodya is an odd boy and his taste is strange as well. It seems to him that a positive integer number is beautiful if and only if it is divisible by each of its nonzero digits. We will not argue with…
题目链接:https://vjudge.net/problem/CodeForces-55D D. Beautiful numbers time limit per test 4 seconds memory limit per test 256 megabytes input standard input output standard output Volodya is an odd boy and his taste is strange as well. It seems to him…