uva10935

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

Given is an ordered deck of n cards numbered 1 to n with card 1 at the top and card n at the bottom. The following operation is performed as long as there are at least two cards in the deck:

Throw away the top card and move the card that is now on >>继续阅读

uva1593

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

You are working in a team that writes Incredibly Customizable Programming Codewriter (ICPC) which is basically a text editor with bells and whistles. You are working on a module that takes a piece of code containing some definitions or other tabular >>继续阅读

uva10533

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

Digit Primes

A prime number is a positive number, which is divisible by exactly two different integers. A digit prime is a prime number whose sum of digits is also prime. For example the prime number 41 is a digit prime

because 4+1=5 and 5 is a p >>继续阅读

uva10168

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

Euler proved in one of his classic theorems that prime numbers are infinite in number. But can every number be expressed as a summation of four positive primes? I don’t know the answer. May be you can help!!! I want your solution to be very efficient >>继续阅读

uva1600

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

A robot has to patrol around a rectangular area which is in a form of m x n grid (m rows and n columns). The rows are labeled from 1 to m. The columns are labeled from 1 to n. A cell (i, j) denotes the cell in row iand column j in the grid. At each s >>继续阅读

uva1588

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

A research laboratory of a world-leading automobile company has received an order to create a special transmission mechanism, which allows for incredibly efficient kickdown -- an operation of switching to lower gear. After several months of research >>继续阅读

uva1587

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

Ivan works at a factory that produces heavy machinery. He has a simple job -- he knocks up wooden boxes of different sizes to pack machinery for delivery to the customers. Each box is a rectangular parallelepiped. Ivan uses six rectangular wooden pal >>继续阅读

uva1584

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

Some DNA sequences exist in circular forms as in the following figure, which shows a circular sequence CGAGTCAGCT", that is, the last symbol T" in CGAGTCAGCT" is connected to the first symbol C". We always read a circular sequence in the clockwise di >>继续阅读

uva1368

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

DNA (Deoxyribonucleic Acid) is the molecule which contains the genetic instructions. It consists of four different nucleotides, namely Adenine, Thymine, Guanine, and Cytosine as shown in Figure 1. If we represent a nucleotide by its initial character >>继续阅读

uva1339

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

Ancient Roman empire had a strong government system with various departments, including a secret service department. Important documents were sent between provinces and the capital in encrypted form to prevent eavesdropping. The most popular ciphers >>继续阅读

uva1225

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

Trung is bored with his mathematics homeworks. He takes a piece of chalk and starts writing a sequence of consecutive integers starting with 1 to N (1 < N < 10000) . After that, he counts the number of times each digit (0 to 9) appears in the s >>继续阅读

uva678

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

A number of K balls are dropped one by one from the root of a fully binary tree structure FBT. Each time the ball being dropped first visits a non-terminal node. It then keeps moving down, either follows the path of the left subtree, or follows the p >>继续阅读

uva455

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

A character string is said to have period k if it can be formed by concatenating one or more repetitions of another string of length k. For example, the string "abcabcabcabc" has period 3, since it is formed by 4 repetitions of the string "abc". It a >>继续阅读

uva401

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

A regular palindrome is a string of numbers or letters that is the same forward as backward. For example, the string "ABCDEDCBA" is a palindrome because it is the same when the string is read from left to right as when the string is read from right t >>继续阅读

uva272

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

TeX is a typesetting language developed by Donald Knuth. It takes source text together with a few typesetting instructions and produces, one hopes, a beautiful document. Beautiful documents use and " to delimit quotations, rather than the mundane "  >>继续阅读

uva232

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

A crossword puzzle consists of a rectangular grid of black and white squares and two lists of definitions (or descriptions).

One list of definitions is for words" to be written left to right across white squares in the rows and the other list is fo >>继续阅读