|
|
back to boardcan everyone tell me a good method? Calculate amount of K-digits numbers with any possible sum of digits (S, S <= 9 * K) - A[K,S]. Amount of 2K-digits lucky tickets is equal to A[K,0] * A[K,0] + A[K,1] * A[K,1] + ... + A[K,9 * K] * A[K,9 * K]. If you can think a little then you can optimize this solution in 20 times and solve problem 1036 in 0.031 sec. |
|
|