![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
贪心
qq_41854014
这个作者很懒,什么都没留下…
展开
-
Cleaning Shifts POJ - 2376
贪心策略:从左往右选择,选择区间长的。按时间起点排序,每次更新起点begin = end + 1;选择剩下区间中可覆盖begin的最远end。#include<bits/stdc++.h>#include<iostream>#include<cstring>#include<cstdio>#include<cmath>#include<algorithm>using namespace std;typedef l原创 2020-10-19 22:05:37 · 78 阅读 · 0 评论 -
NC53681 「土」巨石滚滚
贪心策略:1.若b>=a,则a小的放在前面,减少丧失的稳定性,以防下一个a过大.2.若b<a,则b大的放在前面.#include<bits/stdc++.h>using namespace std;typedef long long ll;const int maxn = 5e5+5;inline ll read(){ ll s = 0, w = 1; char ch = getchar(); while (ch < 48 || ch原创 2020-06-16 11:35:03 · 106 阅读 · 0 评论