摘要: 转自:wutianqi http://www.wutianqi.com/?p=981题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1284tag:母函数直接套母函数的模版~~~#include using namespace std; int c1[32768], c2[32768] = {0};int main(){ int i, j, k, h; for (i = 0; i int main(){ __int64 n,i,j,sum; while(scanf("%I64d",&n)==1) { s... 阅读全文
posted @ 2013-07-22 16:10 西芒xiaoP 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 1 #define MAX **** //自己设置最大值 2 3 // father[x]表示x的父节点 4 int father[MAX]; 5 // rank[x]表示x的秩 6 int rank[MAX]; 7 8 // 初始化 9 void Make_Set(int n)10 {11 for(int i=1; i rank[y])34 father[y] = x;35 else if(rank[x] < rank[y])36 father[x] = y;37 else38 {39 rank[y... 阅读全文
posted @ 2013-07-22 16:05 西芒xiaoP 阅读(224) 评论(0) 推荐(0) 编辑