Tap here to switch tabs
Problem
Submissions

Problem: Count Ways to Make Array With Product

med
30 min
Try to solve the Count Ways to Make Array With Product problem.

Statement

You are given a 22D integer array queries, where queries[i] = [n_i, k_i].

For each query, calculate the number of distinct arrays of positive integers of length nin_i such that the product of all elements equals kik_i.

Return an integer array ans of the same length as queries, where ans[i] is the answer to the query queries[i] modulo 109+710^9 + 7.

Constraints:

  • 1≤1 \leq queries.length ≤104\leq 10^4

  • 1≤ni,ki≤1041 \leq n_i, k_i \leq 10^4

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Count Ways to Make Array With Product

med
30 min
Try to solve the Count Ways to Make Array With Product problem.

Statement

You are given a 22D integer array queries, where queries[i] = [n_i, k_i].

For each query, calculate the number of distinct arrays of positive integers of length nin_i such that the product of all elements equals kik_i.

Return an integer array ans of the same length as queries, where ans[i] is the answer to the query queries[i] modulo 109+710^9 + 7.

Constraints:

  • 1≤1 \leq queries.length ≤104\leq 10^4

  • 1≤ni,ki≤1041 \leq n_i, k_i \leq 10^4