308788: CF1575D. Divisible by Twenty-Five
Memory Limit:512 MB
Time Limit:2 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
Divisible by Twenty-Five
题意翻译
### 题意翻译 Chanek先生有一个数字字符串 $s (1\le\left\vert s \right\vert\le8)$,且该字符串只包含 $0$,$1$,$2$,$3$,$4$,$5$,$6$,$7$,$8$,$9$,$X$,$\_$ (下划线)。每个 $X$ 都表示相同的数字,每个 $\_$ 都表示任意一个数字。 他可以用任一数字替换掉所有的 $X$ ,也可以将 $\_$ 替换为任一数字。但是他要求该数字不能有任何前导 $0$($0$ 本身除外)。他想知道有多少钟替换方法可以使 $s$ 能被 $25$ 整除。 ### 输入格式 输入共一行,为字符串 $s$ 。 ### 输出格式 输出共一行,表示替换的方法总数。题目描述
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).输入输出格式
输入格式
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