摘要: //2363500 2010-12-02 21:50:28 Accepted 1789 C 10 392 VRS//1789 SARS隔离 并查集#include<stdio.h>#include<string.h>int setFather[30005];int setCount[30005];int Find(int x){ int root=x; whi... 阅读全文
posted @ 2010-12-04 14:39 VRS 阅读(356) 评论(0) 推荐(0) 编辑
摘要: //7956395 vrs 2524 Accepted 536K 344MS C 1280B 2010-12-02 17:33:55//POJ 2524 学生宗教 并查集基础题#include<stdio.h>unsigned int setFarther[50005];unsigned int setLevel[50005];void MakeSet(unsigned int n){... 阅读全文
posted @ 2010-12-04 14:38 VRS 阅读(302) 评论(0) 推荐(0) 编辑
摘要: //7966044 vrs 3984 Accepted 376K 0MS GCC 2108B 2010-12-04 13:38:57//POJ 3984 第二届顶嵌杯决赛B题//走迷宫 广搜//要用GCC编译,没得用STL。郁闷,只能自己写个队列操作#include<stdio.h>#include<stdlib.h>#include<string.h>#def... 阅读全文
posted @ 2010-12-04 14:36 VRS 阅读(466) 评论(0) 推荐(0) 编辑
摘要: //7966039 vrs570540852 3983 Accepted 388K 0MS GCC 2312B 2010-12-04 13:38:18//POJ 3983 第二届顶嵌杯决赛A题 计算4个数等于24//搜索 数据较小,不用剪枝就过了//利用类似层叠那样,每运算一次,就合并两个数,所以少一个数,每次计算的值都保存在curVal中//注意浮点数1/3 *3 会等于1//格式化输出时用到s... 阅读全文
posted @ 2010-12-04 14:35 VRS 阅读(791) 评论(0) 推荐(0) 编辑
摘要: //第二届顶嵌杯初赛 题目 POJ//A题#include<stdio.h>int a3,b3;void Reduce(){ while(a3%2==0 && b3%2==0) { a3/=2; b3/=2; } while(a3%3==0 && b3%3==0) { a3/=3; b3/=3; } while(a3%5==0 && b3... 阅读全文
posted @ 2010-12-04 14:34 VRS 阅读(443) 评论(0) 推荐(0) 编辑