摘要: 017.记忆化递归 优化暴力递归 递归层数太深会超时+栈溢出 对策 记忆化递归 剪枝 int f(int x){ if(x==1||x==2)return 1; return f(x-1)+f(x-2); } 记忆化 int F[101]={-1}; int f(int x){ if(x==1||x==2)return 阅读全文
posted @ 2025-12-21 23:55 射杀百头 阅读(15) 评论(0) 推荐(0)