|
|
вернуться в форумПоказать все сообщения Спрятать все сообщенияIn: 2 4 Out: 9 In: 2 6 Out: 16 In: 2 8 Out: 25 In: 4 2 Out: 16 In: 4 4 Out:100 In: 4 6 Out: 400 In: 4 8 Out: 1225 :) As far as I guess, the right answer for WA3 is zero. And it comes up when, for instance, you have "N=2" and "S=38". Four bits cannot produce the sum more then thirty six, you know. My answers are same for all the test cases you have written here. My recursive formula is m[len][sum] = m[len-1][sum-k] for 0<=k<=9. Then why is it showing wrong anwser for test case 2. Edited by moderator 12.01.2022 16:54 answer is very big it cannot be stored in 64 bits , U need to find another way. |
|
|