Code: Select all
4
5
6
7
6
6
7
Code: Select all
4
9
16
28
17
18
29
Moderator: Board moderators
Code: Select all
4
5
6
7
6
6
7
Code: Select all
4
9
16
28
17
18
29
YesCMG wrote:Did you get it accepted cause I found another similar problem. When I tested your code it gave the right output for 6, but when I tried 6 again it added one to the number like so:
The problem is also solvable by the simplest array:Monsoon wrote:you want to compute sth like this
T[n][k] = number of different numbers that can be written using exactly n matches, and if k==0 all this numbers has the most significant digit equal to 0. When k==1 is the other case.