solution.cpp 254 字节
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
#include <stdio.h>
int main(void)
{
    int a[20190324];
    a[0] = 1;
    a[1] = 1;
    a[2] = 1;
    for (int i = 3; i < 20190324; i++)
    {
        a[i] = (a[i - 1] + a[i - 2] + a[i - 3]) % 10000;
    }
    printf("%d", a[20190323]);
    return 0;
}