2014年7月22日

hdu3306 矩阵快速幂

摘要: 1 #include 2 #include 3 #define MOD 10007 4 int main() 5 { 6 int n,x,y,i,j,k,doit[5][5],temp[5][5],a[5][2]; 7 while (~scanf("%d%d%d",&n,&x,&y... 阅读全文

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

hdu1074 状态压缩dp

摘要: 1 #include 2 #include 3 char s[20][105]; 4 int ded[20],day[20],hash[40000]; 5 struct s 6 { 7 int time,pre,lost; 8 }dp[40000]; 9 void Print(int s... 阅读全文

posted @ 2014-07-22 14:17 xiao_xin 阅读(99) 评论(0) 推荐(0) 编辑

2014年7月21日

hdu1400 状态压缩dp

摘要: 1 #include 2 #include 3 long long result[15][15],dp[15][2050]; 4 int n,m,t; 5 long long dfs(int l,int state) 6 { 7 int i,j,judge,flag,last; 8 ... 阅读全文

posted @ 2014-07-21 23:38 xiao_xin 阅读(152) 评论(0) 推荐(0) 编辑

2014年7月18日

hdu1059 二进制优化多重背包

摘要: 1 #include 2 int max(int x,int y) 3 { 4 if (x>y) return x; 5 return y; 6 } 7 int v[105],w[105],ans[1000005]; 8 int main() 9 {10 int t=0,f... 阅读全文

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

hdu1025 dp+二分查找 nlogn最长上升子序列

摘要: 1 #include 2 #include 3 int a[500005],b[500005],d[500005]; 4 void sort(int l,int r) 5 { 6 int i=l,j=r,x=a[(i+j)/2],y; 7 while (id[maxlen])41 ... 阅读全文

posted @ 2014-07-18 14:32 xiao_xin 阅读(164) 评论(0) 推荐(0) 编辑

hdu1024 dp+滚动数组

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

posted @ 2014-07-18 11:49 xiao_xin 阅读(104) 评论(0) 推荐(0) 编辑

2014年7月17日

hdu1535 spfa反向表示多到一

摘要: 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 struct Edge 7 { 8 int to; //边终点 9 int w; //边值10 int next;//结构体模拟链... 阅读全文

posted @ 2014-07-17 17:24 xiao_xin 阅读(125) 评论(0) 推荐(0) 编辑

hdu2145 邻接表spfa

摘要: 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 struct Edge 7 { 8 int to; //边终点 9 int w; //边值10 int next;//结构体模拟链... 阅读全文

posted @ 2014-07-17 17:22 xiao_xin 阅读(94) 评论(0) 推荐(0) 编辑

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

导航