Here is the problem
You are assigned the number 1 ≤ N ≤ 50. Each ticket has a 2-digit number. We call a ticket lucky if the sum of its first N digits is equal to the sum of its last N digits. You also get the sum of ALL digits in the number. Your task is to calculate the number of successful numbers that have the indicated sum of ALL digits.
For input 2 2 output 4 (0101, 0110, 1001, 1010)
Can you help me solve this problem? What is the minimum difficulty?
s, s/2. f(n, s/2): n- s/2. f(n, s/2), ( ).
s
s/2
f(n, s/2)
f(n, m): DP. , f(n, m) = f(n-1, m) + f(n-1, m-1) + f(n-1, m-2) + ... + f(n-1, m-9). 0, 1, 2, .. 9 - . k, (n-1) - m - k.
f(n, m)
f(n, m) = f(n-1, m) + f(n-1, m-1) + f(n-1, m-2) + ... + f(n-1, m-9)
0, 1, 2, .. 9
k
(n-1)
m - k
, .
PS - , .
Source: https://habr.com/ru/post/1783664/More articles:PIE.htc and jQuery conflict animation? - jqueryASP.NET login for subdomain from parent domain - authenticationMap interface from Java question - javaJquery functions each and attr - javascriptПроверьте, был ли элемент удален JQuery - jqueryIs there a php function like checkdate () in JavaScript? - javascriptWindows SQL Server Authentication Security - sql-serverDLL for a dynamic Java program? - javaSQL Server Authentication or Integrated Security? - sql-serverПочему "ActionListener" не является "ClickListener", - javaAll Articles