09 2014 档案

hdu2586 lca模板(tarjan离线算法)
摘要:1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 struct dian{ 7 int v,id; 8 }; 9 int now;10 vectormp[100005];11 int vis[10000... 阅读全文

posted @ 2014-09-30 21:26 xiao_xin 阅读(138) 评论(0) 推荐(0)

hdu5032 点和查询分别按极角排序 离线做+树状数组
摘要:1 #include 2 #include 3 #include 4 using namespace std; 5 struct jie{ 6 double k; 7 int x,v; 8 }dian[1000005],xian[100005]; 9 long long c[100... 阅读全文

posted @ 2014-09-26 18:05 xiao_xin 阅读(123) 评论(0) 推荐(0)

hdu5032 关于bitset传递闭包
摘要:1 #include 2 #include 3 #include 4 using namespace std; 5 bitsetedge[1005]; 6 int main() 7 { 8 int i,sum,T,t,j,n,x,y; 9 double ans;10 sca... 阅读全文

posted @ 2014-09-25 21:38 xiao_xin 阅读(198) 评论(0) 推荐(0)

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 阅读(126) 评论(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 阅读(231) 评论(0) 推荐(0)

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 阅读(131) 评论(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 阅读(158) 评论(0) 推荐(0)

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 阅读(103) 评论(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 阅读(121) 评论(0) 推荐(0)

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 阅读(101) 评论(0) 推荐(0)

导航