上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 30 下一页

2014年9月25日

hdu5040 优先队列bfs(较烦)

摘要: 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 char face[]={'E','S','W','N'},map[505][505]; 7 int fac[505][505],vis[505][505][4... 阅读全文

posted @ 2014-09-25 21:01 xiao_xin 阅读(118) 评论(0) 推荐(0) 编辑

hdu5036 线段树(dfs序使树形结构转化为线性结构)(map,pair)

摘要: 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 mapmp; 8 pairegd[120005]; 9 int y1,y2,time_,now; 10 int next... 阅读全文

posted @ 2014-09-25 20:58 xiao_xin 阅读(222) 评论(0) 推荐(0) 编辑

2014年9月9日

hdu4474 bfs求k的最小的倍数(巧妙)

摘要: 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 int pre[10010],num[10010],a[10005],n; 7 void print(int x) 8 { 9 if (pre[x]!=... 阅读全文

posted @ 2014-09-09 23:22 xiao_xin 阅读(124) 评论(0) 推荐(0) 编辑

hdu4991 长为m的上升子序列个数(stl离散化+m个树状数组加速实现dp)

摘要: 1 #include 2 #include 3 #include 4 using namespace std; 5 int n,c[305][10005],a[10005],b[10005]; 6 int lowbit(int x) 7 { 8 return x&(-x); 9 }10 i... 阅读全文

posted @ 2014-09-09 19:44 xiao_xin 阅读(145) 评论(0) 推荐(0) 编辑

2014年9月4日

hdu1385 floyed最短路(记录路径)

摘要: 1 #include 2 #include 3 int g[105][105],next[105][105],v[105]; 4 int main() 5 { 6 int n,i,j,a,b,k,flag; 7 while (~scanf("%d",&n)&&n) 8 { ... 阅读全文

posted @ 2014-09-04 20:46 xiao_xin 阅读(102) 评论(0) 推荐(0) 编辑

hdu1796 容斥原理dfs

摘要: 1 #include 2 #include 3 long long int ans,n; 4 int cnt,a[25]; 5 long long int gcd(long long int x,long long int y) 6 { 7 if (y==0) return x; 8 ... 阅读全文

posted @ 2014-09-04 20:40 xiao_xin 阅读(115) 评论(0) 推荐(0) 编辑

2014年9月3日

hdu4856 西安邀请赛 bfs+状态压缩dp巧妙转换

摘要: 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 int xx[]={0,0,1,-1}; 7 int yy[]={-1,1,0,0}; 8 int vis[16][16],dis[16][16],sx[16]... 阅读全文

posted @ 2014-09-03 17:06 xiao_xin 阅读(91) 评论(0) 推荐(0) 编辑

2014年8月18日

hdu3338 类似数独 网络流dinic(关于行列建图的巧妙)

摘要: 边容量即为所填数 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 #define inf 0x3f3f3f3f 7 struct Edge 8 { 9 int from,to,cap,... 阅读全文

posted @ 2014-08-18 14:46 xiao_xin 阅读(261) 评论(0) 推荐(0) 编辑

2014年8月15日

hdu1569 方格取数网络流dinic算法

摘要: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 using namespace std; 8 #define inf 0x3f3f3f3f 9 struct Edge{ 10 int ... 阅读全文

posted @ 2014-08-15 01:03 xiao_xin 阅读(149) 评论(0) 推荐(0) 编辑

2014年8月13日

hdu1532 网络流dinic算法模板

摘要: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #define inf 0x3f3f3f3f 8 using namespace std; 9 int min(int xx,int yy) 1... 阅读全文

posted @ 2014-08-13 13:40 xiao_xin 阅读(120) 评论(0) 推荐(0) 编辑

上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 30 下一页

导航