#abc201c. C - Secret Number

C - Secret Number

Score : 300300 points

问题描述

高桥忘记了他四位数的 PIN 码。该 PIN 码由 0, 1, \ldots, 9 组成,且可能以 0 开头。

对于数字 09,高桥记住了以下事实,用一个包含 1010 个字符的字符串 S0S1S9S_0S_1 \ldots S_9 表示:

  • 如果 SiS_io:他确定 PIN 码中包含数字 ii
  • 如果 SiS_ix:他确定 PIN 码中不包含数字 ii
  • 如果 SiS_i?:他不确定 PIN 码中是否包含数字 ii

有多少个字符串可能是高桥的 PIN 码?

以上为通义千问 qwen-max 翻译,仅供参考。

Problem Statement

Takahashi has forgotten his PIN. The PIN is a four-digit string consisting of 0, 1, \ldots, 9, and may begin with a 0.

For each digit 0 through 9, Takahashi remembers the following fact, represented by a 1010-character string S0S1S9S_0S_1 \ldots S_9:

  • if SiS_i is o: he is certain that the PIN contained the digit ii;
  • if SiS_i is x: he is certain that the PIN did not contain the digit ii;
  • if SiS_i is ?: he is not sure whether the PIN contained the digit ii.

How many strings are there that could be Takahashi's PIN?

Constraints

  • SS is a 1010-character string consisting of o, x, and ?.

Input

Input is given from Standard Input in the following format:

SS

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 00.

Sample Input 3

xxxxx?xxxo

Sample Output 3

15

update @ 2024/3/10 09:12:57