TCCC '25 April P1 - How Many Passwords?

View as PDF

Submit solution

Points: 5
Time limit: 3.0s
Memory limit: 64M

Author:
Problem type

John Doe wants to open his locker but has forgotten the combination. To regain access, he decides to use a brute-force approach. He vaguely remembers parts of the combination and has provided you with a list of length N (1\le N \le 50). The list contains numbers and dots ("."). Each dot represents a digit John doesn't remember, while each number reflects his confidence in that digit being part of the correct combination. ie. if a number in the password is 4, John is certain that the number is one of four numbers, meaning that a random guess of that number would have a 25% chance of being correct.

The numbers for each location in the password range from 1-10. You must take all of this into account and print the final total amount of passwords possible for John.

Output Specification

Output a single integer representing the amount of possible passwords possible.

Sample Input

1 . 4 7 . 5

Sample Output

14000

Comments

There are no comments at the moment.