#t479. 可重排列
可重排列
Permutations with Repetition
Problem Description
Place distinct balls into distinct boxes; boxes are allowed to be empty. How many ways are there to do this?
Input Format
One line: , separated by a single space.
Output Format
One line: an integer, the correct answer.
Sample Input
7 4
Sample Output
16384
Hint
📚 Topic tag: this problem belongs to the combinatorial counting topic. It is not a loop problem and is placed here as optional material. If you have just started learning loops, feel free to skip it and come back when you have spare time.
Hint: think of each ball independently choosing a box; use the multiplication principle.