随笔分类 -  贪心

摘要:区间合并 学习资料: 1.A21 排序 区间合并 无哨兵模板,pair存区间(推荐) void merge(vector<PII>& segs) { sort(segs.begin(), segs.end()); vector<PII> res; int st = segs[0].first, ed 阅读全文
posted @ 2025-02-13 16:56 Tshaxz 阅读(1) 评论(0) 推荐(0) 编辑
摘要:122. 糖果传递 写法一: #include <iostream> #include <algorithm> #include <cstring> using namespace std; typedef long long LL; const int N = 1e6 + 10; int n; L 阅读全文
posted @ 2022-05-10 13:45 Tshaxz 阅读(23) 评论(0) 推荐(0) 编辑

Language: HTML
点击右上角即可分享
微信分享提示