acm

UVAOJ131

Written by  on February 24, 2015

UVAOJ131 131 – The Psychic Poker Player Time limit: 3.000 seconds  The Psychic Poker Player  In 5-card draw poker, a player is dealt a hand of five cards (which may be looked at). The player may then discard between zero and five of his or her cards and have them replaced by the same number of cards from the top of the deck (which is face down). The object is to maximize the value of the final hand. The different values of hands in poker are given at the end of this problem.

[Read more...]

UVAOJ11205

Written by  on February 24, 2015

UVAOJ11025 题意就是求最少只用几个LED灯就可以区分给出的所有的LED,这里关键就是用到状态压缩和与运算。 比如LED灯一开始是:

[Read more...]

AOAPC I: Volume 2.Data Structures-Graphs

Written by  on February 21, 2015

<<算法竞赛入门经典>> UVaoj第三卷数据结构图习题: 572-Oil Deposits 纯DFS水题,碰见一个pocket来一波DFS即可。 657-The die is cast

[Read more...]

UVAOJ196

Written by  on February 21, 2015

UVAOJ196 196 – Spreadsheet Time limit: 3.000 seconds    Spreadsheet  In 1979, Dan Bricklin and Bob Frankston wrote VisiCalc, the first spreadsheet application. It became a huge success and, at that time, was the killer application for the Apple II computers. Today, spreadsheets are found on most desktop computers.

[Read more...]

UVAOJ10596

Written by  on February 19, 2015

UVAOJ10596 真是跪了。。。明明书上是先讲拓扑后讲欧拉的。。。却先搞这么大一串欧拉的题目,搞得我每次读题都会先各种先发制人想是不是拓扑,完了每次最后发现是欧拉也是醉了。。。

[Read more...]

UVAOJ10054

Written by  on February 19, 2015

UVAOJ10054 同欧拉系列。。。 不过这个应该是Eulerlan Cycle,然后只有两种情况: 1.可以拼回来,即成功构成Eulerlan Cycle。

[Read more...]

UVAOJ10129

Written by  on February 19, 2015

UVAOJ10129 欧拉回路,当然准确来说应该归到Eulerlan Path而不是 Eulerlan Cycle,两者的区别就是前者除了两个点之外所有点出度和入度都相等,而剩下的两个点一个点的入度比出度大一,另外一个出度比入度大一,后者则是所有的点的出度入度都相等。

[Read more...]

UVAOJ10047

Written by  on February 19, 2015

UVAOJ10047 据说是一道很经典的BFS题目。。。 因为要区分无效循环和正常遍历。。所以每个点除了xy坐标需要标记一下之外,还要标记轮子的方向和接地面的颜色。。。

[Read more...]

UVAOJ10557

Written by  on February 14, 2015

UVAOJ10557 这个题最关键的部分就是对于环的处理。 先记录下每个点是否已经访问,并且到达那个点时候的能量值,然后碰见环再次访问已经访问过的点的时候,如果能量大于之前,就说明通过这个环能量可以增长到无限大,然后再开启另一个DFS探测环是否有到达终点的路线,如果有那么直接就是winnable,否则的话直接放弃这个环。

[Read more...]

UVAOJ705

Written by  on February 13, 2015

UVAOJ705 705 – Slash Maze Time limit: 3.000 seconds   Slash Maze  By filling a rectangle with slashes (/) and backslashes ( ), you can generate nice little mazes. Here is an example:

[Read more...]