| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 13 초 (추가 시간 없음) | 1024 MB | 7 | 6 | 6 | 100.000% |
The one-player game of Seven Up is played with a standard deck of 52 cards - each card has one of thirteen possible faces which we denote by A, 2, 3, 4, 5, 6, 7, 8, 9, T, J, Q, and K. There are exactly four cards of each face.
Initially, seven cards are dealt face down in positions numbered 1 through 7. The ace (A) has value $1$, the cards with faces 2--7 have corresponding values $2$ through $7$, and the remaining cards do not have any value.
A single turn consists of the player drawing a card from the top of the deck (initially having $52-7 = 45$ cards). The following steps are repeated until the turn is ended:
A, 2, 3, 4, 5, 6, or 7), the turn has ended,At the end of a turn, if all seven positions have a face-up card, the game ends.
If the remaining $45$ cards are randomly permuted so each ordering is equally likely, what is the expected number of turns until the game completes?
More specifically, if for any $1 \leq k \leq 45$ we let $p_k$ denote the probability (over the random ordering of the remaining $45$ cards) the game finishes after $k$ turns are completed. You should compute $\sum_{k = 1}^{45} k \cdot p_k$.
Input consists of a single string consisting of exactly 7 characters from A23456789TJQK denoting the faces of the 7 cards that were dealt face down into their corresponding positions. No face will appear more than four times in this string.
Output a single value giving the expected number of turns until the game completes. Your answer should have an absolute or relative error of less than $10^{-6}$.
A9Q22T5
19.88129713423831
JQQQKKK
20.91314505643106
ICPC > Regionals > North America > Rocky Mountain Regional > 2023 Rocky Mountain Regional Contest D번