poj2955

maksyuki 发表于 oj 分类,标签:
0
poj2955

Brackets

We give the following inductive definition of a “regular brackets” sequence:

the empty sequence is a regular brackets sequence,

if s is a regular brackets sequence, then (s) and [s] are regular brackets sequences, and

if a and b a >>继续阅读

poj2891

maksyuki 发表于 oj 分类,标签:
0
poj2891

Strange Way to Express Integers

Elina is reading a book written by Rujia Liu, which introduces a strange way to express non-negative integers. The way is described as following:

Choose k different positive integers a1, a2, …, ak. For some non-neg >>继续阅读

poj2823

maksyuki 发表于 oj 分类,标签:
0
poj2823

Sliding Window

An array of size n ≤ 106 is given to you. There is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each time the sliding window moves rightwa >>继续阅读

poj2785

maksyuki 发表于 oj 分类,标签:
0
poj2785

4 Values whose Sum is 0

The SUM problem can be formulated as follows: given four lists A, B, C, D of integer values, compute how many quadruplet (a, b, c, d ) ∈ A x B x C x D are such that a + b + c + d = 0 . In the following, we assume that all li >>继续阅读

poj2777

maksyuki 发表于 oj 分类,标签:
0
poj2777

Count Color

Chosen Problem Solving and Program design as an optional course, you are required to solve all kinds of problems. Here, we get a new problem. There is a very long board with length L centimeter, L is a positive integer, so we can evenly >>继续阅读

poj2752

maksyuki 发表于 oj 分类,标签:
0
poj2752

Seek the Name, Seek the Fame

The little cat is so famous, that many couples tramp over hill and dale to Byteland, and asked the little cat to give names to their newly-born babies. They seek the name, and at the same time seek the fame. In order to >>继续阅读

poj2709

maksyuki 发表于 oj 分类,标签:
0
poj2709

Painter

The local toy store sells small fingerpainting kits with between three and twelve 50ml bottles of paint, each a different color. The paints are bright and fun to work with, and have the useful property that if you mix X ml each of any three >>继续阅读

poj2689

maksyuki 发表于 oj 分类,标签:
0
poj2689

Prime Distance

The branch of mathematics called number theory is about properties of numbers. One of the areas that has captured the interest of number theoreticians for thousands of years is the question of primality >>继续阅读

poj2585

maksyuki 发表于 oj 分类,标签:
0
poj2585

Window Pains

Boudreaux likes to multitask, especially when it comes to using his computer. Never satisfied with just running one application at a time, he usually runs nine applications, each in its own window. Due to limited screen real estate, he >>继续阅读

poj2576

maksyuki 发表于 oj 分类,标签:
0
poj2576

Tug of War

A tug of war is to be arranged at the local office picnic. For the tug of war, the picnickers must be divided into two teams. Each person must be on one team or the other; the number of people on the two teams must not differ by more tha >>继续阅读

poj2570

maksyuki 发表于 oj 分类,标签:
0
poj2570

Fiber Network

Several startup companies have decided to build a better Internet, called the "FiberNet". They have already installed many nodes that act as routers all around the world. Unfortunately, they started to quarrel about the connecting lin >>继续阅读

poj2559

maksyuki 发表于 oj 分类,标签:
0
poj2559

Largest Rectangle in a Histogram

A histogram is a polygon composed of a sequence of rectangles aligned at a common base line. The rectangles have equal widths but may have different heights. For example, the figure on the left shows the histogram t >>继续阅读

poj2528

maksyuki 发表于 oj 分类,标签:
0
poj2528

Mayor's posters

The citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral posters at all places at their whim. The city council has finally decided to build an electoral wal >>继续阅读

poj2513

maksyuki 发表于 oj 分类,标签:
0
poj2513

Colored Sticks

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 straight line such that the colors of the endpoints that touch are of the same color?

Input >>继续阅读

poj2480

maksyuki 发表于 oj 分类,标签:
0
poj2480

Longge's problem

Longge is good at mathematics and he likes to think about hard mathematical problems which will be solved by some graceful algorithms. Now a problem comes: Given an integer N(1 < N < 2^31),you are to calculate ∑gcd(i, N) 1< >>继续阅读

poj2479

maksyuki 发表于 oj 分类,标签:
0
poj2479

Maximum sum

Given a set of n integers: A={a1, a2,..., an}, we define a function d(A) as below:

Your task is to calculate d(A).

Input

The input consists of T(<=30) test cases. The number of >>继续阅读