上一页 1 ··· 41 42 43 44 45 46 47 48 49 ··· 57 下一页

2014年5月30日

【HDOJ】1150 Machine Schedule

摘要: 匈牙利算法。 1 #include 2 #include 3 4 #define MAXNUM 1005 5 6 char map[MAXNUM][MAXNUM]; 7 char visit[MAXNUM]; 8 int son[MAXNUM]; 9 10 int find(int x, i... 阅读全文

posted @ 2014-05-30 14:47 Bombe 阅读(140) 评论(0) 推荐(0) 编辑

【HDOJ】1242 Rescue

摘要: BFS+优先级队列。 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 #define MAXNUM 205 8 9 typedef struct node_st {10 int x, y... 阅读全文

posted @ 2014-05-30 12:13 Bombe 阅读(219) 评论(0) 推荐(0) 编辑

【HDOJ】1166 敌兵布阵

摘要: 线段树。 1 #include 2 3 #define maxn 55555 4 5 int sums[maxn>1;18 build(l, m, rt>1;30 if (des =r)40 return sums[rt];41 42 m = (l+r)... 阅读全文

posted @ 2014-05-30 11:30 Bombe 阅读(178) 评论(0) 推荐(0) 编辑

2014年5月29日

【HDOJ】1180 诡异的楼梯

摘要: bfs+优先队列。wa了N次,才发现可以停留等待楼梯变换方向。 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 #define MAXNUM 55 8 9 typedef struct node... 阅读全文

posted @ 2014-05-29 18:03 Bombe 阅读(268) 评论(0) 推荐(0) 编辑

2014年5月28日

【HDOJ】3033 I love sneakers!

摘要: 分组背包。 1 #include 2 #include 3 4 #define mymax(a, b) (a>b) ? a:b 5 6 typedef struct { 7 int p, v; 8 } shoe_st; 9 10 shoe_st shoes[15][105];11 i... 阅读全文

posted @ 2014-05-28 17:16 Bombe 阅读(229) 评论(0) 推荐(0) 编辑

【HDOJ】3127 WHUgirls

摘要: 1 #include 2 #include 3 4 #define mymax(a, b) (a>b) ? a:b 5 6 typedef struct { 7 int x, y, c; 8 } rect_st; 9 10 rect_st rects[15];11 12 int d... 阅读全文

posted @ 2014-05-28 15:44 Bombe 阅读(149) 评论(0) 推荐(0) 编辑

【HDOJ】3496 Watch The Movie

摘要: 二维费用背包。 1 #include 2 #include 3 4 #define mymax(a, b) (a>b) ? a:b 5 6 int dp[105][1005]; 7 int time[105], val[105]; 8 9 int main() {10 int ca... 阅读全文

posted @ 2014-05-28 14:35 Bombe 阅读(173) 评论(0) 推荐(0) 编辑

【HDOJ】2851 Lode Runner

摘要: 开始没理解题意。原来destinations是指路的序号。而不是点。DP。 1 #include 2 #include 3 4 int dp[2005]; 5 6 typedef struct { 7 int s, e, w; 8 } road_st; 9 10 road_st ro... 阅读全文

posted @ 2014-05-28 11:30 Bombe 阅读(147) 评论(0) 推荐(0) 编辑

【HDOJ】3466 Proud Merchants

摘要: 先排序预处理,后01背包。 1 #include 2 #include 3 #include 4 5 #define MAX(a, b) (a>b) ? a:b 6 7 int dp[5000]; 8 9 typedef struct {10 int p, q, v;11 } s... 阅读全文

posted @ 2014-05-28 10:35 Bombe 阅读(173) 评论(0) 推荐(0) 编辑

【HDOJ】2955 Robberies

摘要: 01背包。将最大金额作为容量v。概率做乘法。 1 #include 2 #include 3 4 #define mymax(a, b) (a>b) ? a:b 5 6 float dp[10005]; 7 int mon[105]; 8 float fs[105]; 9 10 int ma... 阅读全文

posted @ 2014-05-28 10:11 Bombe 阅读(196) 评论(0) 推荐(0) 编辑

上一页 1 ··· 41 42 43 44 45 46 47 48 49 ··· 57 下一页

导航