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, ...
分类:
其他好文 时间:
2017-05-22 23:24:59
阅读次数:
356
题解:http://blog.csdn.net/lyy289065406/article/details/6647445 正如题解所说,是一道综合好题,讲真,如果不看题解,绝对不会想到同事用并查集和trietree…… 题解里什么都好,就是有个地方有点坑,不要用cin,乖乖用scanf,不要以为题解 ...
分类:
其他好文 时间:
2017-05-12 01:44:17
阅读次数:
124
Fighting the Landlords 大意: 斗地主。。。。 分别给出两把手牌,肯定都合法。每张牌大小顺序是Y (i.e. colored Joker) > X (i.e. Black & White Joker) > 2 > A (Ace) > K (King) > Q (Queen) > ...
分类:
其他好文 时间:
2017-05-05 10:43:21
阅读次数:
191
- Colored Sticks POJ - 2513 - Colored Sticks You are given a bunch of wooden sticks. Each endpoint of each stick is colored with some color. Is it pos ...
分类:
其他好文 时间:
2017-04-24 23:22:18
阅读次数:
291
Description You are given a bunch of wooden sticks. Each endpoint of each stick is colored with some color. Is it possible to align the sticks in a st ...
分类:
其他好文 时间:
2017-04-07 23:31:38
阅读次数:
209
http://poj.org/problem?id=2513 题意: 给定一些木棒,木棒两端都涂上颜色,求是否能将木棒首尾相接,连成一条直线,要求不同木棒相接的一边必须是相同颜色的。 思路: 题目很明显的是欧拉道路的问题。 欧拉道路的关键是: ①图是连通的。 ②最多只能有两个奇点。(不能只存在一个奇 ...
分类:
其他好文 时间:
2017-03-30 00:22:57
阅读次数:
226
Description Mr. B and Mr. M like to play with balls. They have many balls colored in blue and red. Firstly, Mr. B randomly picks up N balls out of the ...
分类:
其他好文 时间:
2017-03-25 22:34:13
阅读次数:
198
Description Painting some colored segments on a line, some previously painted segments may be covered by some the subsequent ones. Your task is counti ...
分类:
其他好文 时间:
2017-03-23 21:25:08
阅读次数:
214
题意: Andryusha goes through a park each day. The squares and paths between them look boring to Andryusha, so he decided to decorate them. The park cons ...
分类:
其他好文 时间:
2017-03-07 20:49:11
阅读次数:
235
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, ...
分类:
其他好文 时间:
2017-03-06 20:38:04
阅读次数:
159