Codeforces Edu Round 51 A-D】的更多相关文章

C. Pie or die Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/55/problem/C Description Volodya and Vlad play the following game. There are k pies at the cells of n  ×  m board. Each turn Volodya moves one pie to the neighbo…
B. Smallest number Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/55/problem/B Description Recently, Vladimir got bad mark in algebra again. To avoid such unpleasant events in future he decided to train his arithmetic skil…
A. Flea travel Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/55/problem/A Description A flea is sitting at one of the n hassocks, arranged in a circle, at the moment. After minute number k the flea jumps through k - 1hass…
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…
题意:一个数能整除它所有的位上的数字(除了0),统计这样数的个数. 注意离散化,为了速度更快需存入数组查找. 不要每次memset,记录下已有的长度下符合条件的个数. 数位dp肯定是从高位到低位. 记录数字已经有多大,还有lcm,递归传下去. #include <iostream> #include <cstdio> #include <cmath> #include <algorithm> #include <vector> #include…
A. Vasya And Password 模拟题,将所缺的种类依次填入"出现次数$ >1 $"的位置,替换掉Ta即可. #include <iostream> #include <cstdio> #include <cstring> using namespace std; const int N = 110; char str[N]; int sum[3][N], n; int inline get(char x){ if(x <=…
Codeforces Beta Round #80 (Div. 2 Only) A Blackjack1 题意 一共52张扑克,A代表1或者11,2-10表示自己的数字,其他都表示10 现在你已经有一个queen了,问你有多少种方案,能够得到n点 题解 其实只用考虑三种情况,都考虑一下就好了,实在不行就暴力枚举-- 代码 #include<bits/stdc++.h> using namespace std; int n; int main() { scanf("%d",&…
Codeforces Beta Round #62 A Irrational problem 题意 f(x) = x mod p1 mod p2 mod p3 mod p4 问你[a,b]中有多少个数满足f(x)=x 题解 显然直接带进去就好了-- 代码 #include<bits/stdc++.h> using namespace std; int main() { int p1,p2,p3,p4,a,b; scanf("%d%d%d%d%d%d",&p1,&am…