Logo
(追記) (追記ここまで)

31521번 - Four Die Rolls 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 (추가 시간 없음) 2048 MB1701158665.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.

제한

예제 입력 1

2
1 2

예제 출력 1

12 24

예제 입력 2

2
3 3

예제 출력 2

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번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /