andre_joy

导航

2012年7月5日

hdu 1391

摘要: 地址:http://acm.hdu.edu.cn/showproblem.php?pid=1391题意:按图输出图上数字。mark:模仿图形里面数字变换特性。代码:#include <stdio.h>int a[5010][2];int main(){ int n,x,y,m; int i; a[0][0] = 0; a[1][1] = 1; i = m = 2; while(i < 5001) { a[i++][0] = m++; a[i--][0] = m++; a[i++][1] = m++; ... 阅读全文

posted @ 2012-07-05 23:48 andre_joy 阅读(111) 评论(0) 推荐(0) 编辑

hdu 1035

摘要: 地址:http://acm.hdu.edu.cn/showproblem.php?pid=1035题意:看小人是否能走出迷宫。mark:wa了一次,又是循环跳出条件出问题了……代码:#include <stdio.h>#include <string.h>int main(){ char a[15][15]; int m,n,s,sum,b[15][15]; int i,j,k; while(scanf("%d%d", &m, &n), m+n) { scanf("%d", &s); for(i = 0; 阅读全文

posted @ 2012-07-05 13:09 andre_joy 阅读(137) 评论(0) 推荐(0) 编辑

USACO milk2

摘要: 题意:n个农夫给n只羊喂奶,分别给出他们的起始时间和结束时间,求重叠的和没有重叠的最长时间。mark:wa了一次。变量max1忘记每次遇到不重叠的时候需要重新初始化了。。代码:/*ID: andre_j2LANG: CTASK: milk2*/#include <stdio.h>#include <stdlib.h>typedef struct{ int st,en;}fa;int cmp(const void *a, const void *b){ fa *p = (fa *)a, *q = (fa *)b; if(p->st != q->st) retu 阅读全文

posted @ 2012-07-05 01:40 andre_joy 阅读(273) 评论(0) 推荐(0) 编辑