
ZOJ
南宫嘉俊
学生
展开
-
ZOJ 1586 QS Network
//没啥好说的,一道水题而已,直接看代码: AC代码: #include #include #include using namespace std; #define N 1005 int p[N]; int a[N]; int n; int L; struct node { int w,v,c; }t[N*N]; int cmp(node p,node q) { retu原创 2015-08-29 09:35:36 · 326 阅读 · 0 评论 -
ZOJ 2165 Red and Black(DFS,水题)
#include #include #include using namespace std; const int maxm=50; char map[maxm][maxm]; int vis[maxm][maxm]; int m,n; int cnt; int dir[4][2]= {{1,0},{-1,0},{0,1},{0,-1}}; void dfs(int x,int y) {原创 2015-10-13 08:35:39 · 395 阅读 · 0 评论 -
ZOJ 1649 Rescue(BFS)
基础BFS#include #include #include #include #include using namespace std; const int maxm=205; const int inf=1<<29; int m,n; int x1,y1,x2,y2; char map[maxm][maxm]; int vis[maxm][maxm]; int w[maxm][maxm];原创 2015-10-13 16:52:50 · 393 阅读 · 0 评论 -
ZOJ 2027 Travelling Fee(最短路)
Travelling Fee Time Limit: 2 Seconds Memory Limit: 65536 KB Samball is going to travel in the coming vacation. Now it's time to make a plan. After choosing the destination city, the next st原创 2016-05-18 09:55:51 · 447 阅读 · 0 评论