摘要: 先来个最水的poj 2524Ubiquitous Religionshttp://poj.org/problem?id=2524【题意】:给出n个大学生,其中有m对宗教信仰相同的学生,请你估算这n个学生中最多有多少种宗教信仰。【思路】: 先设 答案为n 每合并一个集合减一就ok了 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 8 int n; 9 int f[50002];10 11 void init()12 {13 for(int i=0;i 2 #include 3 usi... 阅读全文
posted @ 2014-02-07 11:33 galaxy77 阅读(428) 评论(0) 推荐(0) 编辑