Test instructions Specifies that M=1 is 2 for 1,m=3 when 0,m=2;
At this point we can think, if the number of steps is K, then how many kinds? At this time we can think of when the K is more than k-1 a step, K can be equal (this argument is inappropriate, understand the line is not equal to the same) K-1 number, because the last equivalent of k-1 on the basis of a further step.
As can be two steps at the same time, we also consider the k-2,k than k-2 more than 2 steps, K is equal to (on the same) K-2 number, because the last equivalent to the k-2 on the basis of two more steps.
So after the end M (k) =m (k-1) +m (k-2);
#include <stdio.h>int main () {int t,n,a[45];a[1]=0,a[2]=1,a[3]=2;for (int i=4;i<=40;i++) a[i]=a[i-1]+a[i-2]; scanf ("%d", &t), while (t--) {scanf ("%d", &n);p rintf ("%d\n", A[n]);} return 0;}
NYOJ76 Super Step Fibonacci number