HDU
wlh1998
这个作者很懒,什么都没留下…
展开
-
HDU 1009 FatMouse' Trade
#include #include #include #include using namespace std; const int maxn = 1e6+5; struct node{ int jav; int food; double ave; bool operator< (const node&I)const { //按照ave由da到xiao排列 return I.av原创 2017-07-20 21:05:42 · 282 阅读 · 0 评论 -
hdu 4081 Qin Shi Huang's National Road System
//函数返回值写成int,函数内外用了ans,调试只能显示其中一个, //垃圾dev半天没调出来 #include #include #include #include using namespace std; const int maxn = 1e3+10; const int maxm = 1e6+10; const int INF = 0x3f3f3f3f; int fa[maxn]原创 2017-07-25 20:47:32 · 150 阅读 · 0 评论 -
HDU 1874畅通工程续
//重边 //双向图 //if 忘记大括号 #include #include #include using namespace std; const int maxn = 2e2+3; const int INF = 0x3f3f3f3f; int mp[maxn][maxn]; int vis[maxn]; int dis[maxn]; int main (){ int m,n;原创 2017-07-24 20:26:17 · 147 阅读 · 0 评论 -
HDU 1875 畅通工程再续
#include #include #include const int INF = 0x3f3f3f3f; const int maxn = 1e3; double mp[maxn][maxn]; // 存图; int vis[maxn]; //是否在新图内; double dis[maxn]; //第i个顶点到新图最短距离; double prim(int n); struct原创 2017-07-24 18:10:22 · 165 阅读 · 0 评论 -
HDU 1879 继续畅通工程
#include #include const int INF = 0x3f3f3f3f; const int maxn = 1e3; int fa[maxn]; int mp[maxn][maxn]; // 存图; int vis[maxn]; //是否在新图内; int dis[maxn]; //第i个顶点到新图最短距离; int prim(int n); int find(原创 2017-07-24 16:43:53 · 122 阅读 · 0 评论 -
HDU 1863 畅通工程
#include #include const int INF = 0x3f3f3f3f; const int maxn = 1e3; int mp[maxn][maxn]; // 存图; int vis[maxn]; //是否在新图内; int dis[maxn]; //第i个顶点到新图最短距离; int prim(int n); int n,m; int main (){ i原创 2017-07-24 11:03:47 · 119 阅读 · 0 评论 -
HDU 1016 Prime Ring Problem
#include #include const int maxn = 1e5; int mp[maxn]; int vis[maxn]; int ans[maxn]; int prime[maxn],res; bool isn_prime [maxn]; void get_prime (int n); int n; void dfs(int k){ if (k == n + 1){ i原创 2017-07-24 10:04:49 · 124 阅读 · 0 评论 -
HDU 1010 Tempter of the Bone
//奇偶剪枝 //01010101 //10101010 //01010101 //10101010 //1奇数步走到0,1偶数步走到1. #include #include #include int n,m,t,ans = 0; const int maxn = 1e3; char a[maxn][maxn]; int vis[maxn][maxn]; int dx[10] = {0,0,原创 2017-07-24 09:30:10 · 130 阅读 · 0 评论 -
HDU 1548 A strange lift
//搜索注意已搜索标记,第一次忘了判断,wa了 // 第二次判断写错, #include #include #include using namespace std; struct node{ int pos; int step; node(int _pos, int _step):pos (_pos) ,step(_step) { } }; const int maxn = 1e原创 2017-07-21 15:10:03 · 145 阅读 · 0 评论 -
HDU 1242 Rescue
#include #include #include using namespace std; const int maxn = 1e3 + 5; const int INF = 0x3f3f3f3f; char mp[maxn][maxn]; int vis[maxn][maxn]; int dx[10] = {0,0,-1,1,1,1,-1,-1}; int dy[10] = {1,-原创 2017-07-21 14:18:54 · 133 阅读 · 0 评论 -
HDU 2489Minimal Ratio Tree
#include #include const int INF = 0x3f3f3f3f; const int maxn = 22; int mps[maxn][maxn]; // 存图; int mp[maxn][maxn]; int pw[maxn]; // 点权 int vis[maxn]; //是否在新图内; int dis[maxn]; //第i个顶点到新图最短距离;原创 2017-07-26 20:16:21 · 176 阅读 · 0 评论