摘要: 斐波那契数 class Solution { public: int fib(int n) { if(n == 0) return 0; if(n == 1) return 1; vector<int> dp(n + 1); dp[0] = 0; dp[1] = 1; for(int i = 2;i 阅读全文
posted @ 2025-02-15 22:44 skyler886 阅读(6) 评论(0) 推荐(0)
摘要: 合并区间 class Solution { public: vector<vector<int>> merge(vector<vector<int>>& intervals) { sort(intervals.begin(), intervals.end(), [](const vector<int 阅读全文
posted @ 2025-02-15 20:51 skyler886 阅读(8) 评论(0) 推荐(0)
摘要: 用最少数量的箭引爆气球 class Solution { public: int findMinArrowShots(vector<vector<int>>& points) { int answer = 1; sort(points.begin(), points.end(), [](vector 阅读全文
posted @ 2025-02-15 20:41 skyler886 阅读(6) 评论(0) 推荐(0)