HDU
wlh1998
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
HDU 1009 FatMouse' Trade
#include#include#include#includeusing 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 · 334 阅读 · 0 评论 -
hdu 4081 Qin Shi Huang's National Road System
//函数返回值写成int,函数内外用了ans,调试只能显示其中一个,//垃圾dev半天没调出来 #include#include#include#includeusing 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 · 197 阅读 · 0 评论 -
HDU 1874畅通工程续
//重边//双向图//if 忘记大括号 #include#include#includeusing 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 · 200 阅读 · 0 评论 -
HDU 1875 畅通工程再续
#include#include#includeconst 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 · 219 阅读 · 0 评论 -
HDU 1879 继续畅通工程
#include#includeconst 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 · 168 阅读 · 0 评论 -
HDU 1863 畅通工程
#include#includeconst 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 · 174 阅读 · 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 · 163 阅读 · 0 评论 -
HDU 1010 Tempter of the Bone
//奇偶剪枝//01010101//10101010//01010101//10101010//1奇数步走到0,1偶数步走到1. #include#include#includeint 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 · 174 阅读 · 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 · 188 阅读 · 0 评论 -
HDU 1242 Rescue
#include#include#includeusing 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 · 170 阅读 · 0 评论 -
HDU 2489Minimal Ratio Tree
#include#includeconst 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 · 233 阅读 · 0 评论
分享