一、题目DescriptionThere is a town with N citizens. It is known that some pairs of people are friends. According to the famous saying that ?The friends of...
分类:
其他好文 时间:
2014-07-27 22:32:29
阅读次数:
278
Problem IFRIENDSThere is a town with N citizens. It is known that some pairs of people are friends. According to the famous saying that ?The friends o...
分类:
其他好文 时间:
2014-07-27 22:31:29
阅读次数:
255
DescriptionBeing a programmer, you like arrays a lot. For your birthday, your friends have given you an arrayaconsisting ofndistinctintegers.Unfortuna...
分类:
其他好文 时间:
2014-07-27 22:27:19
阅读次数:
219
Problem DescriptionThere is a town with N citizens. It is known that some pairs of people are friends. According to the famous saying that “The friend...
分类:
其他好文 时间:
2014-07-27 22:26:19
阅读次数:
199
一、原题DescriptionBeing a programmer, you like arrays a lot. For your birthday, your friends have given you an arrayaconsisting ofndistinctintegers.Unfor...
分类:
其他好文 时间:
2014-07-27 22:22:59
阅读次数:
317
题目来源:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1549 并查集,求出每个friends集合,然后再计算每个集合friends个数,求出最...
分类:
其他好文 时间:
2014-07-27 22:01:29
阅读次数:
234
Problem A Codeforces 451A?题意:给你n+m根筷子,将他们分别水平、垂直放置,形成n*m个节点。两个人轮流选择一个点,将穿过这个点的两根筷子拿走,谁可以逼迫对方率先无法继续操作,谁就获胜,问获胜的是先手还是后手。?找规律即可。n,m中较小的那个数是奇数,先手胜,否则后手胜。1...
分类:
其他好文 时间:
2014-07-27 21:53:40
阅读次数:
362
题目链接:http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1350这题目因为每一个数都跟相邻的数有关,所以可以从左到右和从右到左一次扫一遍即可代码: 1 #include 2 #include 3 #define M 100100 4 using n...
分类:
其他好文 时间:
2014-07-27 10:36:22
阅读次数:
171
ll T;
while(~scanf("%d",&T)){
while(T--) {
= = ...
思路:
用秩合并,看了题解才发现 if(fx == fy)要输出当前集合的秩而不是0。。。
#include
#include
#include
#include
#include
#include
#include
#include
#include
#inc...
分类:
其他好文 时间:
2014-07-26 02:14:47
阅读次数:
222
索引的原文档(Document)。为了方便说明索引创建过程,这里特意用两个文件为例:文件一:Students should be allowed to go out with their friends, but not allowed to drink beer.文件二:My friend Jer...
分类:
其他好文 时间:
2014-07-25 03:19:37
阅读次数:
201