雕刻时光

just do it……nothing impossible
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2012年2月8日

摘要: 区间覆盖最小代价由于N<=10000排序后想到N*N的遍历不断更新add[i](表示到i最小代价)里的值,使之最小View Code #include<stdio.h>#include<iostream>#include<algorithm>using namespace std;const int maxint=999999999;struct data{ int ll,rr,c;}s[10009];int add[10009];int cmp(data a,data b){ if(a.ll==b.ll) return a.rr<b.rr; e 阅读全文

posted @ 2012-02-08 16:52 huhuuu 阅读(333) 评论(0) 推荐(0) 编辑

摘要: DIJK水过View Code #include<stdio.h>#include<string.h>#include<stack>#include<iostream>using namespace std;int n,m;int map[1009][1009];int path[1009];int dis[1009];bool used[1009];const int maxint=999999999;void dijk(){ memset(path,-1,sizeof(path)); memset(used,0,sizeof(used)); 阅读全文

posted @ 2012-02-08 14:48 huhuuu 阅读(581) 评论(0) 推荐(0) 编辑