ABC201C - Secret Number
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
Score : 300 points
Problem Statement
Takahashi has forgotten his PIN. The PIN is a four-digit string consisting of 0, 1, …, 9, and may begin with a 0.
For each digit 0 through 9, Takahashi remembers the following fact, represented by a 10-character string S0S1…S9:
- if Si is
o: he is certain that the PIN contained the digit i; - if Si is
x: he is certain that the PIN did not contain the digit i; - if Si is
?: he is not sure whether the PIN contained the digit i.
How many strings are there that could be Takahashi's PIN?
Constraints
- S is a 10-character string consisting of
o,x, and?.
Input
Input is given from Standard Input in the following format:
S
Output
Print the answer.
Sample Input 1
ooo???xxxx
Sample Output 1
108
Some of the possible PINs are 0123 and 0021.
Sample Input 2
o?oo?oxoxo
Sample Output 2
0
There may be no possible PINs, in which case the answer is 0.
Sample Input 3
xxxxx?xxxo
Sample Output 3
15
ABC201
- Status
- Done
- Rule
- IOI
- Problem
- 7
- Start at
- 2023-6-28 8:00
- End at
- 2023-6-28 10:00
- Duration
- 2 hour(s)
- Host
- Partic.
- 10