夏夜、

心若平似镜、何题不AC。

2014年4月7日

POJ 1017 Packets 贪心 模拟

摘要: 一步一步模拟,做这种题好累先放大的的,然后记录剩下的空位有多少,塞1*1和2*2的进去//#pragma comment(linker, "/STACK:1024000000,1024000000")#include#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;typedef long long ll;typedef unsigned long long ull;typede 阅读全文

posted @ 2014-04-07 19:54 BMan、 阅读(142) 评论(0) 推荐(0) 编辑

POJ 2394 Yogurt factory 贪心

摘要: 维护前i个星期是哪个的花费最少(包括储存的费用) minv=min(minv,C_i)//#pragma comment(linker, "/STACK:1024000000,1024000000")#include#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;typedef long long ll;typedef unsigned long long ull;typede 阅读全文

posted @ 2014-04-07 17:15 BMan、 阅读(175) 评论(0) 推荐(0) 编辑

POJ 1328 Radar Installation 贪心

摘要: 把每个点转成区间,排序,首先考虑最左边的区间[l1,r1],要覆盖住这个点则需要在这个区间里的某个位置x放一个雷达,显然尽量放在靠右端是最好的,因为可以同时被右边的其他区间覆盖,但是要被右边的区间[l2,r2]覆盖还需满足l2#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;typedef long long ll;typedef unsigned long long ull;typedef pai 阅读全文

posted @ 2014-04-07 13:23 BMan、 阅读(128) 评论(0) 推荐(0) 编辑

POJ 2376 Cleaning Shifts 贪心

摘要: 从左到右,如果需要覆盖当前点x那么就要选一个[l,r]满足l#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;typedef long long ll;typedef unsigned long long ull;typedef pair pii;#define pb(a) push(a)#define INF 0x1f1f1f1f#define lson idx T min(const T& 阅读全文

posted @ 2014-04-07 12:12 BMan、 阅读(135) 评论(0) 推荐(0) 编辑

2014浙大校赛

摘要: ZOJ 3767 Elevator求和,签到题//#pragma comment(linker, "/STACK:1024000000,1024000000")#include#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;typedef long long ll;typedef unsigned long long ull;typedef pair pii;#define p 阅读全文

posted @ 2014-04-07 10:51 BMan、 阅读(292) 评论(0) 推荐(0) 编辑

导航