2014年7月16日

hdu1671 字典树

摘要: 1 #include 2 #include 3 int sz,ch[100005][30],val[100005]; 4 void insert(char *s) 5 { 6 int u=0,i,len=strlen(s); 7 for (i=0;i<len;i++) 8 ... 阅读全文

posted @ 2014-07-16 17:53 xiao_xin 阅读(74) 评论(0) 推荐(0) 编辑

hdu1247 字典树

摘要: 1 #include 2 #include 3 int ch[50005][100],sz=1,val[50005]; 4 char s[50005][105]; 5 void insert(char *s) 6 { 7 int i,u=0,len=strlen(s),c; 8 ... 阅读全文

posted @ 2014-07-16 17:52 xiao_xin 阅读(78) 评论(0) 推荐(0) 编辑

hdu1806 RMQ

摘要: 1 #include 2 int d[100005][50]; 3 int max(int a,int b) 4 { 5 if (a>b) return(a); 6 return(b); 7 } 8 int rmq(int l,in... 阅读全文

posted @ 2014-07-16 17:46 xiao_xin 阅读(101) 评论(0) 推荐(0) 编辑

hdu1754 线段树点修改

摘要: 1 #include 2 int ql,qr,p,v,minv[1000005]; 3 int max(int x,int y) 4 { 5 if (x>y) return(x); 6 return(y); 7 } 8 int qu... 阅读全文

posted @ 2014-07-16 17:34 xiao_xin 阅读(87) 评论(0) 推荐(0) 编辑

hdu1166 树状数组

摘要: 1 #include 2 int n,c[1000005]; 3 int lowbit(int x) 4 { 5 return(x&-x); 6 } 7 void add(int x,int d) 8 { 9 while (x0)1... 阅读全文

posted @ 2014-07-16 17:30 xiao_xin 阅读(81) 评论(0) 推荐(0) 编辑

hdu1102 最小生成树

摘要: 1 #include 2 int a[10005],p[10005],q[10005],father[10005]; 3 int find(int x) 4 { 5 if (father[x]!=x) father[x]=find(father[x]); 6 return(fath... 阅读全文

posted @ 2014-07-16 16:54 xiao_xin 阅读(74) 评论(0) 推荐(0) 编辑

hdu2544 dijkstra

摘要: 1 #include 2 #define max 100000000; 3 int main() 4 { 5 int n,m,i,j,k,min,a,b,c,hash[1005],ar[1005],length[105][105]; 6 while (~scanf("%d%d",&... 阅读全文

posted @ 2014-07-16 16:51 xiao_xin 阅读(80) 评论(0) 推荐(0) 编辑

hdu1711 kmp

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

posted @ 2014-07-16 16:47 xiao_xin 阅读(78) 评论(0) 推荐(0) 编辑

hdu2202 凸包+旋转卡壳

摘要: 1 #include 2 #include 3 typedef struct dian 4 { 5 int x,y; 6 }; 7 dian p[50005],ch[50005]; 8 double area(int i,int j,int k) 9 {10 double a,b,... 阅读全文

posted @ 2014-07-16 16:39 xiao_xin 阅读(128) 评论(0) 推荐(0) 编辑

hdu1849 1850 1851 nim博弈

摘要: 1 #include 2 int main() 3 { 4 int n,k,a,i; 5 while (~scanf("%d",&n)&&n!=0) 6 { 7 k=0; 8 for (i=1;i 2 int main() 3 { 4 ... 阅读全文

posted @ 2014-07-16 16:32 xiao_xin 阅读(89) 评论(0) 推荐(0) 编辑

hdu1527 威佐夫博弈

摘要: 1 #include 2 #include 3 int main() 4 { 5 int t,n,m,x; 6 while (~scanf("%d%d",&n,&m)) 7 { 8 if (n>m) {t=m; m=n; n=t; } 9 t... 阅读全文

posted @ 2014-07-16 16:30 xiao_xin 阅读(111) 评论(0) 推荐(0) 编辑

hdu1348 凸包

摘要: 1 #include 2 #include 3 int x[100005],y[100005],ch[100005]; 4 void sort(int l,int r) 5 { 6 int i,j,xx,yy,x1; 7 i=l; j=r; 8 xx=x[(i+j)/2];... 阅读全文

posted @ 2014-07-16 16:28 xiao_xin 阅读(76) 评论(0) 推荐(0) 编辑

hdu1251 字典树

摘要: 1 #include 2 #include 3 int sz=1,father[1000005],val[1000005],ch[1000005][30]; 4 void insert(char *s) 5 { 6 int u=0,i,len=strlen(s); 7 for (i... 阅读全文

posted @ 2014-07-16 16:27 xiao_xin 阅读(77) 评论(0) 推荐(0) 编辑

hdu1242 优先队列bfs

摘要: 1 #include 2 #include 3 #include 4 using namespace std; 5 typedef struct dian 6 { 7 friend bool operatorn2.time);10 }11 int x,y,time;12 }... 阅读全文

posted @ 2014-07-16 16:26 xiao_xin 阅读(101) 评论(0) 推荐(0) 编辑

hdu1028 母函数

摘要: 1 #include 2 #include 3 int main() 4 { 5 int i,j,k,n,m,c1[10005],c2[10005]; 6 while (~scanf("%d",&n)) 7 { 8 for (i=0;i<=n;i++) ... 阅读全文

posted @ 2014-07-16 16:25 xiao_xin 阅读(88) 评论(0) 推荐(0) 编辑

hdu2155 dp

摘要: 1 #include 2 #include 3 int h[10005],xl[10005],xr[10005],dp[10005][5]; 4 int min(int a,int b) 5 {if (a=1;j--)41 if (xl[j]=1;j--)48 ... 阅读全文

posted @ 2014-07-16 16:23 xiao_xin 阅读(111) 评论(0) 推荐(0) 编辑

hdu2181 哈密尔顿dfs

摘要: 1 #include 2 #include 3 int hash[25],map[25][5],m,k,jilu[25]; 4 void dfs(int now,int step) 5 { 6 int i,judge; 7 jilu[step]=now; 8 if (ste... 阅读全文

posted @ 2014-07-16 16:21 xiao_xin 阅读(86) 评论(0) 推荐(0) 编辑

hdu3934 凸包

摘要: 1 #include 2 #include 3 typedef struct dian 4 { 5 int x,y; 6 }; 7 dian p[50005],ch[50005]; 8 double area(int i,int j,int k) 9 {10 double a,b,... 阅读全文

posted @ 2014-07-16 16:18 xiao_xin 阅读(121) 评论(0) 推荐(0) 编辑

hdu2208 dfs+并查集

摘要: 1 #include 2 #include 3 int n,m,min,father[15],map[15][15]; 4 int find(int i) 5 { 6 if (father[i]!=i) return(find(father[i])); 7 return(fathe... 阅读全文

posted @ 2014-07-16 16:15 xiao_xin 阅读(114) 评论(0) 推荐(0) 编辑

hdu2669 扩展欧几里得

摘要: 1 #include 2 int exgcd(__int64 a,__int64 b,__int64 &x,__int64 &y) 3 { 4 __int64 t,r; 5 if (b==0){ 6 x=1; y=0; 7 return(a); 8 ... 阅读全文

posted @ 2014-07-16 16:13 xiao_xin 阅读(108) 评论(0) 推荐(0) 编辑

导航