092. The Telephone Call

Codeforces
IDCF10269092
Time1000ms
Memory256MB
Difficulty
English · Original
Formal · Original
The Telephone Call You want to call Lockheed Martin to register your team for CodeQuest 2021, but you don't know their phone number. However, you know some of the digits of the phone number. You're going to try to call all possible phone numbers, given the digits that you know, and you want to know how many numbers you're going to have to call. For this problem, assume that all area codes are valid. The only line of input contains a string of length 10, with each position in the string containing a digit from 0-9, if you know the digit at that position in the phone number, and an "x" if you don't know the digit. Output a single positive integer $n$: how many possible phone numbers there are, given that you already know the digits listed in the input. Note that the answer does not necessarily fit inside of a 32-bit integer type, in tests like the third example. The answer will fit inside of a "long" in Java. (You don't need to worry about this in Python) ## Input The only line of input contains a string of length 10, with each position in the string containing a digit from 0-9, if you know the digit at that position in the phone number, and an "x" if you don't know the digit. ## Output Output a single positive integer $n$: how many possible phone numbers there are, given that you already know the digits listed in the input. [samples] ## Note Note that the answer does not necessarily fit inside of a 32-bit integer type, in tests like the third example. The answer will fit inside of a "long" in Java. (You don't need to worry about this in Python)
**Definitions** Let $ s \in \{0,1,\dots,9,x\}^{10} $ be the input string of length 10, where each character is either a digit (0–9) or 'x' (unknown). **Constraints** - Each position in $ s $ is independently either a known digit or 'x'. **Objective** Let $ k $ be the number of positions in $ s $ where $ s_i = \text{'x'} $. Compute the number of possible phone numbers: $$ n = 10^k $$
API Response (JSON)
{
  "problem": {
    "name": "092. The Telephone Call",
    "description": {
      "content": "The Telephone Call You want to call Lockheed Martin to register your team for CodeQuest 2021, but you don't know their phone number. However, you know some of the digits of the phone number. You're g",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10269092"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "The Telephone Call\n\nYou want to call Lockheed Martin to register your team for CodeQuest 2021, but you don't know their phone number. However, you know some of the digits of the phone number. You're g...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ s \\in \\{0,1,\\dots,9,x\\}^{10} $ be the input string of length 10, where each character is either a digit (0–9) or 'x' (unknown).\n\n**Constraints**  \n- Each position in $ s $ is i...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments