
贪心
文章平均质量分 55
Orion233
这个作者很懒,什么都没留下…
展开
-
贪心+优先队列(需优化) POJ2010
Moo University - Financial AidBessie noted that although humans have many universities they can attend, cows have none. To remedy this problem, she and her fellow cows formed a new university called Th原创 2017-04-02 16:29:01 · 389 阅读 · 0 评论 -
CCPC 2016-2017 Finals - B
B-WashMr.Panda is about to engage in his favourite activity doing laundry! He’s brought L indistinguishable loads of laundry to his local laundromat, which has N washing machines and M dryers.The ithit原创 2017-04-25 20:05:52 · 1108 阅读 · 0 评论 -
#2017 Multi-University Training Contest 2 1003
Maximum Sequence题意: 两个数列 {a_ i }, {b_ i},要求{a_ n+1 ~ a_ 2n}的最大和。a_ i 需要满足:从{b_ i}中取出一个数 b_ k(每个元素仅使用一次);使之满足。分析: 这道题可以看是做是一道 STL 的题目。使用 pair 建立 a_ i - i 与 i 的关系, 然后贪心取最小的 b_ i , 因为可以重复取{ a_ n}中的数,所以用优先原创 2017-07-28 20:33:52 · 274 阅读 · 0 评论 -
Codeforces Round#433 B. Maxim Buys an Apartment
B. Maxim Buys an Apartment 题目传送门写得一手毒代码,我看还能掉多少分。#include <bits/stdc++.h> #define INF 0x3f3f3f3f #define TEST cout<<"stop here"<<endl using namespace std; typedef long long ll; const ll mod = 1e9 + 7;原创 2017-09-07 18:36:08 · 256 阅读 · 0 评论 -
Codeforces Round#433 C Planning
C.Planning 题目传送门题意&分析: 机场有n架飞机,第 i 架起飞时间是 i ,现在机场前 k 单位时间不可以有飞机起飞,所以得推迟航班。第 i 架航班每延误 1 单位时间就要花费机场 ci 的费用,现在求最小的赔偿费用。这是一个优先队列+贪心的题目,对于前 k 架次的航班全部入队,因为他们肯定延误了,然后将剩下的航班依次加入队列(前面放走一架,后面就有一架飞机要延误,所以要加入队列原创 2017-09-07 19:54:34 · 332 阅读 · 0 评论