Tap here to switch tabs
Problem
Submissions

Problem: Dice Roll Simulation

med
30 min
Try to solve the Dice Roll Simulation problem.

Statement

A die simulator rolls a die with 66 faces, numbered from 11 to 66.

You are given an integer n and an integer array rollMax of length 66, where rollMax[i] specifies the maximum number of consecutive times the face i+1i + 1 can appear in any valid sequence of rolls.

Return the total number of distinct valid sequences of length n that can be generated. Since the answer may be very large, return it modulo 109+710^9 + 7.

Note: Two sequences are considered distinct if they differ at at least one position.

Constraints:

  • 1≤1 \leq n ≤5000\leq 5000

  • rollMax.length =6= 6

  • 1≤1 \leq rollMax[i] ≤15\leq 15

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Dice Roll Simulation

med
30 min
Try to solve the Dice Roll Simulation problem.

Statement

A die simulator rolls a die with 66 faces, numbered from 11 to 66.

You are given an integer n and an integer array rollMax of length 66, where rollMax[i] specifies the maximum number of consecutive times the face i+1i + 1 can appear in any valid sequence of rolls.

Return the total number of distinct valid sequences of length n that can be generated. Since the answer may be very large, return it modulo 109+710^9 + 7.

Note: Two sequences are considered distinct if they differ at at least one position.

Constraints:

  • 1≤1 \leq n ≤5000\leq 5000

  • rollMax.length =6= 6

  • 1≤1 \leq rollMax[i] ≤15\leq 15