i have some questions

Revision en2, by Yasuho_Hirose, 2022-08-24 08:33:22

i'm doing this question: The equation x1 + x2 + ... + xk = n, where x1, x2, x3, ..., xk are positive integer variables satisfying the constraint: xi > = ci > 0. Given n, k,c1 ,c2 ,,…,ck, count the number of ways satisfy modulo MOD. ie: x1+x2+x3=7, c1=1, c2=2, c3=3, MOD=100, number of ways is 3. It's a normal question, i now it's is f(n-(k-sum_of_all(c))-1,n-1)%MOD but modular inverse (O(nlogn) solution) only satify when MOD is a prime number. And another O(n^2) solutions can't pass the time limit. Please give me hints or somethings, thank you senpai <3.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English Yasuho_Hirose 2022-08-24 08:33:22 1
en1 English Yasuho_Hirose 2022-08-24 08:27:34 583 Initial revision (published)