Tag: dynamic programming

动态规划问题 – Fibonacci序列

我正在阅读这篇维基百科的文章,并试图在C中实现一个基于’map’的解决方案,其中’map’只是一个int数组,初始化为0。 由于某种原因,它可以达到fib(93) ,然后开始输出奇怪的数字。 如果重要的是我指定-std=c99 : #include #include // represents a fib num typedef unsigned long long fib_t; // the default value of our ‘map’ const int FIB_NULL = 0; // could get from input, set here for now const int FIB_MAX = 100; // our ‘map’ for fib nums static fib_t *fibMap; // calculate the […]