摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1280STL很费内存,在九度上时就那样 1 #include <stdio.h> 2 #include <list> 3 #include <queue> 4 using namespace std; 5 int main() 6 { 7 int N,M; 8 int mat[3000]; 9 while(scanf("%d%d",&N,&M)!=EOF){10 int i,j;11 priority_queue<int> Q 阅读全文
posted @ 2011-11-29 20:59 linyvxiang 阅读(233) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2151 1 #include <stdio.h> 2 #include <string.h> 3 #include <stdlib.h> 4 int cost_mat[102][102]; 5 int N,P,M,T; 6 int main() 7 { 8 while(scanf("%d%d%d%d",&N,&P,&M,&T)!=EOF){ 9 int i,j;10 memset(cost_mat,0,sizeof(cos 阅读全文
posted @ 2011-11-29 20:32 linyvxiang 阅读(199) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2717基本BFS 1 #include <stdio.h> 2 #include <string.h> 3 #include <stdlib.h> 4 #include <queue> 5 using namespace std; 6 int N,K; 7 int degree[100002]; 8 queue<int> Q; 9 void bfs()10 {11 while(!Q.empty()){12 int cur=Q.front();13 Q 阅读全文
posted @ 2011-11-29 19:57 linyvxiang 阅读(160) 评论(0) 推荐(0) 编辑