📅  最后修改于: 2022-03-11 14:52:13.414000             🧑  作者: Mango
private static Map map = new HashMap<>();
public static void main(String[] argh){
}
public static dynamicFib(int n){
if(map.contain(n))
return map.get(n);
if(n == 0) return 0;
if(n == 1) return 1;
int ans = dynamicFib(n-1) + dynamicFiv(n-2);
map.put(n, ans);
return ans;
}