Sort ColorsGiven an array withnobjects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the or...
分类:
其他好文 时间:
2014-09-03 16:40:46
阅读次数:
231
Sort ColorsGiven an array withnobjects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the or...
分类:
其他好文 时间:
2014-09-02 01:34:23
阅读次数:
262
Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, ...
分类:
其他好文 时间:
2014-08-24 11:32:02
阅读次数:
164
题目链接Kundu is true tree lover. Tree is a connected graph havingNvertices andN-1edges. Today when he got a tree, he colored each edge with one of either...
分类:
其他好文 时间:
2014-08-23 22:55:51
阅读次数:
309
输入多组数据,每组数据两种颜色,表示一根木头两端的颜色,现在要将这些木头相连,要求相连部分颜色相同,问能否全部连通
提示
1)一个要判断所有的木头是否在一个集合中,即是否能相连
2)判断一种颜色出现的数量
3)一棵树如果只有0或2个点出现次数为奇数,则树可以一笔画成
#include
#include
#define maxn 500005
int tot;
int f[maxn];...
分类:
其他好文 时间:
2014-08-17 11:48:02
阅读次数:
209
字典树+并查集一道比较不错的题,欧拉图,值得一做...
分类:
其他好文 时间:
2014-08-16 15:11:10
阅读次数:
151
Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue.
Here, we will use the integers ...
分类:
其他好文 时间:
2014-08-16 12:35:30
阅读次数:
233
点击打开链接题目链接
Colored Sticks
Time Limit: 5000MS
Memory Limit: 128000K
Total Submissions: 30273
Accepted: 8002
Description
You are given a bunch of wooden sticks. ...
分类:
其他好文 时间:
2014-08-15 17:59:39
阅读次数:
202
BicoloringIn 1976 the ``Four Color Map Theorem" was proven with the assistance of a computer. This theorem states that every map can be colored using....
分类:
其他好文 时间:
2014-08-15 14:23:23
阅读次数:
195
Painting some colored segments on a line, some previously painted segments may be covered by some the subsequent ones.
Your task is counting the segments of different colors you can see at last.
...
分类:
其他好文 时间:
2014-08-14 10:47:38
阅读次数:
222