2014年7月16日

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) 编辑

hdu4828 卡特兰数+乘法逆元

摘要: 1 #include 2 #include 3 #include 4 #include 5 #define MAX 1000003 6 #define MOD 1000000007 7 #define LL long long 8 using namespace std; 9 10 __i... 阅读全文

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

hdu2227 树状数组

摘要: 1 #include 2 #include 3 #define MOD 1000000007 4 __int64 ans[100005],c[100005]; 5 int a[100005],wei[100005],n; 6 void sort(int l,int r) 7 { 8 int... 阅读全文

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

导航