DescriptionThere is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a...
分类:
其他好文 时间:
2015-01-27 21:43:01
阅读次数:
170
uva 10004 Bicoloring
In 1976 the ``Four Color Map Theorem" was proven with the assistance of acomputer. This theorem states that every map can be colored using only fourcolors, in such a way ...
分类:
其他好文 时间:
2015-01-27 18:25:17
阅读次数:
145
题目:
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 in...
分类:
编程语言 时间:
2015-01-27 15:06:38
阅读次数:
145
uva 1352 Colored Cubes
There are several colored cubes. All of them are of the same size but they may be colored differently. Each face of these cubes has a single color. Colors of distinct fac...
分类:
其他好文 时间:
2015-01-26 15:14:48
阅读次数:
100
Count the ColorsTime Limit: 2 Seconds Memory Limit: 65536 KBPainting some colored segments on a line, some previously painted segments may be cover...
分类:
其他好文 时间:
2015-01-25 15:03:33
阅读次数:
121
题目:Given an array withnobjects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red,...
分类:
编程语言 时间:
2015-01-24 19:58:37
阅读次数:
213
Problem A: The Monocycle
A monocycle is a cycle that runs on one wheel and the one we will be considering is a bit more special. It has a solid wheel colored with five different colors a...
分类:
其他好文 时间:
2015-01-22 18:15:25
阅读次数:
303
题目大意:
给你一个n(nn的一条最短路径,满足相邻的两条边不能是同一种颜色。输出最短路径长度。
解题思路:
一道很水的SPFA题目,只是要加上一点限制条件,我们可以用dist[ i ][ j ]表示第i个点并且是由j颜色的边连过来的最短路,一开始我们将所有的赋初始值为无穷大,然后令dist[1][0]=0,接着就是SPFA跑一遍就行了。
需要注意的是,这个图由自环,我们可能有时要...
分类:
其他好文 时间:
2015-01-21 13:27:47
阅读次数:
159
There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he c...
分类:
其他好文 时间:
2015-01-20 13:31:48
阅读次数:
148
Count the Colors
Time Limit: 2 Seconds Memory Limit: 65536 KB
Painting some colored segments on a line, some previously painted segments may be covered by some the subsequent ones.
Your ta...
分类:
其他好文 时间:
2015-01-17 01:09:12
阅读次数:
293