andre_joy

导航

2012年7月23日

hdu 300题~

摘要: 3月15日注册杭电账号,经历4个月的ac路程,有一些辛苦,但是为了以后,为了将来,一切都值得。继续努力吧~just do it! 阅读全文

posted @ 2012-07-23 22:47 andre_joy 阅读(101) 评论(0) 推荐(0) 编辑

hdu 1421

摘要: 地址:http://acm.hdu.edu.cn/showproblem.php?pid=1421题意:中文……mark:dp。关键还是找dp[i][j]。i代表前i个物品,j代表多少对。 wa了两次,真2,写顺手了,求了个最大值。。。代码:#include <stdio.h>#include <stdlib.h>#include <string.h>int a[2010];int dp[2010][2010];int cmp(const void *a, const void *b){ return *(int *)a - *(int *)b;}int m 阅读全文

posted @ 2012-07-23 19:15 andre_joy 阅读(164) 评论(0) 推荐(0) 编辑

hdu 2577

摘要: 地址:http://acm.hdu.edu.cn/showproblem.php?pid=2577题意:求字符串最少输入次数。mark:dp,关键是分组!代码:#include <stdio.h>#include <string.h>int min(int a, int b) {return a < b ? a : b;}int dp[110][2];int main(){ int t,i; char a[110]; scanf("%d", &t); while(t--) { scanf("%s", a); mems 阅读全文

posted @ 2012-07-23 18:07 andre_joy 阅读(153) 评论(0) 推荐(0) 编辑

hdu 2602

摘要: 地址:http://acm.hdu.edu.cn/showproblem.php?pid=2602题意:背包问题。mark:第一次背包~代码:#include <stdio.h>#include <string.h>int v[1010],c[1010];int dp[1010];int max(int a, int b) {return a > b ? a : b;}int main(){ int t,m,n; int i,j; scanf("%d", &t); while(t-- && scanf("%d% 阅读全文

posted @ 2012-07-23 16:29 andre_joy 阅读(109) 评论(0) 推荐(0) 编辑

poj 2492

摘要: 地址:http://poj.org/problem?id=2492题意:判断是否有同性恋。。。mark:解题报告主流思想是并查集,我用的bfs。 wa了很多次,都是一些不细心。而且这题居然每组数据后面都有一个空格。。。。代码:#include <stdio.h>#include <queue>#include <string.h>using namespace std;bool a[2010][2010];int b[2010];int f[2010];int m;int pd(){ int fr,la,i,j,p; queue<int> q; 阅读全文

posted @ 2012-07-23 12:28 andre_joy 阅读(222) 评论(0) 推荐(0) 编辑