task stringlengths 0 154k | __index_level_0__ int64 0 39.2k |
|---|---|
Painting Blocks (Act II) (PAINTBLC)
n
blocks are put in a line. You have
k
(1 ≤
k
≤ 15) kinds of dope, the
i
-th dope is enough to paint c
i
(1 ≤ c
i
≤ 6) blocks. You may assume the sum of all the c
i
equals to
n
. Your task is to calculate the number of ways to paint the blocks with these kinds of dope, suc... | 31,400 |
Electrophoretic (ELECTRO)
Scientist Frank, majoring in electrochemistry, has developed line-shaped strange electrodes called F-electrodes.
During being activated, each F-electrode causes a special potential on and between the two lines touching the
F-electrode's endpoints at a right angle. Then electrically-charged ... | 31,401 |
Median Filter (FILTER)
The median filter is a nonlinear digital filter used to reduce noise in images, sounds, and other kinds of signals.
It examines each sample of the input through a
window
and then emits the
median
of the samples in the window.
Roughly speaking, a window is an interval that contains a target... | 31,402 |
Life Game (LIFEGAME)
You are working at a production plant of biological weapons. You are a maintainer of a terrible virus weapon
with very high reproductive power. The virus has a tendency to build up regular hexagonal colonies. So as a
whole, the virus weapon forms a hexagonal grid, each hexagon being a colony of ... | 31,403 |
Subdividing a Land (LAND)
Indigo Real-estate Company is now planning to develop a new housing complex. The entire complex is a square,
all of whose edges are equally
a
meters. The complex contains
n
subdivided blocks, each of which is a
b
-meter
square. Here both
a
and
b
are positive integers.
However t... | 31,404 |
Connect Line Segments (LINE)
Your dear son Arnie is addicted to a puzzle named
Connect Line Segments
.
In this puzzle, you are given several line segments placed on a two-dimensional area. You are allowed to add
some new line segments each connecting the end points of two existing line segments. The objective is t... | 31,405 |
Oil Company (OILCOMP)
Irving & Cohen Petroleum Corporation has decided to develop a new oil field in an area. A preliminary survey
has been done and they created a detailed grid map of the area which indicates the reserve of oil.
They are now planning to construct mining plants on several grid blocks according this... | 31,406 |
Finding the Top RPS Player (RPS)
A company "ACM Foods" is preparing for opening its chain shop in a certain area, but another company "ICPC
Pizza" is also planning to set up its branch shop in the same area. In general, two competitive shops gain less
incomes if they are located so close to each other. Thus, if both... | 31,407 |
Revenge of Voronoi (VORONOI)
A discrete Voronoi diagram is a derivation of a Voronoi diagram. It is represented as a set of pixels. Each of the
generatrices lies on the center of some pixel. Each pixel belongs to the generatrix nearest from the center of the
pixel in the sense of Manhattan distance. The Manhattan di... | 31,408 |
Castle Wall (WALL)
A new lord assumed the position by the death of the previous lord in a Far Eastern province.
The new greedy lord hates concave polygons, because he believes they need much wasted area to be drawn on
paper. He always wants to modify them to convex ones.
His castle is currently surrounded by a wa... | 31,409 |
Binary multiplication (MUL2COM)
English
Vietnamese
In this problem, you have to multiply two n-bit binary numbers in 2s complement form. The result should be also a n-bit binary number in 2s complement form. In case there is an arithmetic overflow, you program should be able to detect it.
For your information,... | 31,410 |
Help the soldier (SOLDIER)
Igor, a famous Russian soldier, must go to war in Afghanistan (we are in late 80’s). His superiors allowed him to buy himself his equipment. So, he must buy 6 items: helmet, bulletproof vest, trousers, boots, tunic and a firearm. This items are represented with numbers from 1 to 6. There ar... | 31,411 |
How many subsequences (SEQ5)
Tom has again maths, and the teacher writes countless tables with exercises.... so boring. Then he remembers an old problem of informatics that he thought in a dream. He remembered, he has a number of positive integers and the job was to know how many subsequences that have between L and U... | 31,412 |
Copying DNA (COPYDNA)
English
Vietnamese
Evolution is a seemingly random process which works in a way
which resembles certain approaches we use to get approximate
solutions to hard combinatorial problems. You are now to do
something completely different.
Given a DNA string S from the alphabet {A,C,G,T}, fin... | 31,413 |
Power Modulo Inverted (MOD)
Given 3 positive integers
x
,
y
and
z
, you can find
k = x
y
% z
easily, by fast power-modulo algorithm. Now your task is the inverse of this algorithm. Given 3 positive integers
x
,
z
and
k
, find the smallest non-negative integer
y
, such that
k % z = x
y
%z
.
Input
About... | 31,414 |
Dictionary Subsequences (DICTSUB)
You have a dictionary of strings, and you want to perform some queries on the strings. In particular, you're given a single string T, and for each word W in the dictionary, you want to determine if W is a subsequence of T.
A string B is a subsequence of a string C if you can remove ... | 31,415 |
Odd Numbers of Divisors (ODDDIV)
Given a positive odd integer K and two positive integers low and high, determine how many integers between low and high contain exactly K divisors.
Input
The first line of the input contains a positive integer C (0 < C < 100,000), the number of test cases to follow. Each case con... | 31,416 |
Charlesbert and Merangelou (GRAPHGAM)
Charlesbert and Merangelou are playing a two-player game on a game board. The game board consists of several circles, where some circles are connected to other circles. Charlesbert uses a game piece called the GoalPiece, and Merangelou uses a game piece called the ChasePiece.
Th... | 31,417 |
Longest Common Prefix (STRLCP)
The LCP (Longest Common Prefix) of two strings A[1..la] and B[1..lb] is defined as follows:
LCP(A[1..la], B[1..lb]) = max{L | L ≤ la && L ≤ lb && A[1..L] == B[1..L]}
Given an original string and several operations, you should write a program to process all the operations.
Inp... | 31,418 |
Palindromic Number (PALNUM)
A positive integer A is called a "palindrome number" if the reverse of the decimal representation is the same as the original one. For example 13231 is a palindrome number, but 13333 is not.
Given a number A (1 <= A <= 1e18), find the number of pairs (a, b) such that a and b are both pali... | 31,419 |
Stabards (STABARDS)
In a galaxy far far away, there exists a silicon based form of life, who call themselves stabards. Unlike humans, the stabards are multi-gendered. Therefore, when two stabards form a partnership (known as mating in earth parlance), one stabard would be the donor of genetic material and the other wo... | 31,420 |
Strings (STSTRING)
Given two strings A and B, we define the operator ĉ on {A, B} for string C as C ĉ {A, B}.
if length(A) < length(C) < length(B), then C satisfies the above operator.
else
if length(A)=length(C), then C must be lexicographically greater than A.
if length(B)=length(C), then C must be... | 31,421 |
Here We Go(relians) Again (GORELIAN)
The Gorelians are a warlike race that travel the universe conquering new worlds as a form of recreation. Given their violent, fun-loving nature, keeping their leaders alive is of serious concern. Part of the Gorelian security plan involves changing the traffic patterns of ... | 31,422 |
Permutation Exponentiation (PERMSG)
Alice, a permutation aficionado, has thought up a permutation of
N
(1 <=
N
<= 100000) integers in the range [0,
N
-1],
P
. So impressed with herself she has told her friend Bob about
P
.
Normally Alice would call it a day after creating such an impressive permutation but t... | 31,423 |
Game of Lines (LINES)
Farmer John has challenged Bessie to the following game: FJ has a board with dots marked at N (2 ≤ N ≤ 200) distinct lattice points. Dot i has the integer coordinates X
i
and Y
i
(-1,000 ≤ X
i
, Y
i
≤ 1,000).
Bessie can score a point in the game by picking two of the dots and drawing a strai... | 31,424 |
Doors and Penguins (DOORSPEN)
The organizers of the Annual Computing Meeting have invited a number of vendors to set up booths in a large exhibition hall during the meeting to showcase their latest products. As the vendors set up their booths at their assigned locations, they discovered that the organizers did not tak... | 31,425 |
Divisibility Relation (DIVREL)
English
Vietnamese
Given n positive integers. Your task is to select a maximum number of integers so that there are no two numbers a, b in which a is divisible by b.
Input
Line 1: n (1 ≤ n ≤ 200).
Line 2: n positive integers a
1
, a
2
, ..., a
n
(1 ≤ a
i
≤ 10
9
).
... | 31,426 |
Tree Construction (TREECST)
English
Vietnamese
Moles are tidy and hard-working animals. Our mole likes to keep its underground residence in utmost order, so that everyone living there knows where to find things.
To achieve this, the mole connected rooms with tunnels so that there is a single unique... | 31,427 |
Yet Another Longest Palindrome Problem (PALIM)
A string is called a palindrome if it's the same when read from left to right and from right to left. For example,
"abdba"
is a palindrome, but
"abbaa"
is not.
Given a string, print the length of the longest consecutive sequence of characters occurring at least once... | 31,428 |
Typesettin (TYPESET)
Modern fonts are generally of two varieties: outline fonts, whose glyphs
(the individual character shapes) are specified mathematically as a set of
curves, and bitmap fonts, whose glyphs are specified as patterns of pixels.
Fonts may also include embedded information such as kerning pairs (adju... | 31,429 |
Slink (SLINK)
Slitherlink is a puzzle published by Nikoli, the Japanese company that
popularized Sudoku. Slitherlink puzzles are gaining momentum, and books of
Slitherlink puzzles have started showing up around the world. The puzzles
are simple to understand, but can be challenging to solve. The puzzle is
... | 31,430 |
Electronic Document Security (EDS)
The Tyrell corporation uses a state-of-the-art electronic document system
that controls all aspects of document creation, viewing, editing, and
distribution. Document security is handled via
access control
lists
(ACLs). An ACL defines a set of entities that have access ... | 31,431 |
Guard (GUARD)
The Bluewater Security Company provides guards for clients with valuable possessions. Bluewater has found that clients are interested in having guards posted where they can see everything that is valuable merely by turning their heads, and also like guards to be posted particularly close to p... | 31,432 |
Race Against Time (RACETIME)
As another one of their crazy antics, the N (1 ≤ N ≤ 100,000) cows want Farmer John to race against the clock to answer some of their pressing questions.
The cows are lined up in a row from 1 to N, and each one is holding a sign representing a number, A
i
(1 ≤ A
i
≤ 1,000,000,000). The... | 31,433 |
K-query (KQUERY)
English
Vietnamese
Given a sequence of n numbers a
1
, a
2
, ..., a
n
and a number of k- queries. A k-query is a triple (i, j, k) (1 ≤ i ≤ j ≤ n). For each k-query (i, j, k), you have to return the number of elements greater than k in the subsequence a
i
, a
i+1
, ..., a
j
.
In... | 31,434 |
D-query (DQUERY)
English
Vietnamese
Given a sequence of n numbers a
1
, a
2
... a
n
and a number of d-queries. A d-query is a pair (i, j) (1 ≤ i ≤ j ≤ n). For each d-query (i, j), you have to return the number of distinct elements in the subsequence a
i
, a
i+1
... a
j
.
Input
Line 1: n (1 ≤ n ≤ 3... | 31,435 |
Order statistic set (ORDERSET)
English
Vietnamese
In this problem, you have to maintain a dynamic set of numbers which support the two fundamental operations
INSERT(S,x): if x is not in S, insert x into S
DELETE(S,x): if x is in S, delete x from S
and the two type of queries
K-TH(S) : retur... | 31,436 |
Roman Patrollers (SA04C)
In ancient times, patrollers were used to ensure that all the cities of the Roman Empire were
under control. A patroller’s job consisted in continuously visiting the cities of the empire, trying
to minimise the interval between two visits to each city. The Military Society (MS) wants to
sim... | 31,437 |
Very Special Boxes (SA04D)
Special Box Company (SBC) is a small family-owned and family-run business which produces decorated carton boxes for wrapping gifts. The boxes are hand-made, produced individually from fine materials. When accepting an order from a client, they always produce a few more boxes than needed, to k... | 31,438 |
Hex Tile Equations (HEXTILE)
An amusing puzzle consists of a collection of hexagonal tiles packed together with each tile showing a digit or '=' or an arithmetic operation '+', '-', '*', or '/'. Consider continuous paths going through each tile exactly once, with each successive tile being an immediate neighbor of the... | 31,439 |
The Bridges of San Mochti (BRIDGES2)
You work at a military training facility in the jungles of San
Motchi. One of the training exercises is to cross a series of rope
bridges set high in the trees. Every bridge has a maximum capacity,
which is the number of people that the bridge can support without
breaking. T... | 31,440 |
Bulletin Board (BULLETIN)
The ACM Student Chapter has just been given custody of a number of
school bulletin boards. Several members
agreed to clear off the old posters. They found posters
plastered many levels deep. They made a bet about
how much area was left clear, what was the greatest depth of posters on
top... | 31,441 |
Serial Numbers (SERIALN)
A manufacturer keeps an ordered table of serial numbers by listing in each row of the table a range of serial numbers along with two corresponding pieces of information called the status code and the transfer code. A four-column table stores information about ranges of serial numbers in this o... | 31,442 |
Umnozak (UMNOZAK)
The digit-product of a positive integer is the product of the number's decimal digits. For example, the digit-product of 2612 is 2 · 6 · 1 · 2 = 24.
The self-product of a number is the product of the number and its digit-product. For example, the self-product of 2612 is 2612 · 24 = 62688.
Write a... | 31,443 |
Doubled Numbers (DOUBLE)
Some numbers have a curious property: when rotating the number to the right,
the new number is the double of the original. Rotating the number to
the right means choosing the last digit and moving it to the beginning of the number,
as the leftmost digit. For example, the number 421052631578... | 31,444 |
Cestarine (HIGHWAY)
In a single day, N of Luka's trucks travel a specific highway. The highway has a number of exits and entrances. An exit with a particular number is in the same location as the entrance with that number.
Upon entering the highway, a truck driver receives a ticket which indicates the entrance he us... | 31,445 |
Stack (STACK)
Alan loves to construct a stack of building bricks. His stack consists of many cuboids with square
base. All cuboids have the same height 1. Alan puts the consecutive cuboids one over another.
Recently in math class, the concept of volume was introduced to Alan. Consequently, he wants to
compute the ... | 31,446 |
Digital Image Recognition (IMGREC2)
According to Wikipedia, image processing is any form of signal processing for which the input is an image, such as photographs or frames of video; the output of image processing can be either an image or a set of characteristics or parameters related to the image. Most image-process... | 31,447 |
Cavli (CAVLI)
English
Vietnamese
Mirko found a wooden board and N nails in his attic. Mirko hammered the nails into the board as fast
as possible. The board can be modeled by a coordinate plane and the nails as points in it. No two nails
have the same x or the same y coordinate.
In order to keep having fun, M... | 31,448 |
Setnja (SETNJA)
English
Vietnamese
In an infinite binary tree:
Each node has exactly two children – a left and a right child.
If a node is labeled with the integer X, then its left child is labeled 2*X and its right child
2*X+1.
The root of the tree is labeled 1.
A walk on the binary tree starts in... | 31,449 |
Svada (SVADA)
The local zoo has acquired a large open garden in which animals may freely move as in their natural
habitats and entertain visitors with their usual shenanigans.
The most popular animals are monkeys. With their climbing and jumping and other skills, they delight
old and young visitors alike.
One sp... | 31,450 |
Round Table (ROUNDT)
We have a round table with 2*N seats (1<= N <= 2000). The seats are numbered with the numbers from 1 to 2*N in order. This round table is in a round room with two doors. Door 1 is between seats 1 and 2N on the table, and door 2 is between seats N and N+1. We have 2N guests that we want to seat. Ea... | 31,451 |
Permutation Code (PERMCODE)
As the owner of a computer forensics company, you have just been given
the following note by a new client:
I, Albert Charles Montgomery, have just discovered the most amazing
cypher for encrypting messages. Let me tell you about it.
To begin, you will need to dec... | 31,452 |
Scavenger Hunt (SCAVHUNT)
Bill has been the greatest boy scout in America and has become quite a superstar because he
always organized the most wonderful scavenger hunts (you know, where the kids have to find a
certain route following certain hints). Bill has retired now, but a nationwide election quickly found
a s... | 31,453 |
Stamps (STAMPS)
Everybody hates Raymond. He’s the largest stamp collector on planet earth and because of that
he always makes fun of all the others at the stamp collector parties. Fortunately everybody loves
Lucy, and she has a plan. She secretly asks her friends whether they could lend her some stamps,
so that she... | 31,454 |
Parking Lot (PARKINGL)
At a certain college, a small parking lot is arranged in a rectangular shape, with 20 spaces numbered
1, 2, 3 ... 19, 20. Traffic flow is one way in a counter- clockwise direction. The lot looks something
like this:
Note that the first position encountered upon entering is 1 and the last i... | 31,455 |
A Bug’s Life (BUGLIFE)
Professor Hopper is researching the sexual behavior of a rare species of bugs. He assumes that
they feature two different genders and that they only interact with bugs of the opposite gender. In
his experiment, individual bugs and their interactions were easy to identify, because numbers were
... | 31,456 |
String Shuffle (SSHUFFLE)
Given three strings consisting of just lowercase letters, count the number of ways that the third
string can be constructed by combining two subsequences from the first two strings.
One derives a subsequence of the string by deleting zero or more characters from a string. For
example, “”,... | 31,457 |
Tourist (TOURIST)
A lazy tourist wants to visit as many interesting locations in a city as possible without going one
step further than necessary. Starting from his hotel, located in the north-west corner of city, he
intends to take a walk to the south-east corner of the city and then walk back. When walking to
the... | 31,458 |
Highways (HIGHWAYS)
A number of cities are connected by a network of highways. Each highway is bidirectional and
connects two cities, with a given travel time. What is the shortest time to get from a given city to
another given city?
Input
The first line of input contains the number of test cases.
Each test ... | 31,459 |
Monster Trap (MONSTER)
Once upon a time when people still believed in magic, there was a great wizard Aranyaka Gondlir.
After twenty years of hard training in a deep forest, he had finally mastered ultimate magic, and
decided to leave the forest for his home.
Arriving at his home village, Aranyaka was very surpri... | 31,460 |
Yoda Goes Palindromic ! (YODA)
According to a very famous web site, which in this case we will trust, defines a palindrome
as ‘a word, phrase, verse, or sentence that reads the same backward or forward’. For
example, the phrase A man, a plan, a canal, Panama! is a palindrome. Actually, writing
texts consisting of o... | 31,461 |
Changing Maze (CHMAZE)
Luke Skywalker and his sister/love interest Leia are trying to get through a killer maze. And I
mean killer! Every time step, the boundaries change. If our twins/lovebirds ever visit a square the
same time a boundary appears, they’re toast. There is no need to panic; the Force will guide them
... | 31,462 |
Double Near Palindromes (DNPALIN)
C-3PO is an expert in pretty much every language. His conversation with R2-D2 are always fun to
observe in that R2-D2 speaks in Droid, C-3PO speak in English, and they understand each other
perfectly! Anyway, humans and droids both enjoy playing word games. A palindrome is a word or... | 31,463 |
The Knights of the Round Circle (KNIGHTSR)
A group of Jedi Knights is having a competition. One of the Knights at random stands
within a circle. The other Knights, in a random order, challenge him. If a challenger defeats
the Knight of the Round Circle, that Knight must leave the contest. The challenger
then become... | 31,464 |
Tribe Council (TRIBE2)
The Kazooba tribe contains N men, who want to gather for a tribe council. The men are all descendants of a single one, who is the chief of the tribe. Since the people of this tribe are quite long lived, every person's ancestors, including the chief, are alive and will be attending the council.
... | 31,465 |
Knot or Not (NOTOKNOT)
Disentangling of string loops is a classical 3D-puzzle. A designer of one of these puzzles wants
to know if two given string loops can be disentangled or not.
The designer says that a string loop configuration that can be disentangled is a Notknot. In
fact, he says that knots are those strin... | 31,466 |
Lagrange’s Four-Square Theorem (LAGRANGE)
The fact that any positive integer has a representation as the sum of at most four positive squares (i.e. squares of positive integers) is known as Lagrange's Four-Square Theorem. The first published proof of the theorem was given by Joseph-Louis Lagrange in 1770. Your mission... | 31,467 |
Almost Shortest Path (SAMER08A)
Finding the shortest path that goes from a starting point to a destination point given a set of points and route lengths connecting them is an already well known problem, and it's even part of our daily lives, as shortest path programs are widely available nowadays.
Most people usually... | 31,468 |
Bases (SAMER08B)
What do you get if you multiply 6 by 9? The answer, of course, is 42, but only if you do the calculations in base 13.
Given an integer
B
≥ 2, the
base
B
numbering system
is a manner of writing integers using only digits between 0 and
B
-1, inclusive. In a number written in base
B
, the righ... | 31,469 |
Candy (SAMER08C)
Little Charlie is a nice boy addicted to candies. He is even a subscriber to All Candies Magazine and was selected to participate in the International Candy Picking Contest.
In this contest a random number of boxes containing candies are disposed in
M
rows with
N
columns each (so, there are a t... | 31,470 |
DNA Sequences (SAMER08D)
Thomas, a computer scientist that works with DNA sequences, needs to compute longest common subsequences of given pairs of strings. Consider an alphabet Σ of letters and a word
w
=
a
1
a
2
…
a
r
, where
a
i
∈ Σ, for
i
= 1, 2, …,
r
. A
subsequence... | 31,471 |
Electricity (SAMER08E)
Martin and Isa stopped playing crazy games and finally got married. It's good news! They're pursuing a new life of happiness for both and, moreover, they're moving to a new house in a remote place, bought with most of their savings.
Life is different in this new place. In particular, electrici... | 31,472 |
Feynman (SAMER08F)
Richard Phillips Feynman was a well known American physicist and a recipient of the Nobel Prize in Physics. He worked in theoretical physics and also pioneered the field of quantum computing. He visited South America for ten months, giving lectures and enjoying life in the tropics. He is also know... | 31,473 |
Pole Position (SAMER08G)
In car races, there is always a high pole next to the finish line of the track. Before the race starts, the pole is used to display the starting grid. The number of the first car in the grid is displayed at the top of the pole, the number of the car in second place is shown below that, and so ... | 31,474 |
Higgs Boson (SAMER08H)
It's been 100 years since the detection of the first Higgs boson and now particle physics is a mainstream subject in all high schools. Obviously, kids love the fact that they can create tiny black holes using only their portable particle accelerators and show off to their friends and colleagues.... | 31,475 |
Traveling Shoemaker Problem (SAMER08I)
Once upon a time there was a very peaceful country named Nlogonia. Back then, Poly the Shoemaker could come to the country and travel freely from city to city doing his job without any harassment. This task was very easy, as every city in Nlogonia had a direct road to every othe... | 31,476 |
Bora Bora (SAMER08J)
Bora Bora is a simple card game for children, invented in the South Pacific Island of the same name. Two or more players can play, using a deck of standard cards. Cards have the usual ranks: Ace, 2, 3, 4, 5, 6, 7, 8, 9, 10, Jack, Queen and King. Each card has also one of four suits: Clubs, Diamond... | 31,477 |
Shrinking Polygons (SAMER08K)
A polygon is said to be
inscribed
in a circle when all its vertices lie on that circle. In this problem you will be given a polygon inscribed in a circle, and you must determine the minimum number of vertices that should be removed to transform the given polygon into a
regular poly... | 31,478 |
Falling Ice (FALLINGI)
Imagine disks of ice falling, one at a time, into a box, each ending
up at the lowest point it can reach without overlapping or moving
previous disks. Each disk then freezes into place, so it cannot
be moved by later disks. Your job is to find the
overall height of the final combination of... | 31,479 |
Ouroboros Snake (OROSNAKE)
Ouroboros is a mythical snake from ancient Egypt. It has its tail in its mouth and continuously devours itself.
The Ouroboros numbers are binary numbers of 2^n bits that have the property of "generating" the whole set of numbers from 0 to 2^n - 1. The generation works as follows: given a... | 31,480 |
Histogram (HIST2)
In statistics, a histogram is a graphical display of tabulated frequencies, shown as bars.
It shows what proportion of cases fall into each of several categories. It is a polygon composed of a sequence of rectangles aligned at a common base line. In this problem all rectangles have a width of unit ... | 31,481 |
The last digit (LASTDIG)
Nestor was doing the work of his math class about three days but he is tired of make operations a lot and he should deliver his task tomorrow. His math’s teacher gives him two numbers a and b. The problem consist of finding the last digit of the potency of base a and index b. Help Nestor with ... | 31,482 |
SkyScrapers (CEPC08B)
In a seaside village, there is an avenue of skyscrapers. Each skyscrapers is 100m wide and has certain
height. Due to very high price of parcels, any two consecutive skyscrapers are adjacent. The avenue lies
close to the beach so the street is exactly at the sea level.
Unfortunately, this year... | 31,483 |
Song Contest (SONG)
Every year, the continent of Cacophonea organises the Cacophonean Song Contest, for which each
of its nations presents an act by a national singer or group. Each Cacophonean inhabitant may
televote for any act which is not from his nation, so a nation can never vote for its own act. In
the end, ... | 31,484 |
The Skatepark´s New Ramps (RAMP)
The local skating park has been given a financial incentive by the city to make the park interesting for skaters of all levels. The park wants to use the incentive to build a series of ramps, somewhat resembling a mountain range. When talking to some of the volunteers in the committee ... | 31,485 |
Robintron (ROBIN)
It is during the great war in the year 2240 that the Robinson family decides to leave the human
empire, in search for more peaceful and quiet places. The Robinsons already have a planet in
mind to which they wish to travel and want to get there as soon as possible. However, because
all vehicles ca... | 31,486 |
Clock (CLOCK1)
Calculate the number of times the 29-th day (if exists) of the month will be on a Saturday throughout year
N
. (2000 <=
N
<= 3000)
Solve this problem by at most 256 Bytes of source code.
The judge of this problem is "Exact judge".
Input
Each line contains one integer
N
. Input terminates by... | 31,487 |
Drive through MegaCity (DRIVE)
MegaCity of the future is a rectangular grid of streets. Each intersection has integer Cartesian coordinates x and y. To get from intersection a with coordinates x
a
, y
a
to intersection b with coordinates x
b
, y
b
you need to drive exactly | x
a
- x
b
| + | y
a
- y
b
| blocks. U... | 31,488 |
Another Longest Common Subsequence Problem (CS)
Given a non-negative integer
X
. Calculate the smallest non-negative integer
Y
, such that
Y
≤
X
, and the length of the longest common subsequence (not necessarily continuous) of
string(Y)
and
string(X-Y)
is maximum possible, where
string(T)
denotes the decim... | 31,489 |
Deposit (DEPOSIT)
Banks offer deposit schemes of various kinds to attract customers. In an r -year progressively reducing recurring deposit scheme (PRRDS) of a bank, a customer is required to deposit progressively reducing amounts every year for r years. Depending on the duration r of the scheme and the total amount... | 31,490 |
Baby (BABY)
A baby tries to solve the well-known eight-queen puzzle: the problem of placing eight chess queens on an 8×8 chessboard so that no two queens share the same row, column, or diagonal. The baby understands the concept of row and column quite well but diagonal is not very clear to her. As a result she succee... | 31,491 |
Alias (ALIAS)
Alias is an assumed or additional name that constitutes a distinctive designation of a person. Consider a set of n persons and assume that each person has k distinct aliases. A person is identified using any one of its k aliases. The nk (= n×k) distinct aliases are identified using integers 1, 2,...... | 31,492 |
Begin (BEGIN)
Begin a sequence of distinct natural numbers Ni, i = 0, 1, 2 ... with the number B (= N0) ; generate numbers Ni, i = 1, 2 ... recursively and end the sequence with the last generated number E. The characteristic of numbers and the process for generation are stated below:
Each number in the sequence ... | 31,493 |
Crossbits (CROSSBIT)
Crossbits are like Crosswords; instead of entering words you enter binary bits 01 in a Crossbit under certain given conditions, assuming that a solution exists. An empty Crossbit of size N is an empty grid of size N×N.
Given a natural number N , consider entering N
2
binary bits in an empty C... | 31,494 |
Disputes (DISPUTES)
Disputes between two warring parties over possession of properties are often settled amicably with the intervention of a third party. You are required to write a program on behalf of a consultancy firm that settles disputes amicably over possession of properties between two warring parties.
The... | 31,495 |
Elimination (ELIM)
Elimination of contestants from a live IQ contest on a TV channel is decided in phases.
Initially at phase 0,
N
contestants, where
N
= 2
n
,
n
< 10, are selected through a special online IQ contest in which a total of
M
(
M
>
N
) contestants participate. The contestants are identified by... | 31,496 |
The Top-Code (TOPCODE)
A word is a string of two or more letters while a code is a string of one or more distinct words
in lexicographic order. Thus a string of letters may represent either a word or
a code. An optimum code is a code that contains the maximum number of words.
For a given string of letters there m... | 31,497 |
Hidden Triangle (HIDTRI)
Assume that each '
0
' or '
1
' in the array represents a point on a plane and the distance
between each pair of neighbouring
points row wise or column wise is unity. Assume further that every
neighbouring pair of
1
's,
row wise, column wise or diagonally is connected by a line segment. T... | 31,498 |
Braille Transcription (BRAILLE)
Visually handicapped people use Braille
system of codes for reading and writing. The basic Braille symbol (or cell) is
composed of six dots arranged in two vertical columns, each column being three
dots high. This pattern produces 64 one-cell symbols with character index
Ma... | 31,499 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.