A14498 | Divisible by Twenty-Five
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
Mr. Chanek has an integer represented by a string $s$ . Zero or more digits have been erased and are denoted by the character \_. There are also zero or more digits marked by the character X, meaning they're the same digit.
Mr. Chanek wants to count the number of possible integer $s$ , where $s$ is divisible by $25$ . Of course, $s$ must not contain any leading zero. He can replace the character \_ with any digit. He can also replace the character X with any digit, but it must be the same for every character X.
As a note, a leading zero is any 0 digit that comes before the first nonzero digit in a number string in positional notation. For example, 0025 has two leading zeroes. An exception is the integer zero, (0 has no leading zero, but 0000 has three leading zeroes).
Mr. Chanek wants to count the number of possible integer $s$ , where $s$ is divisible by $25$ . Of course, $s$ must not contain any leading zero. He can replace the character \_ with any digit. He can also replace the character X with any digit, but it must be the same for every character X.
As a note, a leading zero is any 0 digit that comes before the first nonzero digit in a number string in positional notation. For example, 0025 has two leading zeroes. An exception is the integer zero, (0 has no leading zero, but 0000 has three leading zeroes).
输入格式
One line containing the string $s$ ( $1 \leq |s| \leq 8$ ). The string $s$ consists of the characters 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, \_, and X.
输出格式
Output an integer denoting the number of possible integer $s$ .
输入输出样例
输入 #1
25
输出 #1
1
输入 #2
_00
输出 #2
9
输入 #3
_XX
输出 #3
9
输入 #4
0
输出 #4
1
输入 #5
0_25
输出 #5
0
In the first example, the only possible $s$ is $25$ .
In the second and third example, $s \in \{100, 200,300,400,500,600,700,800,900\}$ .
In the fifth example, all possible $s$ will have at least one leading zero.
In the second and third example, $s \in \{100, 200,300,400,500,600,700,800,900\}$ .
In the fifth example, all possible $s$ will have at least one leading zero.
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted