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

28372번 - DnD Dice 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB149736454.237%

문제

In Dungeons & Dragons (DnD) and many other role playing games, many actions are determined by dice rolls, and it is also quite common to use dice with different numbers of sides. The most common dice are those based on the five Platonic solids, the tetrahedron, cube, octahedron, dodecahedron and icosahedron, with 4ドル,ドル 6ドル,ドル 8ドル,ドル 12ドル$ and 20ドル$ sides, respectively. In DnD terminology, these dice are usually called d4, d6, d8, d12 and d20.

As a dungeon master, you are currently designing a campaign for your group of players. In the final battle of this campaign, the players need to roll a combination of multiple dice with varying numbers of sides, and the action of the enemy is determined by the sum of the numbers on the dice that were rolled. For balancing purposes, you want to sort these sums based on how likely they are to occur, so that you can assign appropriate events to each of them.

Given the number of dice of each type, and assuming the sides of each die are numbered from 1ドル$ to the number of sides, find all possible sums of dice rolls and output them sorted by non-increasing probability.

입력

The input consists of:

  • One line with five integers $t,ドル $c,ドル $o,ドル $d$ and $i,ドル (0ドル \le t, c, o, d, i \le 10$), giving the number of tetrahedra, cubes, octahedra, dodecahedra and icosahedra among the dice that are rolled. There is always at least one die, that is $t+c+o+d+i \ge 1$.

출력

Output all possible sums, ordered from most likely to least likely. If two sums occur with the same probability, then those sums may be printed in any relative order.

제한

예제 입력 1

1 1 1 0 0

예제 출력 1

11 10 9 12 8 13 14 7 15 6 5 16 17 4 18 3

예제 입력 2

2 0 0 1 0

예제 출력 2

9 14 12 11 10 13 15 8 16 7 6 17 5 18 4 19 3 20

예제 입력 3

0 0 0 0 1

예제 출력 3

10 3 9 8 14 13 11 7 6 12 20 4 15 5 16 1 2 19 17 18

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > German Collegiate Programming Contest > GCPC 2023 D번

  • 문제를 만든 사람: Paul Wild
(追記) (追記ここまで)

출처

대학교 대회

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

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