随笔分类 - 贪心
摘要:区间合并 学习资料: 1.A21 排序 区间合并 无哨兵模板,pair存区间(推荐) void merge(vector<PII>& segs) { sort(segs.begin(), segs.end()); vector<PII> res; int st = segs[0].first, ed
阅读全文
摘要:122. 糖果传递 写法一: #include <iostream> #include <algorithm> #include <cstring> using namespace std; typedef long long LL; const int N = 1e6 + 10; int n; L
阅读全文