| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 (추가 시간 없음) | 2048 MB | 170 | 115 | 86 | 65.649% |
Ashley and Brandon are playing a game where they roll a six-sided dice four times. Each integer from 1ドル$ to 6ドル$ is on one face of the dice and all values are equally likely to appear. Each time they roll the dice, they write down the value that shows on the top face of the dice, eventually forming a four-digit integer.
Ashley wins if all four digits in the integers are different. Otherwise, Brandon wins.
The dice has been rolled from 1ドル$ to 3ドル$ times so far. Compute the number of different ways to roll the remaining times such that Ashley wins, and the number of different ways to roll the remaining dice such that Brandon wins. Two ways are different if the integers formed are different - for example, rolling a 1ドル,ドル then a 2ドル,ドル then a 3ドル,ドル then a 4ドル$ forms the integer 1234ドル,ドル and is different from rolling a 1ドル,ドル then a 2ドル,ドル then a 4ドル,ドル then a 3ドル,ドル which would form the integer 1243ドル$.
The first line contains $n$ (1ドル \le n \le 3$), which is the number of times the dice have been rolled so far.
The next line contains $n$ integers ranging from 1ドル$ to 6ドル,ドル which are the first $n$ rolls of the dice in order.
Output two space-separated integers on one line, which are the number of ways to roll the remaining times such that Ashley wins, and the number of ways to roll the remaining dice such that Brandon wins.
2 1 2
12 24
2 3 3
0 36
ICPC > Regionals > North America > Pacific Northwest Regional > 2023 ICPC Pacific Northwest Region > Division 2 C번
ICPC > Regionals > North America > South Central USA Regional > 2023 South Central USA Regional Contest > Division 2 F번
ICPC > Regionals > North America > Mid-Atlantic Regional > 2023 Mid-Atlantic USA Regional Contest > Division 2 F번
ICPC > Regionals > North America > Southeast USA Regional > 2023 Southeast USA Regional Programming Contest > Division 2 F번