task stringlengths 0 154k | __index_level_0__ int64 0 39.2k |
|---|---|
Colorful Trees
Description:
Given a tree with colored vertices, for each edge, how many
pairs of vertices with the same color have that edge on the
path between them? Note that since it’s a tree, each pair of
nodes has exactly one path between them.
## Input
The first line of input contains a single inte... | 26,900 |
Coloring Graphs
Description:
There is one problem, as you can imagine: there is no money
to train teachers to grade these students’ submissions! Thus,
your task is to write a program that computes the sample
solutions for the graphs given on each work sheet!
## Input
The input consists of a description o... | 26,901 |
Coloring Socks
Description:
Having discolored his white socks in a rather beige shade
(as seen on the picture), Luktas Svettocek realised he can’t
just throw all his laundry into one machine and expect it to
retain its original colors. However, he is also too lazy to do
his laundry in several rounds. H... | 26,902 |
Colorland
Description:
Yancy is designing a new board game called Colorland. The
rules of Colorland are as follows:
* Colorland’s board is a linear sequence of $N+1$ squares. The first square is
a special start square, the remaining $N$ squares are colored blue,
orange, pink, green, red, or yellow... | 26,903 |
Colosseum of Fools
Description:
Deep in the caverns of a fallen kingdom, lies a sacred
battleground for warriors all across the lands to test their
skills. Tonight, $b$ bugs
have come to the arena to challenge the trials the Colosseum
holds. To assist them in their battles, each bug wields several
... | 26,904 |
Colour Wars
Description:
A school is having a vote in what their primary school
colour should be. While counting the votes, the principal of
the school accidentally lost count of how many students there
were. He then asked $N$
distinct students “How many other students voted for the same
colour as ... | 26,905 |
Colourful Graph
Description:
Consider an undirected graph on $n$ vertices. A $k$-colouring of the graph is simply
an assignment to each vertex one of the $k$ colours. There are no other
restrictions – two vertices can get the same colour even if
they are connected by an edge.
You are given two $k$-colouri... | 26,906 |
Colourful New World
Description:
You may be familiar with the philosophical thought
experiment referred to as Mary’s Room. If not, it goes as
follows:
Mary is a scientist who has lived in a black and white room
her entire life. She has also spent her whole life studying
biological colour perception an... | 26,907 |
Colouring Book
Description:
The Ministry of Trigonometric Artistry (or MTA for short) is
producing a colouring book to get children interested in
trigonometry at a young age. The colouring book consists of
many pages. On each page is a set of numbered dots that are to
be connected with straight line se... | 26,908 |
Combination Lock
Description:
Now that you’re back to school for another term, you need to
remember how to work the combination lock on your locker. A
common design is that of the Master Brand, shown at right. The
lock has a dial with $40$
calibration marks numbered $0$ to $39$ with $0$ at the top and ... | 26,909 |
Combinatorial Stanley Cup
Description:
You have always dreamt to get your name on the Stanley Cup,
but you have never played hockey. A friend of yours heard of an
alternative: the Combinatorial Stanley Cup! If you solve a
single programming problem, you will get your name on this
purely fictional troph... | 26,910 |
Comma Sprinkler
Description:
Dr. Sprinkler’s rules for adding commas to an existing
piece of text are as follows:
* If a word anywhere in the text is preceded by a comma,
find all occurrences of that word in the text, and put a
comma before each of those occurrences, except in the case
whe... | 26,911 |
Commemorative Race
Description:
Filiberto is planning a race to celebrate the 2019 ICPC
Mid-Central Regional. The racers compete by going down a
mountain on a set of roads. As it would be dangerous to have
cars speeding at each other in opposite directions, racers may
only drive downhill on each road i... | 26,912 |
Committee Assignment
Description:
You are the chair of a large department, and, as such, it’s
your job to assign department members to committees. Everyone
has to be on exactly one committee, but some department members
don’t get along and cannot be assigned to the same committee.
Of course, you would ... | 26,913 |
Common Factors
Description:
Everyone likes to share things in common with other
people.
Numbers are the same way! Numbers like it when they have a
factor in common.
For example, $4$ and
$6$ share a common factor
of $2$, which gives them
something to talk about.
For a given integer $n$, we define... | 26,914 |
Common Ground
Description:
Quibble Pants recently met his “special somepony” Clear Sky.
To get closer to her, he wants to spend some quality time
together with her daughter, Wind Sprint.
Unfortunately, while Wind Sprint is a huge sportspony,
Quibble is anything but. Today, in an attempt to find some
c... | 26,915 |
Common Subexpression Elimination
Description:
Let the set $\Sigma $
consist of all words composed of 1–4 lower case letters, such
as the words “a”, “b”, “f”, “aa”, “fun” and “kvqf”. Consider
expressions according to the grammar with the two
rules
for every symbol $f \in \Sigma
$. Any expression ca... | 26,916 |
Communicating The Strategy
Description:
This is an interactive problem.
During a Pokenom battle, a Pokenom trainer must come up with
a strategy and communicate the strategy to his Pokenom in a
very efficient way.
To become the best Pokenom trainer, Bash is practicing how
to communicate the strategy to hi... | 26,917 |
Communication Line
Description:
This problem requires you to write a program which does
three tasks which might facilitate the use of a communication
line. The first task is that of translating from one set of
codes to another. The second task is to compress 80-character
lines to a smaller size by comp... | 26,918 |
Communication Matters
Description:
Satsuki and Mei both have to guess a secret number. Satsuki
is trying to guess $a$ and
Mei is trying to guess $b$. Both $a$ and $b$ can take values between
$1$ and $n$. Satsuki and Mei know the joint
probabilities of their secret numbers being a specific
number.
... | 26,919 |
Communications Satellite
Description:
The Johnson Space Center has hired you to design NASA’s new
communications satellite! The satellite, consisting of a set of
dish antennas held together with titanium beams, must meet
NASA’s exacting specifications, but a lot of the design is up
to you.
Specificall... | 26,920 |
Company Picnic
Description:
Each year, your employer hosts a company picnic. This event
features a three-legged race, a race where two runners work as
a team, running side-by-side with the legs between them tied
together. It is more difficult to run like that, so teams run
at a speed that is the minimu... | 26,921 |
Comparator
Description:
Many programming languages let you define custom comparators
to sort user-defined objects.
IFFY is a programming language where the only programs are
functions intended to be comparators. These functions operate
on bitstrings, hereafter called “words”. Words are 1-indexed
start... | 26,922 |
Comparing Answers
Description:
In a place in Southwestern Europe, the name of which I do
not wish to recall, not long ago there were $n$ cities connected by unidirectional
roads, with possibly more than one road connecting a city to
another one, or even to itself. As a homework assignment for
your geog... | 26,923 |
Compass Card Sales
Description:
To decide how unique a card is in the deck, she proceeds as
follows. For each of the three colors she finds the closest
other card in both directions, and then computes the angle
between these two other cards. For instance if she has three
cards with red angles $42$, $90... | 26,924 |
Compensation
Description:
In the free-market, ruthlessly capitalist world of train
fares, only one thing matters: incentives.
Train companies are incentivised with bonuses for high
throughput, successful journeys, and customer satisfaction.
Conversely, the companies are disincentivised from failure via
... | 26,925 |
Competitive Arcade Basketball
Description:
You’re attending a arcade basketball competition, where the
objective is to score as many points as possible until the time
runs out. The announcer has informed the crowd that their
scoreboard is broken, so they don’t have a way to keep track of
all the scores... | 26,926 |
Compiler
Description:
One thing almost all computers have in common, whether it is
a simple stack-based calculator, a 6502 powered BBC Micro, or a
brand new Android phone, every modern computer requires
programs that turn either high-level languages or assembly
language into machine code.
UKIEPC recen... | 26,927 |
Completing the Square
Description:
In the heart of your home city, there is an old square,
close to the train station, appropriately called Station
Square. It used to look like a perfect square: four sides
of equal length joined by right angles. However, it hasn’t
looked like this for decades, as one o... | 26,928 |
Composed Rhythms
Description:
Rhythm is an important part of music and it is crucial for
aspiring musicians to gain understanding of it. As the skill of
the musician advances, more complex rhythms are introduced to
them. To ease the learning of musical passages, a method of
simplifying rhythms can be h... | 26,929 |
Compositions
Description:
A composition of an integer
$n$ is an ordered set of
integers which sum to $n$.
Two compositions with the same elements
but in different orders are considered different (this
distinguishes compositions from
partitions). For example, all the compositions of the first fe... | 26,930 |
Compound Words
Description:
Write a program that reads a list of words from standard
input and prints out a sorted list of all unique compound words
that can be made by concatenating two different words from the
input list. If the same compound word can be formed more than
one way, it should only be li... | 26,931 |
Compression
Description:
You have a list $x_1,\dots ,x_
N$ of natural numbers and would like to encode it in a
particular compressed format while minimizing the size of the
compressed file. The compressed format consists of a string of
bits (0 or 1), which is divided into contiguous blocks of
varia... | 26,932 |
Compression
Description:
If there are multiple choices of repeating consecutive
substrings to remove, DRY should choose in a way that results
in the shortest possible final string. For example, in the
string “ABBCDCABCDCD”, DRY has two
choices — either removing the repeated “B” near the beginning, or t... | 26,933 |
Concentration
Description:
Concentration is a not so popular 2 player card game of both
skill and luck. The standard Concentration game is played with
one or two 52-card decks, however, for the sake of the problem,
we will look at a variation of Concentration.
The rules are as follows:
* A card is repres... | 26,934 |
Concert Rehearsal
Description:
A class of $n$ music
students are going to rehearse for a concert in a recital hall.
In one rehearsal pass, each student will give one performance
in order from student $1$
to student $n$. Student
$i$’s performance has a
duration of $d_ i$. After
the last stud... | 26,935 |
Condorcet
Description:
Consider an election where there are some candidates, one
winner, and each voter has a complete ranked preference of the
candidates. One possible method of determining the winner is to
examine each pair of candidates and see which would win in a
head-to-head matchup (i.e., which ... | 26,936 |
Confined Catching
Description:
You are playing a board game against an AI on a square grid
consisting of $n\times n$
cells. You have two game pieces and the AI has one, and each
piece is placed in one of the grid cells. Your goal is to
“catch” the AI’s piece, that is, one (or both) of your pieces
h... | 26,937 |
Conformity
Description:
Frosh commencing their studies at Waterloo have diverse
interests, as evidenced by their desire to take various
combinations of courses from among those available.
University administrators are uncomfortable with this
situation, and therefore wish to offer a conformity
prize to... | 26,938 |
Conga Line
Description:
There’s currently a dance party being held in a nondescript
location. The party is joined by $N$ couples. To liven up the party,
the host, who is not dancing, has decided to perform a conga
line. As such, the host asks all the couples to stand in one
line.
At first, each couple... | 26,939 |
Connect
Description:
When constructing electric circuits one has to connect pairs
of points using wire, preferable as short as possible. In this
problem we have an empty circuit board of size $N \times M$ where we want to connect
the two points $A_1$ and
$A_2$ with each other
using one wire, and th... | 26,940 |
Connect Five
Description:
In the town of Nattanham, all roads run either north to
south, or east to west, and span the entire town. Furthermore,
all roads are an equal distance apart. This makes navigating
the town extremely easy.
Unfortunately, the roads are quite poor and could do with a
fresh layer... | 26,941 |
Connect the Dots
Description:
Write a program to read in a visual description of a
connect-the-dots puzzle, then connect the dots and print the
result.
## Input
Input contains up to $100$ images. Each image is
rectangular and has dots indicated by the symbols $0, 1, \ldots , 9$, a, b, …, z, A, B,
…, ... | 26,942 |
Connect the Dots
Description:
A famous logical problem is that of connecting 9 dots on a
paper by drawing 4 line segments with a pencil, while never
lifting the pencil from the paper. While this is easy enough
(although it requires some thinking outside of the box), Simone
has recently been building a ... | 26,943 |
Connect-N
Description:
A popular connection game that is well-known around the
world is Connect Four. In this two-person game, each player is
assigned a colored disc (red or blue) and takes turns dropping
one of their colored discs from the top into a seven-column,
six-row vertically upright game board... | 26,944 |
Connectedness
Description:
You are given an undirected graph $G=(V,E)$.
If you are drawing in the edges one by one, how many edges
did you add when the graph becomes connected for the first
time.
If the graph never becomes connected after drawing all the
edges, output -1.
Here are some useful definition... | 26,945 |
Connecting Computers
Description:
The tech team is gearing up for the PacNW Regional! There
are $n$ computers that
need to be connected together for the contest, isolated from
the outside internet. There are $m$ bidirectional connections between
computers, each connection requiring one of $k$ different... | 26,946 |
Conquer The World
Description:
Bwahahahahaha!!! Your nemesis, the dashingly handsome spy
Waco Powers, has at last fallen to your secret volcano base’s
deathtraps (or so you assume, being a little too busy to
witness it firsthand). At long last, you are all set to
Conquer The World!
Nothing will stand ... | 26,947 |
Conquest
Description:
Nomads, Kingdoms, and Tribes are on the islands of the great
seas. Bridges span between islands allowing travel between
them. It is possible to get from every island to every other
island through some sequence of bridges. The islands were at
peace until everything changed when the... | 26,948 |
Conquest Campaign
Description:
Since the beginning of $30$-th century, the Country of
Circles has become the strongest country in the world. To
expand its territory to the west, they plan to invade the
Country of Rectangles.
The territory of the Country of Rectangles is represented by
a $R \times C$ t... | 26,949 |
Consecutive Prime Sums
Description:
You are given a positive integer $n$ and should print the prime number
$< n$ that can be
written as the sum of the greatest number of consecutive
primes.
For example $41$ can be
written as $2 + 3 + 5 + 7 + 11 +
13$ and it can be seen that $41$ is the prime $< n$... | 26,950 |
Conservation
Description:
The most famous painting in Byteland—a portrait of a lady
with a computer mouse by Leonardo da Bitci—needs to be
conserved. The work will be conducted in two narrowly
specialized laboratories. The conservation process has been
divided into several stages. For each of them, we ... | 26,951 |
Constellation Creation
Description:
As you journey further into space, the relative positions of
the stars have shifted so much that you can no longer recognize
the constellations that you’ve learned about growing up. This
makes for a great opportunity – now you can come up with your
own constellations... | 26,952 |
Constrained Freedom of Choice
Description:
You live in a rectangular grid of ASCII characters. Your
home is in the lower left corner and you work in the upper
right corner. Sidewalks look like periods (.) and buildings, cars, trash cans and other
obstacles look like pound signs (#). You
walk to work ea... | 26,953 |
Construction Toy
Description:
Alaa fondly remembers playing with a construction toy when
she was a child. It consisted of segments that could be
fastened at each end. A game she liked to play was to start
with one segment as a base, placed flat against a straight
wall. Then she repeatedly added on tria... | 26,954 |
Construction Worker
Description:
To build the tallest tower, SoCCat needs a lot of cat
dollars. SoCCat plans to make money by taking on construction
jobs optimally.
There are $n$ companies
that periodically offer construction jobs every $T$ cat days. Company $i$ offers a construction job at the
beginn... | 26,955 |
Consulting Gigs
Description:
In the computer-generated world Matriks, you work as a
consultant for some hip IT companies that need unique slides
for their cool office spaces. During the past year, you got a
number of job offers at different points in time, measured in
milliseconds since the start of th... | 26,956 |
Contact Tracing
Description:
A deadly virus is sweeping across the globe! You are part of
an elite group of programmers tasked with tracking the spread
of the virus. You have been given the timestamps of people
entering and exiting a room. Now your job is to determine how
the virus will spread. Hurry u... | 26,957 |
Contact Tracing
Description:
A novel infectious disease has started spreading through the
population. You are tasked with figuring out who might be
infected in order to get them to quarantine. The behavior of
the disease among members of the population is as follows:
* When a person comes into contact wit... | 26,958 |
Containment
Description:
A $10 \times 10 \times
10$ three-dimensional grid of tightly packed cubic
atomic energy cells aboard the starship Fiugtuwf is reporting
failures on several of its cells. The ship’s engineer must set
up enclosures that will contain all of the cells that are
reported to be fa... | 26,959 |
Contest Advancement
Description:
You are the RCD for your regional contest. It just ended and
you now need to decide which teams qualify for the next level
of competition. The teams are uniquely ranked (there are no
ties). The next level has a limit on how many teams from any
given school can participa... | 26,960 |
Contest Construction
Description:
The ICPC NAC staff have written a number of problems and
wish to construct a problem set out of them. Each problem has a
positive difficulty rating.
A contest has a Nice difficulty distribution if,
when the difficulties of the problems are sorted in ascending
order, e... | 26,961 |
Contest Struggles
Description:
She recalls hearing the judges talk about the difficulty of
the problems, which they rate on an integer scale from
$0$ to $100$, inclusive. In fact, one of the
judges said that “the problem set has never
been so tough, the average difficulty of the problems in the
pro... | 26,962 |
Contingency Planning
Description:
Taking that internship in a remote mountain may not have
been the best idea. Pulling that lever with the skull symbol
just to see what it did was not so smart either. But now is not
the time for regrets because you need to find a way to prepare
for these mutant zombies... | 26,963 |
Continued Fraction
Description:
where $a_0, a_1, a_2, \dots
$ are integers and $a_1,
a_2, \dots > 0$. We call the $a_ i$-values partial quotients. For example, in the continued
fraction representation of $5.4$, the partial quotients are
$a_0 = 5, a_1 = 2, a_2 =
2$. This representation of a real num... | 26,964 |
Continuous Median
Description:
In Statistics, the median of an array $\textbf{A}$ of $\textbf{N}$ integers is a value which
divides array $\textbf{A}$
into two equal parts: the higher half and the lower
half.
In the case when $\textbf{N}$ is odd, the median is
clearly defined: the middle value of the ... | 26,965 |
Conversation Log
Description:
Popular social networking site My+Din is struggling to
manage its many popular forums. Recent regulation requires the
site to report users engaged in conversations about certain
topics. The sheer number of users means manual monitoring is
too costly and so the site has ask... | 26,966 |
Converting Romans
Description:
The Roman numerals are a numeral system that originated in
ancient Rome and was widely used throughout Europe well into
the Late Middle Ages. It differs from the Arabic system that we
mostly use today in that numbers are written with combinations
of letters from the Latin... | 26,967 |
Convex Contour
Description:
A number of geometric shapes are neatly arranged in a
rectangular grid. The shapes occupy consecutive cells in a
single row with each cell containing exactly one shape. Each
shape is either:
* a square perfectly aligned with the grid square,
* a circle inscribed in the grid sq... | 26,968 |
Convex Hull
Description:
## Input
Input contains several test cases. Each test case begins
with an integer $n$
($1 \leq n \leq 10000$).
Then follow a list of $n$
points, one per line, each of the form $x\ y$. Coordinates are integer with
absolute value bounded by 10000. The input is terminated by ... | 26,969 |
Convex Hull
Description:
Finding the convex hull of a set of points is an important
problem that is often part of a larger problem. There are many
algorithms for finding the convex hull. Since problems
involving the convex hull sometimes appear in the ACM World
Finals, it is a good idea for contestants... | 26,970 |
Convex Hull Extension
Description:
Dr. Hugh Klidd is a geometry expert who has recently become
preoccupied with convex hulls. Recall that for a set of points
in the $x\textrm{-}y$
plane, the convex hull is the smallest convex polygon
containing all of those points. (A convex polygon has the
propert... | 26,971 |
Convex Polygon Area
Description:
For this problem, you just need to be able to calculate the
area of convex polygons.
## Input
Input starts with an integer $1 \le n \le 100$, indicating the
number of convex polygons. The next $n$ lines each contain one convex
polygon description. Each begins with an inte... | 26,972 |
Conveyor Belts
Description:
Your factory has $N$
junctions (numbered from $1$ to $N$) connected by $M$ conveyor belts. Each conveyor belt
transports any product automatically from one junction to
another junction in exactly one minute. Note that each conveyor
belt only works in one direction. There can... | 26,973 |
Conveyor Belts
Description:
You are an employee of the Boxing And Processing Company and
you are tasked with distributing boxes in one of the company’s
enormous warehouses. At BAPC Ltd., boxes travel by conveyor
belt. Two conveyor belts can be merged into one by letting one
drop its content onto the ot... | 26,974 |
Convoy
Description:
You and your friends have gathered at your house to prepare
for the Big Game, which you all plan to attend in the afternoon
at the football stadium across town. The problem: you only have
$k$ cars between you, with
each car seating five people (including the driver), so you
migh... | 26,975 |
Cookie Cutter
Description:
Everyone loves chocolate chip cookies! Which unfortunately
means sharing sometimes. In this case, you have generously
agreed to split a square chocolate chip cookie with your
friend.
Because it is your cookie, you get to choose how to cut the
cookie, and which piece to give ... | 26,976 |
Cookie Cutters
Description:
Theta likes to bake cookies for the upcoming holidays. She
has a selection of cookie cutters of different shapes and
sizes. She thinks it’s unfair that some shapes are larger than
others – because even if everyone gets the same number of
cookies, some will end up with more d... | 26,977 |
Cookie Game
Description:
Gustav and Oskar found some cookies in the base, so they put
them in a line on the table and numbered them $1$ to $n$ from left to right. Cookie number
$i$ takes $a_ i$ bites to eat. Gustav and Oskar
want to eat the cookies, but they couldn’t agree on how to
divide the cookies ... | 26,978 |
Cookie Selection
Description:
As chief programmer at a cookie production plant you have
many responsibilities, one of them being that the cookies
produced and packaged at the plant adhere to the very demanding
quality standards of the Nordic Cookie Packaging Consortium
(NCPC).
At any given time, your ... | 26,979 |
Cookies
Description:
Ann Britt-Caroline has $N$ different types of cookies. She
has $A_ i$ cookies of type
$i$. Now, Ann is wondering
how many cookies she has in total.
## Example
In this example, we have $N =
3$ different types of cookies. The number of cookies of
each type is $3, 1,
5$.
As... | 26,980 |
Cooking Water
Description:
“A watched pot never boils”, as the saying goes. Chef Edward
has been cooking for ages, and empirically the saying seems to
be true in his kitchen – he has yet to see a pot actually start
boiling. His wife Gunilla is a bit suspicious of Edward’s claim
though. She knows how he... | 26,981 |
Cop and Robber
Description:
In the city of Bytemore crime level is hitting an all–time
high. Among other misdemeanours, robberies are happening every
day. And when the crime is committed, it is always up to a lone
patrolling police officer to chase down the robber through the
narrow alleys that connect... | 26,982 |
Coprime Integers
Description:
Given intervals $[a,
b]$ and $[c, d]$,
count the number of ordered pairs of co-prime integers
$(x, y)$ such that
$a \le x \le b$ and
$c \le y \le d$. Coprime
integers have no common factor greater than $1$.
## Input
The input consists of a single line of four spa... | 26,983 |
Cops and Robbers
Description:
The First Universal Bank of Denview has just been robbed!
You want to catch the robbers before they leave the state.
The state of Calirado can be represented by a rectangular
$n$-by-$m$ grid of characters, with the
character in each grid cell denoting a terrain type. The
... | 26,984 |
Copycat Catcher
Description:
Code consists of tokens separated by spaces. Tokens are
strings of alphabetical letters, numerals, and brackets. If a
token consists of only a single alphabetical letter (upper or
lowercase), it is a variable in the code.
The GCPC wants the plagiarism checker to compare query
... | 26,985 |
Copying DNA
Description:
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}, find the
... | 26,986 |
Cordon Bleu
Description:
A Parisian entrepreneur has just opened a new restaurant
“Au bon cordon bleu”, named after a famous
French recipe. However, no one has any idea of which wine would
be appropriate with such a dish. The entrepreneur plans to
sample many different wines in order to build the wine
... | 26,987 |
Cornhusker
Description:
Corn farmers need to do pre-harvest yield estimates to
determine the approximate number of bushels of corn their farm
will produce. They do this to determine if they have enough
storage space (grain bins) to store the harvested crop or if
they’ll have to store the corn elsewhere... | 26,988 |
Corrupt Judge
Description:
You are organising a programming competition in which the
rank of a team is first determined by how many problems they
have solved. In case of a tie, the team with the lowest time
penalty is ranked above the other. However, contrary to the
UKIEPC, the time penalty is equal to... | 26,989 |
Cosmic Path Optimization
Description:
Your long journey through the cosmos has begun, and you have
many stops along the way. This journey will take generations,
so you need to find the most efficient route from Earth,
located at intergalactic coordinates $(X_0, Y_0, Z_0)$, to each of the
$N$ planets, a... | 26,990 |
CosmoCraft
Description:
In the two-player game CosmoCraft you manage an economy in
the hopes of producing an army capable of defeating your
opponent. You manage the construction of workers, production
facilities, and army units; the game revolves around balancing
the resources you allocate to each. The... | 26,991 |
Cost of Living
Description:
A newspaper columnist recently wrote a column comparing
Disneyland’s price increases to other things in the economy;
e.g., If gasoline were to have increased at the same rate as
Disneyland’s admission since 1990, it would cost $\$ 6.66$ per gallon.
Consider the prices of a numb... | 26,992 |
Costly Contest
Description:
The company Mindsight is holding a programming contest for
$n$ contestants of varying
ages. It has been decided that the contest will be separated
into $k$ age divisions.
The duration of the contest will be $t$ minutes, the same for all
divisions. Mindsight has created a... | 26,993 |
Costume Contest
Description:
Everyone knows that the highlight of Halloween at HiQ is
their annual costume contest. In their costume contest, they
have $D$ categories of
costumes that they give a “best of” award to, such as most
malignant mummy, most ghoulish ghost and most
wicked witch. Judges are... | 26,994 |
Councilling
Description:
Each resident of a particular town is a member of zero or
more clubs and also a member of exactly one political party.
Each club is to appoint one of its members to represent it on
the town council so that the number of council members
belonging to any given party does not equa... | 26,995 |
Count Doubles
Description:
Given an array of $n$
positive integers and an integer $m$, count how many contiguous
subarrays of exactly $m$
elements have two or more even values.
For example, given the subarray 1 2 3 4 5 6 7 8 and
$m = 3$, the three
subarrays 2 3 4, 4 5 6, and 6 7 8
each have at... | 26,996 |
Count the Vowels
Description:
Given a line of text, count the vowels! For this problem,
the only vowels are A, E, I, O and U, both upper
and lower case. No other letters will be considered vowels for
the purposes of this problem.
## Input
The single line of input contains a single string
$s$ ($1 \le ... | 26,997 |
Count von Walken's Fence
Description:
The old Count von Walken ponders along the fence of his
backyard. The fence has a repeating pattern with poles in the
ground at equal distances. Since von Walken has nothing better
to do, he counts the number of steps he takes between each
pole.
The distance betwe... | 26,998 |
Countdown
Description:
The “Countdown” TV show has a part that consists of
obtaining a number by combining six different numbers using the
basic mathematical operations: addition, subtraction, product
and division. The basic rules for the game are:
* The contestant selects six of twenty-four shuffled
... | 26,999 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.