andre_joy

导航

上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 15 下一页

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

2012年7月22日

poj 2442

摘要: 地址:http://poj.org/problem?id=2442题意:m段序列,每个序列取一个数,求组成序列和最小的n个数。mark:最近刚接手的优先队列。代码:#include <stdio.h>#include <iostream>#include <stdlib.h>#include <queue>using namespace std;int a[2010], b[2010];int cmp(const void *a, const void *b){ return *(int *)a - *(int *)b;}int main(){ 阅读全文

posted @ 2012-07-22 10:13 andre_joy 阅读(107) 评论(0) 推荐(0) 编辑

2012年7月20日

hdu 4301

摘要: 地址:http://acm.hdu.edu.cn/showproblem.php?pid=4301题意:分巧克力,注意每块巧克力都不一样。mark:dp,三维的。代码:#include <stdio.h>int dp[1010][2010][2];int main(){ int t,i,j; dp[1][1][0] = dp[1][2][1] = dp[2][1][0] = dp[2][3][0] = dp[2][4][1] = 1; dp[2][2][0] = dp[2][3][1] = 3; dp[2][2][1] = 3; for(i = 3; i <= 1... 阅读全文

posted @ 2012-07-20 09:17 andre_joy 阅读(178) 评论(0) 推荐(0) 编辑

2012年7月19日

hdu 4302

摘要: 地址:http://acm.hdu.edu.cn/showproblem.php?pid=4302题意:虫子吃蛋糕,总是吃最近的,如果一样近,按之前顺序吃。mark:wa了无数次啊,,最后终于找到错误了,队列没有清空。。。 第一次用这种queue的库函数写,比较生涩,不过最后ac了,挺高兴的~代码:#include <queue>#include <iostream>#define LL __int64using namespace std;struct cmp{ bool operator()(LL a, LL b) { return a > b; }}... 阅读全文

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

2012年7月18日

hdu 1015

摘要: 地址:http://acm.hdu.edu.cn/showproblem.php?pid=1015题意:找符合题目给定公式字典序最后的字符串。mark:暴力过……代码:#include <stdio.h>#include <string.h>#include <stdlib.h>int n,c[15];char a[15], b[30] = "1ABCDEFGHIJKLMNOPQRSTUVWXYZ";int cmp(const void *a, const void *b){ return *(int *)b - *(int *)a;}v 阅读全文

posted @ 2012-07-18 10:43 andre_joy 阅读(352) 评论(0) 推荐(0) 编辑

2012年7月13日

hdu 1166

摘要: 地址:http://acm.hdu.edu.cn/showproblem.php?pid=1166题意:中文……mark:线段树。第一次写线段树,目的是减小空间复杂度。代码:#include <stdio.h>#define LL(x) ((x) << 1)#define RR(x) ((x) << 1 | 1)typedef struct{ int le,ri,mi,su;}tree;int a[50010];tree t[150000];int build(int l, int r, int s){ t[s].le = l; t[s].ri = r; t 阅读全文

posted @ 2012-07-13 21:14 andre_joy 阅读(109) 评论(0) 推荐(0) 编辑

上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 15 下一页