Revizia anterioară Revizia următoare
Fişierul intrare/ieşire: | wordle.in, wordle.out | Sursă | IIOT 2021-22 Runda 4 |
Autor | Giorgio Audrito | Adăugată de | |
Timp execuţie pe test | 0.25 sec | Limită de memorie | 65536 kbytes |
Scorul tău | N/A | Dificultate | N/A |
Vezi solutiile trimise | Statistici
Wordle
The new, popular word game Wordle spreads so fast that its contagiousness has reached Luca.
For those of you who have not yet heard about it, in Wordle you have to guess a 5-letter word in a limited number of attempts. After each attempt you get to know, for each position, whether your guess had the right letter in the right position, a letter present in the word but not in the right position, or a completely wrong letter.
Intrigued by the characteristics of the word game, Luca has decided to create his own more generic version. In this version, one needs to guess an N-letter word. Every possible sequence of letters of the English alphabet constitutes a potentially valid guess, but it is guaranteed that the word to guess does not contain the same letter twice.
You are in the middle of a game: you already guessed some letters but you still have to figure out some of them, which are indicated in the input with an underscore (_). You wonder: how many words could be a valid solution for the game, given the letters you know?
Date de intrare
The first line of the input file wordle.in contains the only integer N. The second line contains N letters L[i]: either an uppercase letter of the English alphabet or an underscore.
Date de ieşire
The output file wordle.out contains a single line with an integer: the number of possible solutions.
Restricţii
- 3 ≤ N ≤ 6
- For tests worth 10 points, N = 6 and the number of missing letters is always 1.
- For tests worth 20 more points, the number of missing letters is always 1.
- For tests worth 30 more points, the number of missing letters is always 1 or 2.
Exemplu
wordle.in | wordle.out |
---|---|
5 H O U S _ | 22 |
wordle.in | wordle.out |
---|---|
3 A _ _ | 600 |