贪心
沙茶
这个作者很懒,什么都没留下…
展开
-
[Usaco09Dec] Selfish Grazing
题解:经典贪心#include <iostream> #include <cstdio> #include <algorithm> using namespace std; int n,now,tot; struct cow{ int s,e; }a[50005]; bool cmp(cow a,cow b){ return a.e<b.e; } int main() { c原创 2016-10-17 20:53:08 · 255 阅读 · 0 评论 -
[BZOJ1629&&Usaco07Demo] Cow Acrobats
题解:贪心出奇迹#include <iostream> #include <cstdio> #include <climits> #include <algorithm> using namespace std; #define INF INT_MAX int n,tot=-INF,sum; struct cow{ int w,p; }c[50005]; bool cmp(cow a,cow原创 2016-10-02 11:04:29 · 209 阅读 · 0 评论 -
[Usaco09Open] Work Scheduling
题目链接题解:贪心干所有能干的,超时间后取消最小的#include <iostream> #include <cstdio> #include <queue> #include <algorithm> using namespace std; int now,n; long long s; priority_queue <int> q; struct cow{ int s,v; }c[100原创 2016-09-30 20:17:27 · 381 阅读 · 0 评论