task stringlengths 0 154k | __index_level_0__ int64 0 39.2k |
|---|---|
The Big Painting
Description:
Samuel W. E. R. Craft is an artist with a growing
reputation. Unfortunately, the paintings he sells do not
provide him enough money for his daily expenses plus the new
supplies he needs. He had a brilliant idea yesterday when he
ran out of blank canvas: “Why don’t I create... | 30,100 |
The Biggest Triangle
Description:
Three infinite lines define a triangle, unless they meet at
a common point or some of them are parallel.
Given a collection of infinite lines, what is the largest
possible perimeter of a triangle defined by some three lines in
the collection?
## Input
The first line of ... | 30,101 |
The Board Game
Description:
Ann-Charlotte and Berit have invented their own board game.
The game is played with a board of size $N \times M$ and a chainsaw, and is
intended for two players. The players take turns making a move
until one of them cannot make a move, that player loses. A move
works the fo... | 30,102 |
The Bookcase
Description:
Wondering how small his bookcase could be, he models the
problem as follows. He measures the height $h_ i$ and thickness $t_ i$ of each book $i$ and he seeks a partition of the
books in three non-empty sets $S_1,S_2,S_3$ such that $\left(\sum _{j=1}^3 \max _{i \in S_ j} h_ i
\righ... | 30,103 |
The Brick Stops Here
Description:
You have been hired by several clients of a factory that
manufactures brass bricks. Brass is an alloy of copper and
zinc; each brick weighs $1000$ grams, and the copper content
of a brick can range from $1$ to $999$ grams. (Note that brass with
less than 55% or more th... | 30,104 |
The Bus Card
Description:
You are going to purchase a bus card. It’s a refillable card
that cash can be deposited into, and then used to ride the bus
until you are out of money. You know that you’re planning to
travel for $K$ Swedish
crowns (SEK). Charging the card takes some time since you can
onl... | 30,105 |
The Calculator
Description:
Rumors are circulating that your school-provided calculator
can be upgraded using a secret code. You’ve heard that if you
can get the calculator to display the secret kålnami code on its screen and then press the
equals sign, the calculator will unlock several secret
mathema... | 30,106 |
The Calculus of Ada
Description:
While mostly known for the programs she wrote for Charles
Babbage’s Analytic Engine, Augusta Ada King-Noel, Countess of
Lovelace, described how the method of finite differences could
be used to solve all types of problems involving number
sequences and series. These tec... | 30,107 |
The Citrus Intern
Description:
The summer is closing in and you have set your eyes on a
summer internship with your favourite fruit confederacy,
Citrus. What you really want is to take over the
entire organisation on your way to world fruit domination, but
getting an internship is a nice first step.
Y... | 30,108 |
The Clock
Description:
When someone asks you what time it is, most people respond
“a quarter past five”, 15:29 or
something similar. If you want to make things a bit harder, you
can answer with the angle from the minute hand to the hour
hand, since this uniquely determines the time. However, most
p... | 30,109 |
The Colonization of El-gă-rizm
Description:
The mythical planet, El-gă-rizm, comprises $m$ islands surrounded by water. There
are $n$ different natural
resources to be found at various locations on the islands.
Interestingly, each of the $n$ natural resources is present on
exactly two islands; thus the... | 30,110 |
The Coloring Game
Description:
Slugas Fulacek has challenged Oskar to a coloring game
played on a paper with lots of circle on it. Some pairs of
circles are connected by line segments, and are called
friends.
The players take turns coloring a circle that has not yet
been colored. The player who moves ... | 30,111 |
The Components Game
Description:
Narwhy the Narwhal likes playing games on his waterproof
phone. Recently, he downloaded a new game from the OceanStore.
It involves a rectangular grid made of white and black squares.
After going through the tutorial, he learned that by touching
any column it turns that... | 30,112 |
The Cost of Speed Limits
Description:
By the year 3031, the ICPC has become so popular that a
whole new town has to be built to house all the World Finals
teams. The town is beautifully designed, complete with
a road network. Unfortunately, when preparing the budget,
the town planners forgot to take in... | 30,113 |
The Council
Description:
Today is the day of the octennial meeting of the Council of
Atrebla. To start off the meeting, the Council members spent
sixteen minutes throwing darts as a means to quantify the
intrinsic value of each town in Atrebla as a single integer.
With this information the Council inte... | 30,114 |
The Dark Chambers of Chalmers
Description:
You are on your way to the final competition of the Swedish
Olympiad in Informatics, which is hosted at Chalmers Technical
University. However, you have gotten lost in the university
basement. Your sense of direction is not great, and what makes
matters worse ... | 30,115 |
The Darkness
Description:
Night clubs aren’t what they used to be. Our benevolent
state has decided that, for health and safety reasons, every
club must now meet a minimum lighting standard. They have moved
to verify standards by dividing each club up into $1\text { m}^2$ cells and measuring
the light ... | 30,116 |
The Deal of the Day
Description:
A bored technician whose job requires inspecting each of
$10$ equipment stations on
a regular basis has tried to inject a little variety into his
days by creating a deck of cards, each card bearing a number in
the range $1..10$. From
this deck he randomly deals out ... | 30,117 |
The Dragon and the Knights
Description:
The Dragon of the Wawel Castle, following the conflict with
the local Shoemakers’ Guild, decided to move its hunting
grounds out of Kraków, to a less hostile neighborhood. Now it
is bringing havoc and terror to the peaceful and serene Kingdom
of Bytes.
In the Ki... | 30,118 |
The Dragon of Loowater
Description:
Once upon a time, in the Kingdom of Loowater, a minor
nuisance turned into a major problem.
The shores of Rellau Creek in central Loowater had always
been a prime breeding ground for geese. Due to the lack of
predators, the geese population was out of control. The peopl... | 30,119 |
The Easiest Problem Is This One
Description:
Some people think this is the easiest problem in today’s
problem set. Some people think otherwise, since it involves
sums of digits of numbers and that’s difficult to grasp.
If we multiply a number $N$ with another number $m$, the sum of digits typically
change... | 30,120 |
The Elk
Description:
You are in a forest. In this forest there is also a pair of
elks - a cow (an adult female) and her calf (child). As most
people know, it is dangerous to get between a cow and her calf,
but it is not always clear how to avoid it.
We model our forest as consisting of $N$ locations, and ... | 30,121 |
The Embarrassed Cryptographer
Description:
What Odd Even did not think of, was that both
factors in a key should be large, not just their product. It is
now possible that some of the users of the system have weak
keys. In a desperate attempt not to be fired, Odd Even secretly
goes through all the users... | 30,122 |
The End of the World
Description:
Legend says that there is a group of monks who are solving a
large Towers of Hanoi puzzle. The Towers of Hanoi is a
well-known puzzle, consisting of three pegs, with a stack of
disks, each a different size. At the start, all of the disks
are stacked on one of the pegs,... | 30,123 |
The Ending of the End - Part 1
Description:
Rarity: “Go, Twilight! Get
help!”
Applejack: “We’ll hold ‘em ‘til you
get back!”
Twilight Sparkle: “No! I can’t leave
you here!”
Fluttershy: “It’s our only
chance!”
Rainbow Dash: “You’ll come up with
something to save the day!”
Pinkie Pie: “You alway... | 30,124 |
The Ending of the End - Part 2
Description:
Previously...
Twilight Sparkle: “No! I can’t
leave you here!”
Fluttershy: “It’s our only
chance!”
...soon, all of Equestria will fall.
Twilight Sparkle needs to make her way to the Crystal
Empire to warn them and get help. The route is deadly; with
... | 30,125 |
The Escape
Description:
You have all heard of the story of the three little pigs.
However, this time they’re facing another predicament yet
again!
The three pigs brought a bunch of their pig friends into a
tree, which is a connected undirected graph with $V$ vertices and $V-1$ edges. Originally there were... | 30,126 |
The Fox and the Owl
Description:
Fox Mithra has finally learned the numbers and he is now
familiar with the concept of ‘one’, ’two’, ‘three’ and also
even ‘zero’, ‘minus one’, ‘minus two’ and so on. Really, an
achievement for such a small fox. He took the textbook and
copied the integers from the book ... | 30,127 |
The Giant
Description:
You have been captured by an evil giant. You are both in a
$N \times M$ big cave
consisting of all points with integer coordinates $(x, y)$ such that $0 \le x < N, 0 \le y < M$. The
giant plans to eat you, so you must escape before it’s too
late! The giant is standing with his fe... | 30,128 |
The Gourmet
Description:
The French gourmet Frank is a very well-respected gourmet;
his job involves going around to various restaurants, eating
their food and then writing a review about the restaurant. But
he carries a dark secret: he is actually only interested in
eating as much as possible and in a... | 30,129 |
The Grand Adventure
Description:
We’d like to know if Jim will be able to complete his
adventure before he even starts!
## Input
The first line contains a single integer $n$, $1
\le n \le 5$, the number of adventures. Each of the next
$n$ lines contains a
single string $a$, a
sequence of $\{ \$ ,... | 30,130 |
The Great Egg Hunt
Description:
Every year at Easter Bob’s grandmother organizes The Great Egg Hunt in their family mansion. This
has been a family tradition since even before Bob was born.
Bob’s grandmother starts by filling up a giant Easter Egg with
candy. She then picks a room (uniformly) at random and... | 30,131 |
The Ice Cream Game
Description:
Kirderf and Slin are early to a great party where ice cream
is served to everyone. Right now they are alone in the party
hall where $N$ jars of ice
cream are placed in a row on a table. There are $K$ different flavours of ice cream,
where each flavour is represented by a... | 30,132 |
The Ice Puzzle
Description:
Olle hates crosses. They remind him too much of getting a
Wrong Answer verdict in
Programmeringsolympiaden. When he arrived at Vallhamra Icehall
and saw that there were $K$ ($2
\leq K \leq 20000$) crosses placed on the ice, he became
angrier than a raging bull.
Being th... | 30,133 |
The Imp
Description:
You arrive in Ye Olde Magic Shoppe with some hard-earned
gold to purchase wondrous and unique magic items. There are
$n$ such items in the
shop, each of them locked in a special magic box. The
$i$-th box costs
$c_ i$ gold pieces to buy,
and contains an item worth $v_
i$... | 30,134 |
The Key to Cryptography
Description:
Suppose you need to encrypt a top secret message like “SEND
MORE MONKEYS”. You could use a simple substitution cipher,
where each letter in the alphabet is replaced with a different
letter. However, these ciphers are easily broken by using the
fact that certain lett... | 30,135 |
The King of the North
Description:
Winter is coming (or going? who can be sure these days) and
a new king rises in the North. The message travels quickly
these days... That is why you, the rising king, have not much
time left. You need to rally your bannermen behind you. But one
question seems harder t... | 30,136 |
The King's Guards
Description:
In a certain kingdom, the king wants to protect his citizens
by deploying guards. He has recruited a number of guards, and
has outfitted them with heavy armor for protection from
bandits, foreign knights, and other ne’er-do-wells. His guards
are tough, but unfortunately t... | 30,137 |
The King's Walk
Description:
Chess is a game in which two sides control pieces in an
attempt to capture each other’s king. The pieces vary in
mobility. At the beginning of a game the kings are rather
vulnerable. They are less mobile than most other pieces and
they tend to hide behind their pawns. Like ... | 30,138 |
The Last Crusade
Description:
Scootaloo’s parents, Snap Shutter and Mane Allgood, have
been away for many, many moons, venturing across the land in
search of exotic flora and fauna for the advancement of
Equestrian science and medicine. The gravity of their
profession meant that they could never find t... | 30,139 |
The Last Laugh
Description:
The self-proclaimed “super duper party pony” and amusement
factory owner Cheese Sandwich has lost his laugh, and it’s up
to his longtime pal Pinkie Pie to get it back.
By now, Pinkie Pie has pulled out all the stops to get her
“partier” in crime to laugh, all to no avail. As a ... | 30,140 |
The Last Pizza
Description:
Penny and Pontus have bought $N$ pizzas and are currently eating.
They are both polite Swedes, so no one wants to take the last
slice. Penny can either take the rest of a pizza (provided it
has at least one slice) or a slice from one of the pizzas. Then
Pontus will do the sa... | 30,141 |
The Last Problem
Description:
This is where the magic happens
This is where magic lives
Our friendships weave together
stronger
The bonds grow deeper, lasting
longer
And the greatest spell you’ll know
Is how the Magic of Friendship
grows...
In the distant future, an older Twilight Sparkle is visited
b... | 30,142 |
The Leprechaun Hunt
Description:
In Irish mythology, a Leprechaun is a small sprite who
stores all his treasure in a hidden pot of gold at the end of
the rainbow. If someone is able to catch the Leprechaun, he
must give that person his pot of gold. In this problem, we
explore the difficulty of capturin... | 30,143 |
The Magical 3
Description:
Even more magically, almost all integers can be represented
as a number that ends in 3 in some numeric base, sometimes in
more than one way. Consider the number 11, which is represented
as 13 in base 8 and 23 in base 4. For this problem, you will
find the smallest base for a ... | 30,144 |
The Mailbox Manufacturers Problem
Description:
In the good old days when Swedish children were still
allowed to blow up their fingers with fire-crackers, gangs of
excited kids would plague certain smaller cities during Easter
time, with only one thing in mind: To blow things up. Small
boxes were easy t... | 30,145 |
The Maze Makers
Description:
The Maze Makers is a publisher of puzzle books. One of their
most popular series is maze books. They have a program that
generates rectangular two-dimensional mazes like the one shown
in Figure 1. The rules for these mazes
are: (1) A maze has exactly two exterior cell walls... | 30,146 |
The N Days of Christmas
Description:
Consider the first three verses of the classic Christmas
carol, The Twelve Days of Christmas:
On the first day of Christmas my true love gave to me
A partridge in a pear tree.
On the second day of Christmas my true love gave to me
Two turtle doves,
And a par... | 30,147 |
The Owl and the Fox
Description:
Fox Mithra has finally learned the numbers and he is now
familiar with the concept of ‘one’, ’two’, ‘three’ and also
even ‘zero’, ‘minus one’, ‘minus two’ and so on. Really, an
achievement for such a small fox. He took the textbook and
copied the integers from the book ... | 30,148 |
The Paladin
Description:
A Paladin, a warrior adept at holy magic, needs your help
forming spells. Being a Paladin, every spell must also be a
Palindrome, meaning that it is the same string when
read forwards and backwards. The cost of constructing a new
spell is based on rune pair costs (costs of adja... | 30,149 |
The Plank
Description:
You want to construct a long plank using smaller wooden
pieces. There are three kinds of pieces of lengths $1$, $2$ and $3$ meters respectively, each which
you have an unlimited number of. You can glue together several
of the smaller pieces to create a longer plank.
If the plank sho... | 30,150 |
The Point of No Return
Description:
Twilight Sparkle forgot to return a book to the Canterlot
Library, and it’s been two years—eight seasons—since she
borrowed it! As a consequence, not only has she lost her
perfect library book return record, she’s also had to pay a
fine of twenty-eight bits; and, pos... | 30,151 |
The Polar Express
Description:
It’s almost December, and the Polar Express is planning for
its annual trip towards the North Pole. The Polar Express is a
train with $N$ carts
numbered $1$ to
$N$, and you are the
conductor! However, due to an exceptionally heavy snowstorm,
your train recently ra... | 30,152 |
The Power of Substitution
Description:
A substitution cipher uses a substitution table that for
each letter $x$ in the
alphabet assigns another (possibly the same) letter
$p[x]$ in the same
alphabet. A message $m_1\, m_2\,
m_3\, m_4$ is then encrypted as $E_ p(m_1\, m_2\, m_3\, m_4)=p[m_1]\,
p[... | 30,153 |
The Princess and the Pea
Description:
A single pea is hidden in one of the $M$ mattresses at court. Your job is
to find it within $N$
nights. Luckily, the kind princess has agreed to help you.
After a single night’s sleep on a pile of mattresses, she can
determine with certainty whether she slept on th... | 30,154 |
The Punctilious Cruciverbalist
Description:
A crossword puzzle consists of a grid of squares in which
intersecting words are placed, one letter per square. Some grid
squares are filled black indicating that no letter should go
there. Solvers are given clues for each word, and each clue is
identified by... | 30,155 |
The Queen's Super-circular Patio
Description:
The queen wishes to build a patio paved with of a circular
center stone surrounded by circular rings of circular stones.
All the stones in a ring will be the same size with the same
number of stones in each ring. The stones in the innermost ring
will be pla... | 30,156 |
The Rectangles Are Surrounding Us!
Description:
You are given a list of rectangle boundaries. Each rectangle
boundary is on integer coordinates. The rectangles surround
squares on the coordinate grid. Your job is to determine the
total number of such grid squares that are surrounded by at
least one of ... | 30,157 |
The Red Gem
Description:
The curator has decided to spice up the display, and has
placed the gem on a purple circular platform, along with
mundane orange circular gems.
Starved citizens of circle land (points) have flocked to see
the grand exhibit of the exquisite red gem. They cannot step on
the purp... | 30,158 |
The Safe Secret
Description:
One of the brightest and richest dukes of the nineteenth
century built a break-in-proof room for storing his valuables
and chose the lock secret code in an ingenious manner. He was
so afraid of being robbed that he did not tell anyone the safe
secret; he only wrote the way ... | 30,159 |
The SetStack Computer
Description:
Given this importance of sets, being the basis of
mathematics, a set of eccentric theorist set off to construct a
supercomputer operating on sets instead of numbers. The initial
SetStack Alpha is under construction, and they need you to
simulate it in order to verify ... | 30,160 |
The Silk Road ... with Robots!
Description:
Parts of the ancient silk road passed through southern
Kazakhstan. You’ve been fantasizing about a modern silk road,
which has its own special features. Along your fantasy road are
robots as well as stores holding stashes of tenges (the
national currency of... | 30,161 |
The Sock Pile
Description:
This problem is based on an (almost) true story. A child,
who shall remain nameless, has a large pile of clean socks.
This pile contains $m$
pairs of socks with pictures and patterns and $n$ pure white socks. Each pair of
socks consists of two identical socks and every pair i... | 30,162 |
The Sound of Silence
Description:
In digital recording, sound is described by a sequence of
numbers representing the air pressure, measured at a rapid rate
with a fixed time interval between successive measurements.
Each value in the sequence is called a sample.
An important step in many voice-processing ... | 30,163 |
The Stock Market
Description:
Evelina is going to start speculating on the stock market to
become rich. She is actually not really interested in economics
and never bothers to read more than the first stock price in
the newspaper. But, she thinks, it’s everyone else who is
complicating things. If you b... | 30,164 |
The Summer Sun Setback
Description:
The Summer Sun Celebration is a major Equestria-wide
festival that has been held every year since the defeat of
Nightmare Moon at the hooves of Princess Celestia over a
thousand years ago. It has been a long, long way since; one
could hardly imagine today that any
... | 30,165 |
The Triangle Factory
Description:
Tristian works at a triangle factory. His job is to classify
different types of triangles produced in the factory. Tristian
now asks you to write a program that can replace him.
Tristian will give you three positive integers, $a$, $b$, and $c$. These are the three angles of a... | 30,166 |
The Trip
Description:
A number of students are members of a club that travels
annually to exotic locations. Their destinations in the past
have included Indianapolis, Phoenix, Nashville, Philadelphia,
San Jose, and Atlanta. This spring they are planning a trip to
Eindhoven.
The group agrees in advance... | 30,167 |
The Trip, 2007
Description:
A number of students are members of a club that travels
annually to exotic locations. Their destinations in the past
have included Indianapolis, Phoenix, Nashville, Philadelphia,
San Jose, Atlanta, Eindhoven, Orlando, Vancouver, Honolulu,
Beverly Hills, Prague, Shanghai, and... | 30,168 |
The Uncertainty of Politics
Description:
* There are many committees, and thus many hearings, some
of which take place at overlapping times.
* While the committees are extremely punctual in terms of
when to start a hearing, they are notoriously unpredictable
in terms of how long the hearing ... | 30,169 |
The Ups and Downs of Investing
Description:
Liam is heavily invested in the stock market, and has
various theories that he uses to predict when the market will
rise and when it will fall. Lately, things haven’t been going
too well – the only thing rising is his frustration and the
only thing falling is... | 30,170 |
The Uxuhul Voting System
Description:
One of the world’s first civilisations was that of the
ancient Uxuhul indians, in the jungles of Central America. The
Uxuhul culture flourished for almost a thousand years, with its
golden era around 3200 BC. Each year high priests, representing
different parts of ... | 30,171 |
The Weight Of Words
Description:
You are asked to write an AI that can play this game!
## Input
The input consists of a single line with two integers
$l$ ($0 < l \le 40$) and $w$ ($0
< w \le 1000$).
## Output
Output a string of length $l$ with weight $w$ consisting of lowercase English
letters if it ex... | 30,172 |
The White Rabbit Pocket Watch
Description:
Alice: How can it be?
Rabbit: Trust me Alice. It always takes the same time. When I
go from my home up the road to Queen of Hearts’ Castle, my
watch counts nine hours. However, if I continue down to Mad
Hatter’s House, my watch counts just two hours in total. ... | 30,173 |
The Wire Ghost
Description:
Žofka is bending a copper wire. She starts with a straight
wire placed on the table with the starting point glued to the
middle of the table. She then repeatedly picks a point on the
wire and bends the part starting at that point (away from the
starting point) by $90$
de... | 30,174 |
The Wizard Theodor
Description:
A small army of $N$
monsters is just outside Tästerås! Now it is up to the wizard
Theodor to defeat them and save the city. Each monster has a
certain amount of life points. To damage the monsters, Theodor
can fire magical explosions. Each time he fires an explosion,
... | 30,175 |
The Worm in the Apple
Description:
Willy the Worm was living happily in an apple – until some
vile human picked the apple, and started to eat it! Now, Willy
must escape!
Given a description of the apple (defined as a convex shape
in 3D space), and a list of possible positions in the apple for
Willy (d... | 30,176 |
The Wrath of Kahn
Description:
Topologically sorting the nodes of a directed graph
(digraph) $G$ means
putting the nodes in linear order
such that whenever there is an edge from node $x$ to node $y$ in $G$, $x$ always precedes $y$ in the linear ordering. It is not
hard to show that the nodes of a digraph ... | 30,177 |
Theme Park
Description:
Roller coasters are so much fun! It seems like everybody who
visits the theme park wants to ride the roller coaster. Some
people go alone; other people go in groups, and don’t want to
board the roller coaster unless they can all go together. And
everyone who rides the roller coa... | 30,178 |
Theodor the Wizard
Description:
This problem is based on the problem The
Wizard Theodor.
Evil Olle, who is ultimately responsible for all evil, is
tired of Theodor always ruining everything. Now, Olle has
devised a new malicious plan, and to put it into action, he
needs to keep Theodor occupied. At hi... | 30,179 |
Thermostat Trouble
Description:
Earth has recently been visited by aliens, and is now a
member of a galactic federation consisting of many other
advanced lifeforms on numerous habitable planets. This
federation is very impressive in its scope and accomplishments,
but unfortunately the usual failures of... | 30,180 |
Thesaurus
Description:
After staying up all night, Yraglac has finally finished
writing the essay for his assignment. However, he just noticed
at the last minute that his essay exceeds the maximum
permissible length!
Since Yraglac has little time left, he doesn’t want to spend
too much time changing h... | 30,181 |
Thieving Residents
Description:
Bergurby has $N+1$
buildings (houses + City center) which are connected by
$N$ roads. Each building
connects to at most $3$
roads, and it is possible to travel from any building to
another. There are $N$
people numbered $1, 2, ...,
N$ and they each live in a ... | 30,182 |
Thin Ice
Description:
Uolevi is at a frozen lake in the shape of an $n \times m grid$, with one coin on
each square. Each square has a durability: the maximum number
of coins the ice on the square can withstand.
In one step, Uolevi can move one square up, down, left or
right, but not outside the lake. If ... | 30,183 |
This Ain't Your Grandpa's Checkerboard
Description:
You are given an $n$-by-$n$ grid where each square is colored
either black or white. A grid is correct if all of the
following conditions are satisfied:
* Every row has the same number of black squares as it has
white squares.
* Every column has the... | 30,184 |
Thore's self-esteem
Description:
## Input
The first line of the input contains a single number
$n$, where $1 < n \leq 100$.
Then follows $n$ lines
with a name on each line.
Each name only contains characters from the set $\big [\text {a-zA-Z}\big ]$, i.e.
lower and upper case English letters. Each name ... | 30,185 |
Thoring test
Description:
Thore loves chatting with an AI chatbot. It will tell him
that he is handsome, intelligent and that he sings like an
angel, all the things he wants to hear. And it is never rude or
makes spelling errors like those pesky humans. Now Thore wants
your help to write a program that... | 30,186 |
Three Dice
Description:
Given a list of three-letter words, generate one possible
set of three, six-sided dice such that each word can be formed
by the top faces of some arrangement of the three dice. You
must distribute 18 distinct letters across the 18 total faces
of the dice. There may be multiple p... | 30,187 |
Three Digits
Description:
Per is obsessed with factorials. He likes to calculate them,
estimate them, read about them, draw them, dream about them and
fight about them. He even has the value of $12!=479\, 001\, 600$ tattooed on his
back.
He noticed a long time ago that factorials have many
trailing ze... | 30,188 |
Three Kinds of Dice
Description:
To formalize this: define a “die” as any shape with at least
one face such that each face shows a positive integer. When a
die is rolled, one of its faces is selected uniformly at
random. When two dice roll against each other, the die whose
selected face shows a higher ... | 30,189 |
Three Powers
Description:
Consider the set of all non-negative integer powers of
3.
* $S = \{ 1, 3, 9, 27, 81,
\ldots \} $
$S = \{ 1, 3, 9, 27, 81,
\ldots \} $
Consider the sequence of all subsets of $S$ ordered by the value of the sum of
their elements. The question is simple: find the set ... | 30,190 |
Three in a Row
Description:
The mathematician Lenore Oljer has done so much math that
she has grown tired of prime numbers. She has now started
studying so-called “nice triplets”. It’s very easy to create a
nice triplet. Start with an integer $a$ greater than zero and then create
the triplet $(a, a+1,
... | 30,191 |
Three-State Memory
Description:
For example, $201$ in
this strange representation is $2\cdot 2^2+0\cdot 2^1+ 1\cdot 2^0=9$.
Some numbers are shorter in this representation, but for other
numbers it doesn’t help at all – for instance, $15$ is $1111$ in binary and this is the only
way of writing it in th... | 30,192 |
Threes and Fives
Description:
You are given a positive integer $n$ and should print the sum of
positive integers $< n$
which are a multiple of either $3$ or $5$.
## Input
The first and only line of input contains a positive integer
$n \leq 10^{18}$.
## Output
Print the sum of positive integers $< n$ wh... | 30,193 |
Through the Grapevine
Description:
According to Wikipedia, to hear something “through the
grapevine” is to learn of something informally and unofficially
by means of gossip or rumor. In this problem, you are tasked
with determining how many people will hear about a particular
rumor “through the grapevi... | 30,194 |
Throwing bridges
Description:
In the province of Wulingyuan in China, there are
$N$ very steep cliffs. It
is very popular for tourists to visit the mountain peaks.
Often, they even want to visit more than one in order to
take photos from different angles. To facilitate this, several
suspension bridges... | 30,195 |
Thwack!
Description:
The game Thwack is played on a 1-dimensional grid
of cells: the game board. Each grid cell contains
either a black stone, a white stone, or is empty.
Two players alternate taking turns. A turn consists of
choosing two adjacent stones of opposite colours and then
choosing one of th... | 30,196 |
Tic Tac Toe
Description:
The game of Tic Tac Toe is played on an $n$-by-$n$ grid (where $n$ is usually but not necessarily
three). Two players alternate placing symbols on squares of the
grid. One player places Xes and the other player places Os. The
player placing Xes always goes first. When the grid cont... | 30,197 |
Tic Tac Toe
Description:
Tic Tac Toe is a child’s game played on a $3$ by $3$ grid. One player, X, starts by
placing an X at an unoccupied grid position. Then the other
player, O, places an O at an unoccupied grid position. Play
alternates between X and O until the grid is filled or one
player’s symbol... | 30,198 |
Tic Tac Toe Counting
Description:
Tic Tac Toe is a simple children’s game. It is played on a
$3 \times 3$ grid. The
first player places an X in any of
the $9$ cells. The next
player places an O in any of the
remaining 8 cells. The players continue to alternate placing
Xs and Os
in unoccupie... | 30,199 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.