Tap here to switch tabs
Problem
Submissions

Problem: Number of Dice Rolls With Target Sum

Number of Dice Rolls With Target Sum asks you to count ways to roll a set of dice, each numbered from one through a maximum face value, so their values add up to a target, returning the result modulo a large prime.

Statement

You are given n dice, where each die has k faces numbered from 11 to k.

Return the total number of possible ways to roll the dice such that the sum of the face-up values equals target. Since the answer can be very large, return it modulo 109+710^9 + 7.

Constraints:

  • 1≤1 \leq n, k ≤30\leq 30

  • 1≤1 \leq target ≤1000\leq 1000

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Number of Dice Rolls With Target Sum

Number of Dice Rolls With Target Sum asks you to count ways to roll a set of dice, each numbered from one through a maximum face value, so their values add up to a target, returning the result modulo a large prime.

Statement

You are given n dice, where each die has k faces numbered from 11 to k.

Return the total number of possible ways to roll the dice such that the sum of the face-up values equals target. Since the answer can be very large, return it modulo 109+710^9 + 7.

Constraints:

  • 1≤1 \leq n, k ≤30\leq 30

  • 1≤1 \leq target ≤1000\leq 1000