A1093 | [COCI-2006_2007-contest6]#6 V
来源COCI
时间限制1s
内存限制128MB
通过 / 提交0/0
题目描述
Zvonko is playing with digits again, even though his mother has warned him that he is doing too much math and should go outside to play with his friends.
In his latest game, Zvonko looks for multiples of an integer X, composed only of certain digits. A multiple of X is any number divisible by X.
In order to ruin Zvonko's fun, his mother decided to get a program that solves the problem. Write a program that calculates how many multiples of X are between A and B (inclusive), such that, when written in decimal, they contain only certain allowed digits.
In his latest game, Zvonko looks for multiples of an integer X, composed only of certain digits. A multiple of X is any number divisible by X.
In order to ruin Zvonko's fun, his mother decided to get a program that solves the problem. Write a program that calculates how many multiples of X are between A and B (inclusive), such that, when written in decimal, they contain only certain allowed digits.
输入格式
The first line of input contains three integers X, A and B (1 ≤ X < 1011, 1 ≤ A ≤ B < 1011).
The second line contains the allowed digits. The digits will be given with no spaces, sorted in increasing order and without duplicates.
The second line contains the allowed digits. The digits will be given with no spaces, sorted in increasing order and without duplicates.
输出格式
Output the number of multiples Zvonko can make on a single line.
输入输出样例
输入 #1
2 1 20 0123456789
输出 #1
10
输入 #2
6 100 9294 23689
输出 #2
111
输入 #3
5 4395 9999999999 12346789
输出 #3
0
暂无题解
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted