algorithm

UVAOJ297

Written by  on January 29, 2015

UVAOJ297 297 – Quadtrees Time limit: 3.000 seconds  Quadtrees  A quadtree is a representation format used to encode images. The fundamental idea behind the quadtree is that any image can be split into four quadrants. Each quadrant may again be split in four sub quadrants, etc. In the quadtree, the image is represented by a parent node, while the four quadrants are represented by four child nodes, in a predetermined order.

[Read more...]

Codeforces #454 C

Written by  on January 15, 2015

Codeforces #454 C C. Little Pony and Expected Maximum time limit per test 1 second memory limit per test 256 megabytes input standard input output

[Read more...]

UVAOJ548

Written by  on January 3, 2015

UVAOJ548 548 – Tree Time limit: 3.000 seconds   Tree  You are to determine the value of the leaf node in a given binary tree that is the terminal node of a path of least value from the root of the binary tree to any leaf. The value of a path is the sum of values of nodes along that path.

[Read more...]

UVAOJ112

Written by  on January 3, 2015

UVAOJ112 112 – Tree Summing Time limit: 3.000 seconds  Tree Summing  Background LISP was one of the earliest high-level programming languages and, with FORTRAN, is one of the oldest languages currently being used. Lists, which are the fundamental data structures in LISP, can easily be adapted to represent other important data structures such as trees.

[Read more...]

AOAPC I: Volume 2.Data Structures-Lists

Written by  on December 27, 2014

<<算法竞赛入门经典>> UVaoj第三卷数据结构链表习题: 127-“Accordian” Patience UVAOJ127 101-The Blocks Problem UVAOJ101

[Read more...]

UVAOJ11234

Written by  on December 26, 2014

UVAOJ11234||POJ3367 Expressions Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 2591 Accepted: 850 Description Arithmetic expressions are usually written with the operators in between the two operands (which is called infix notation). For example, (x+y)*(z-w) is an arithmetic expression in infix notation. However, it is easier to write a program to evaluate an expression if the expression is written in postfix notation (also known as reverse Polish notation). In postfix notation, an operator is written behind its two operands, which may be expressions themselves. For example, x y + z w – * is a postfix notation of the arithmetic expression given above. Note that in this case parentheses are not required.

[Read more...]

UVAOJ11111

Written by  on December 26, 2014

UVAOJ || POJ3195 Generalized Matrioshkas Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 1835 Accepted: 538 Description Vladimir worked for years making matrioshkas, those nesting dolls that certainly represent truly Russian craft. A matrioshka is a doll that may be opened in two halves, so that one finds another doll inside. Then this doll may be opened to find another one inside it. This can be repeated several times, till a final doll – that cannot be opened – is reached.

[Read more...]

POJ1840

Written by  on December 20, 2014

POJ1840 Eqs Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 14507 Accepted: 7122 Description Consider equations having the following form:

[Read more...]

UVAOJ10152

Written by  on December 20, 2014

UVAOJ10152 题意: 首先给出一堆栈乌龟, 然后每个乌龟都可以爬到顶端去, 然后求最少爬的次数以及先后顺序以达到目的堆栈乌龟的顺序.

[Read more...]

UVAOJ101

Written by  on December 14, 2014

UVAOJ101 101 – The Blocks Problem Time limit: 3.000 seconds   The Blocks Problem  Background  Many areas of Computer Science use simple, abstract domains for both analytical and empirical studies. For example, an early AI study of planning and robotics (STRIPS) used a block world in which a robot arm performed tasks involving the manipulation of blocks.

[Read more...]