摘要: http://acm.hdu.edu.cn/showproblem.php?pid=3791思路:建好二叉搜索树后,用二叉树的历遍去判断就好#include<iostream>#include<cstring>using namespace std;typedef struct tree{ tree *r,*l; int num;}tree;tree *root;int a[30],b[30],count=0;tree *creat(int x){ tree *t=(tree *)malloc(sizeof(tree)); t->r=0; t->l=0; t 阅读全文
posted @ 2013-01-11 21:00 紫忆 阅读(617) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4414题意:找有多少个十字架,十字架周围不能有#。思路:用简单暴力就可以过。反思:这个题目做了很久,wa了4次。第一次写的代码中有两个错误,一是没有判断十字架自己最中心的那个是不是为#,而是没有排除到了最末位时,o与#这组数据#include<iostream>#include<string.h>using namespace std;char s[60][60];int n;int main(){ while(scanf("%d",&n)>0) { 阅读全文
posted @ 2013-01-11 16:33 紫忆 阅读(538) 评论(0) 推荐(0) 编辑