task stringlengths 0 154k | __index_level_0__ int64 0 39.2k |
|---|---|
Global Alignment with Scoring Matrix
Description:
Generalizing the Alignment Score
The
edit alignment score
in
“Edit Distance Alignment”
counted the total number of
edit operations
implied by an
alignment
; we could equivalently think of this scoring function
as assigning a cost of 1 to each such operation. A... | 26,000 |
Genome Assembly with Perfect Coverage
Description:
Cyclic Chromosomes
Recall that although
chromosomes
taken from
eukaryotes
have a linear structure,
many bacterial chromosomes are actually circular. We represented a linear chromosome with
a
DNA string
, so we only need to modify the definition of string to mo... | 26,001 |
Matching a Spectrum to a Protein
Description:
Searching the Protein Database
Many
proteins
have already been identified for a wide variety of organisms. Accordingly,
there are a large number of protein databases available, and so the first step after
creating a
mass spectrum
for an unidentified protein is to se... | 26,002 |
Quartets
Description:
Incomplete Characters
The modern revolution in
genome sequencing
has produced a huge amount of genetic data
for a wide variety of species. One ultimate goal of possessing all this information is to be able to construct
complete
phylogenies
via direct genome analysis.
For example, say tha... | 26,003 |
Using the Spectrum Graph to Infer Peptides
Description:
Getting Real with Spectra
In
“Inferring Peptide from Full Spectrum”
, we considered an idealized version of the
simplified spectrum
in which
every
cut
through a given peptide was produced, so that the spectrum possessed all
possible b-ions and y-ions cutti... | 26,004 |
Encoding Suffix Trees
Description:
Creating a Suffix Tree
In
“Finding the Longest Multiple Repeat”
, we introduced the
suffix tree
. This
data structure
has a wide array
of applications, one of which was to help us identify long repeats in a
genome
.
In that problem, we provided the tree as part of the dataset... | 26,005 |
Character-Based Phylogeny
Description:
Introduction to Character-Based Phylogeny
In
“Creating a Character Table”
, we discussed the construction of a
character table
from a
collection of
characters
represented by
subsets
of our
taxa
.
However, the ultimate goal is to be able to construct a phylogeny from thi... | 26,006 |
Counting Quartets
Description:
Introduction to Quartet-Based Phylogeny
In
“Quartets”
, we introduced
partial splits
modeling
partial characters
on
a collection of
taxa
. Our aim is to use the
quartets
inferred from
partial splits to construct a
phylogeny
on the taxa. This procedure is called
quartet-bas... | 26,007 |
Enumerating Unrooted Binary Trees
Description:
Seeing the Forest
In
“Counting Unrooted Binary Trees”
, we found a way to count the number of
unrooted binary trees
representing
phylogenies
on
$n$
taxa
. Our observation was that two such trees are considered
distinct
when they do not share the same collecti... | 26,008 |
Genome Assembly Using Reads
Description:
Putting the Puzzle Together
In practical genome sequencing, even if we assume that
reads
have been sequenced
without errors, we have no idea of knowing immediately the particular
strand
of
DNA
a read has come from.
Also, our reads may not have the same length. In 199... | 26,009 |
Global Alignment with Constant Gap Penalty
Description:
Penalizing Large Insertions and Deletions
In dealing with
global alignment
in
“Global Alignment with Scoring Matrix”
, we encountered a
linear gap penalty
, in
which the insertion or deletion of a
gap
is penalized by some constant times the length
of the ... | 26,010 |
Linguistic Complexity of a Genome
Description:
Getting Repetitive
We have seen that every
genome
contains a large number of
repeats
and noted that the
Alu
repeat recurs around a million times on the human genome. Yet exactly how repetitive
is the human genome?
To frame such a vague question mathematically, ... | 26,011 |
Local Alignment with Scoring Matrix
Description:
Aligning Similar Substrings
Whereas
global alignment
(see
“Global Alignment with Scoring Matrix”
) can be helpful for comparing
genetic strings
of similar length that resemble each other,
often we will be presented with strings that are mostly dissimilar except f... | 26,012 |
Inferring Genotype from a Pedigree
Description:
Lying in Wait
Single gene disorders
can be encoded by either
dominant
or
recessive alleles
. In the latter case, the affected person
usually has two healthy
carrier
parents, who were usually unaware
that their child could inherit a deadly or debilitating genetic ... | 26,013 |
Maximizing the Gap Symbols of an Optimal Alignment
Description:
Adjusting Alignment Parameters
As we change the parameters contributing to
alignment score
, the nature of alignments
achieving the maximum score may change. One feature of maximum-score alignments worthy
of consideration is the number and size of the... | 26,014 |
Identifying Maximal Repeats
Description:
Spies in the War Against Phages
Figure 1
.
A genomic region containing a CRISPR. Red substrings correspond to CRISPR repeats, and blue substrings correspond to unique spacers. Repeats are highly palindromic and fold into a hairpin loop when transcribed.
In
“Locating Res... | 26,015 |
Multiple Alignment
Description:
Comparing Multiple Strings Simultaneously
In
“Consensus and Profile”
, we generalized the notion of
Hamming distance
to find an average case
for a collection of
nucleic acids
or
peptides
. However, this method only worked if the polymers had the same length.
As we have already ... | 26,016 |
Creating a Restriction Map
Description:
Genetic Fingerprinting
Recall that a
restriction enzyme
cuts the endpoints of a specific interval of
DNA
,
which must form a
reverse palindrome
that typically has length 4 or 6.
The interval of DNA cleaved by a given restriction enzyme is called its
recognition sequence
... | 26,017 |
Counting Rooted Binary Trees
Description:
From Unrooted to Rooted Trees
Recall that a
rooted binary tree
is a
binary tree
for which the
root
is the
only
node
of
degree
2. Such a tree differs from an
unrooted binary tree
only in the
existence of the root.
Different
phylogenetic
methods may be better s... | 26,018 |
Sex-Linked Inheritance
Description:
Chromosomes Determine Sex
Figure 1
.
Morgan's two experiments on fruit fly eye color. In the first experiment, a white-eyed male is crossed with a purebred red-eyed female; in the second experiment, a red-eyed male is crossed with a white-eyed female. The results of Morgan's expe... | 26,019 |
Phylogeny Comparison with Split Distance
Description:
Quantifying Binary Tree Comparison
We may often obtain two different
phylogenies
on the same collection of
taxa
from different
sets of data. As a result, we would like to have a way of quantifying how much
the two phylogenies differ. In the simplest case, w... | 26,020 |
The Wright-Fisher Model of Genetic Drift
Description:
Hardy-Weinberg Revisited
The principle of
genetic equilibrium
is an idealistic model for population genetics
that simply cannot hold for all
genes
in practice.
For one, evolution has proven too powerful for equilibrium to possibly hold.
At the same time, evol... | 26,021 |
Alignment-Based Phylogeny
Description:
From Characters Toward Alignments
In
“Creating a Character Table from Genetic Strings”
, we used strings to create a collection of
characters
from which
we could create a
phylogeny
. However, the strings all had to share the same length,
which was a problem. In practice, ... | 26,022 |
Assessing Assembly Quality with N50 and N75
Description:
How Well Assembled Are Our Contigs?
As we have stated, the goal of
genome sequencing
is to create
contigs
that are
as long as possible. Thus, after
fragment assembly
, it is important to
possess statistics quantifying how well-assembled our contigs are.
... | 26,023 |
Fixing an Inconsistent Character Set
Description:
Pitfalls of Character-Based Phylogeny
In
“Character-Based Phylogeny”
, we asked for the construction of an
unrooted binary tree
from a
consistent character table
.
However, the assumption of consistency is often inaccurate, as many character collections
derived f... | 26,024 |
Wright-Fisher's Expected Behavior
Description:
Reaching Population Equilibrium
In
“The Wright-Fisher Model of Genetic Drift”
, we introduced the
Wright-Fisher model
of
genetic drift
.
Although the effects of
genetic drift
are inevitable, we should be able
to quantify how many
alleles
for a given trait will r... | 26,025 |
The Founder Effect and Genetic Drift
Description:
Strength in Numbers
Charles Darwin is known first and foremost for his notion of
natural selection
,
the elegant statistical fact that changes in populations
are attributable to the observation that organisms better equipped to handle their environment
are more like... | 26,026 |
Global Alignment with Scoring Matrix and Affine Gap Penalty
Description:
Mind the Gap
In
“Global Alignment with Scoring Matrix”
, we considered a
linear gap penalty
, in which each inserted/deleted
symbol contributes the exact same amount to the calculation of
alignment score
.
However, as we mentioned in
“Globa... | 26,027 |
Genome Assembly with Perfect Coverage and Repeats
Description:
Repeats: A Practical Assembly Difficulty
Genome assembly
is straightforward if we know in advance that the
de Bruijn graph
has exactly one
directed cycle
(see
“Genome Assembly with Perfect Coverage”
).
In practice, a genome contains
repeats
lon... | 26,028 |
Overlap Alignment
Description:
Overlapping Reads with Errors
As also mentioned in
“Error Correction in Reads”
, the
sequencing
machines that identify
reads
can make errors. However, the problem that we considered in
“Genome Assembly as Shortest Superstring”
assumed
that all reads are error-free.
Thus, rath... | 26,029 |
Quartet Distance
Description:
Another Tree Distance
In
“Phylogeny Comparison with Split Distance”
, we examined the
split distance
for comparison of different
phylogenies
on the same collection of
taxa
.
Yet
quartet-based phylogeny
offers another way in which two phylogenies
can be compared (see
“Quartets... | 26,030 |
Finding a Motif with Modifications
Description:
Finding Mutated Motifs
We have discussed at length the importance of
motif
finding in biology for
genetic strings
.
However, searching for exact
substring
matches is of little use in applications
because a motif can vary under the effect of
mutation
.
Fortunately... | 26,031 |
Semiglobal Alignment
Description:
Gaps on the Ends are Free
We have covered both
global
and
local alignments
. However,
sometimes we need a hybrid approach that avoids the weaknesses of these two methods.
One such alternate approach is that of
fitting alignments
outlined in
“Finding a Motif with Modifications... | 26,032 |
Finding All Similar Motifs
Description:
The Case of Mutated Repeats
In
“Finding a Motif with Modifications”
, we considered a problem in which we were given a
motif
and a long
string
(perhaps representing a
genome
), and we aimed to find the "closest"
substring
of the long string to the motif. In that probl... | 26,033 |
Local Alignment with Affine Gap Penalty
Description:
Building Upon Local Alignments
We have thus far worked with
local alignments
with a
linear gap penalty
and
global alignments
with
affine gap penalties
(see
“Local Alignment with Scoring Matrix”
and
“Global Alignment with Scoring Matrix and Affine Gap Pe... | 26,034 |
Isolating Symbols in Alignments
Description:
How Much Does it Cost to Align Two Symbols?
As we saw in
“Counting Optimal Alignments”
, there will usually be a huge number of different
optimal alignments
of two given
strings
. In this problem, which represents a first attempt to understand
how much optimal alignm... | 26,035 |
Identifying Reversing Substitutions
Description:
Reversions Complicate Phylogenies
Figure 1
.
Illustration of an amino acid's reversing substitution after two point mutations.
In
“Fixing an Inconsistent Character Set”
, we mentioned how the construction of a
phylogeny
can be complicated by a
the
reversion
... | 26,036 |
#exclude<scoring>
Description:
You are participating in a programming contest cup. The cup
consists of a series of programming contests, followed by a
final at the end of the season for the $15$ top ranked contestants in the
cup. With only one contest left to go before the final, you are
starting to wo... | 26,037 |
#include<scoring>
Description:
As you may know, LTH Challenge is part of a series of seven
competitions called the Swedish Coding Cup. Each
contest in the series gives the contestants a number of points
depending on how well they place in the contest.
After each contest, scores are assigned according to t... | 26,038 |
'S No Problem
Description:
The Yllihc Engineering and Technological Institute (YETI),
located in northern Snowblovia, has two problems: snow and
money. Specifically, they have too much of the former and not
enough of the latter. Every winter (and fall and spring, for
that matter) the campus is covered ... | 26,039 |
(More) Multiplication
Description:
Educators are always coming up with new ways to teach math
to students. In 2011, an educational software company, All
Computer Math (ACM), developed an application to display
products in a traditional grade school math format. ACM is now
working on an updated version ... | 26,040 |
(un)Fair Play
Description:
It is not an easy job to be a coach of a football team. (A
note to our American friends: football = soccer.) Especially if
you do not coach great teams like Ajax, Inter, Dynamo (ok, fill
in the name of your dream team), but only a mediocre one like
FC Dead Horse, playing in t... | 26,041 |
0-1 Sequences
Description:
You are given a sequence, in the form of a string with
characters ‘0’, ‘1’, and ‘?’ only.
Suppose there are $k$
‘?’s. Then there are $2^ k$ ways to replace each
‘?’ by a ‘0’ or a ‘1’, giving
$2^ k$ different 0-1
sequences (0-1 sequences are sequences with only zeroes ... | 26,042 |
1's For All
Description:
The complexity of an integer is the minimum number
of $1$’s needed to
represent it using only addition, multiplication and
parentheses. For example, the complexity of $2$ is $2$ (writing $2$ as $1+1$) and the complexity of
$12$ is $7$ (writing $12$ as $(1+1+1)\times (1+1+1+1)$... | 26,043 |
1-D Frogger (Easy)
Description:
Frogger is a classic $2$-D video
game that challenges the player to move a frog character safely
across a traffic-filled road and a hazardous river. What is not
well known is that Frogger actually began as a prototype board
game based on a $1$-D concept at a now-defunct
... | 26,044 |
1-D Frogger (Hard)
Description:
Frogger is a classic $2$-D video
game that challenges the player to move a frog character safely
across a traffic-filled road and a hazardous river. What is not
well known is that Frogger actually began as a prototype board
game based on a $1$-D concept at a now-defunct
... | 26,045 |
10 Kinds of People
Description:
The world is made up of $10$ kinds of people, those who
understand binary and those who do not. These different kinds
of people do not always get along so well. Bob might ask for a
$10000$ ounce coffee
(meaning binary) and Alice might make misinterpret his request
as... | 26,046 |
2, 4, 6, Greaaat
Description:
Against her wishes, Rainbow Dash was put in charge of coach
the buckball halftime cheerleading squad. While she doesn’t
have the slightest care for cheerleading (she’d much rather
coach the team), she’s determined to give it her all to show
everypony in the squad how much ... | 26,047 |
2048
Description:
2048 is a single-player puzzle game
created by Gabriele Cirulli1. It is played
on a $4 \times 4$ grid
that contains integers $\geq
2$ that are powers of 2. The player can use a keyboard
arrow key (left/up/right/down) to move all the tiles
simultaneously. Tiles slide as far as ... | 26,048 |
24 Game
Description:
In his unending goal to become the greatest programmer of
all time, Gustav has decided to go to Singapore. Curiosity
leads him into the game room, where some of his new friends are
playing cards. "What game are you playing?" he asks. His
friends go on to tell him about a seemingly ... | 26,049 |
3-Sided Dice
Description:
Just like every fall, the organizers of the Southwestern
Europe Dice Simulation Contest are busy again this year. In
this edition you have to simulate a $3$-sided die that outputs each of
three possible outcomes (which will be denoted by $1$, $2$ and $3$) with a given probability,... | 26,050 |
3D Printed Statues
Description:
You have a single 3D printer, and would like to use it to
produce $n$ statues.
However, printing the statues one by one on the 3D printer
takes a long time, so it may be more time-efficient to first
use the 3D printer to print a new printer. That new printer may
then... | 26,051 |
3D Printer
Description:
3D printing is a technique for manufacturing items from a
digital template. The printer lays down layers of a polymer
material, building an entire 3D object as a series of flat
plates of varying shapes, stacked upon one another. The polymer
is initially sticky enough so that the... | 26,052 |
4 thought
Description:
Write a program which, given an integer $n$ as input, will produce a
mathematical expression whose solution is $n$. The solution is restricted to
using exactly four $4$’s
and exactly three of the binary operations selected from the
set $\{ *, +, -, /\} $.
The number $4$ is th... | 26,053 |
99 Problems
Description:
You’re creating problems for competitive
programming practical examination, but you’re told your
problems are either too hard or too easy. Fortunately, you’ve
got 99 problems and coming up with more ain’t one. To decide on
suitable problems, you will discard problems based on t... | 26,054 |
99 Problems
Description:
Ingrid is the founder of a company that sells bicycle parts.
She used to set the prices of products quite arbitrarily, but
now she has decided that it would be more profitable if the
prices end in $99$.
You are given a positive integer $N$, the price of a product. Your task
is... | 26,055 |
A (Fast) Walk in the Woods
Description:
Brice Bilson loves to take jogs in a nearby forest known as
Orthogonal Woods. The forest gets that name as the paths – all
two-way – are laid out along an orthogonal grid, with all turns
being 90 degrees. Brice is a bit persnickety when it comes to
his jogs, and ... | 26,056 |
A Brief Gerrymander
Description:
The evil ruling party, the Liberatives, are redistributing
the electoral regions (ridings) in your city, and are
nefariously attempting to pack certain opposition-friendly
neighborhoods into as few ridings as possible. If this plan
succeeds, it will be the end of democr... | 26,057 |
A Cappella Recording
Description:
Geoffry is preparing an a cappella composition where he
sings the entire song by himself.
Each note of the song has a pitch between $0$ and $10^9$. Because of the varying pitches
in the song, Geoffry will record himself singing multiple
times. In a single recording, he wi... | 26,058 |
A Classy Problem
Description:
In his memoir “So, Anyway”, comedian John Cleese writes of
the class difference between his father (who was
“middle-middle-middle-lower-middle class” and his mother (who
was “upper-upper-lower-middle class”). These fine distinctions
between classes tend to confuse North Am... | 26,059 |
A Complex Problem
Description:
There are many problems in the field of computer science,
and some are harder than others. Computer scientists have
accordingly categorized problems using complexity classes, and
like to analyze these classes to see how they interact with
each other.
A complexity class i... | 26,060 |
A Different List Game
Description:
You are playing the following simple game with a friend:
* The first player picks a positive integer $X$.
* The second player gives a list of $k$ distinct positive
integers $Y_1, \ldots , Y_
k$ such that $(Y_1+1)(Y_2+1) \cdots (Y_ k+1) =
X$, and gets $k$ poi... | 26,061 |
A Different Problem
Description:
Write a program that computes the difference between
non-negative integers.
## Input
Each line of the input consists of a pair of integers. Each
integer is between $0$ and
$10^{15}$ (inclusive). The
input is terminated by end of file.
## Output
For each pair of inte... | 26,062 |
A Favourable Ending
Description:
Fiction books are all the same. The author has decided
everything in advance, from beginning, middle, to the final
plot. You, the reader, just read from page 1 to the very
last page, in that order. So predictable.
A choose-your-own-story fiction book is different. The book... | 26,063 |
A Feast For Cats
Description:
Your crazy aunt has asked you to watch her cats while she’s
attending a seminar about making cat hats out of cat fur. Your
aunt owns a great number of cats – all toms – and, due to the
complex social structure of cats, every cat has a specific but
different amount of hate ... | 26,064 |
A Flea on a Chessboard
Description:
An infinite chessboard is obtained by extending a finite
chessboard to the right and up infinitely. Each square of the
chessboard is either black or white with the side length of
$S$ millimeters. The
leftmost bottom square of the chessboard is black. A flea is
po... | 26,065 |
A Furious Cocktail
Description:
In Minecraft, potions can be made and drank. When drank,
they apply the corresponding potion effect to the player for
some specified amount of time. “A Furious Cocktail” is the name
of the advancement where a player has every potion effect
applied at the same time. This ... | 26,066 |
A Horse Shoe-In
Description:
With Twilight Sparkle making preparations to ascend the
throne as the new ruler of Equestria, she has resigned from her
post as the headmare of the School of Friendship, appointing
former guidance counselor Starlight Glimmer in her place.
Knowing that the work will be too much... | 26,067 |
A List Game
Description:
You are playing the following simple game with a friend:
* The first player picks a positive integer $X$.
* The second player gives a list of $k$ positive integers $Y_1, \ldots , Y_ k$ such that
$(Y_1+1)(Y_2+1) \cdots (Y_
k+1) = X$, and gets $k$ points.
The first player pick... | 26,068 |
A Little to the Right
Description:
You’ve decided that you want to rearrange your trophy case
lately. You want to order them all on a single line from left
to right. However, you also want the arrangement of the
trophies to be “satisfying”.
Each trophy has a certain number of properties, such as
heigh... | 26,069 |
A Mazing!
Description:
A maze consists of a collection of equal sized square cells,
where any or all of the sides may be a wall or a door. The maze
may have no exit or multiple exits. Cells are typically
arranged so that they may share sides with other cells as shown
in the four sample mazes below:
Ea... | 26,070 |
A Multiplication Game
Description:
Stan and Ollie play the game of multiplication by
multiplying an integer $p$
by one of the numbers $2$
to $9$. Stan always starts
with $p = 1$, does his
multiplication, then Ollie multiplies the number, then Stan and
so on. Before a game starts, they draw an i... | 26,071 |
A Musical Question
Description:
Bob Roberts likes to listen to music while he drives, but
the car he owns is a little antiquated. No Bluetooth or USB
connections here, but at least he has a CD player, so he’s been
transferring a lot of his music to CDs. At the moment he has
only two CDs left and would ... | 26,072 |
A New Adventure
Description:
‘Hunter’: a licensed profession for those who specialize in
finding rare creatures or secret treasures.
Gon has embarked on a new journey to become a Hunter.
Yesterday, Gon arrived in Hanoi to participate in the Hunter
Exam — an annual exam which an applicant must pass, in
... | 26,073 |
A New Alphabet
Description:
A New Alphabet has been developed for Internet
communications. While the glyphs of the new alphabet don’t
necessarily improve communications in any meaningful way, they
certainly make us feel cooler.
You are tasked with creating a translation program to speed
up the switch ... | 26,074 |
A Pivotal Question
Description:
Quicksort is a recursive sorting algorithm developed in 1959
by Tony Hoare. One of the major steps in the algorithm is the
partition step: given an element $p$ in the array (the pivot
element) rearrange the elements in the array as shown below
where all the values in $... | 26,075 |
A Prize No One Can Win
Description:
After the festive opening of your new store, the Boutique
store for Alternative Paramedicine and Cwakhsahlvereigh, to
your disappointment you find out that you are not making as
many sales as you had hoped. To remedy this, you decide to run
a special offer: you will ... | 26,076 |
A Question of Ingestion
Description:
Stan Ford is a typical college graduate student, meaning
that one of the most important things on his mind is where his
next meal will be. Fortune has smiled on him as he’s been
invited to a multi-course barbecue put on by some of the
corporate sponsors of his resea... | 26,077 |
A Random Problem
Description:
Generating a random number sequence is not easy. Many
sequences may look random but upon closer inspection we can
find hidden regularities in the occurrence of the numbers. For
example, consider the following $100$-digit “random” sequence starting
with $4, 7, 9, \ldots
... | 26,078 |
A Rank Problem
Description:
Coach is fed up with sports rankings – he thinks those who
make up these bogus orderings are just nuts. In Coach’s opinion
changes in rankings should be evidence-based only. For example,
suppose the $4$th place
team plays the $1$st place
team and loses. Why should the ra... | 26,079 |
A Rational Sequence
Description:
An infinite full binary tree labeled by positive rational
numbers is defined by:
* The label of the root is $1/1$.
* The left child of label $p/q$ is $p/(p+q)$.
* The right child of label $p/q$ is $(p+q)/q$.
The label of the root is $1/1$.
The left child of label $p/q$ is $p/(... | 26,080 |
A Rational Sequence (Take 3)
Description:
A sequence of positive rational numbers is defined as
follows:
An infinite full binary tree labeled by positive rational
numbers is defined by:
* The label of the root is $1/1$.
* The left child of label $p/q$ is $p/(p+q)$.
* The right child of label $p/q$ is $(p+q... | 26,081 |
A Rational Sequence 2
Description:
A sequence of positive rational numbers is defined as
follows:
An infinite full binary tree labeled by positive rational
numbers is defined by:
* The label of the root is $1/1$.
* The left child of label $p/q$ is $p/(p+q)$.
* The right child of label $p/q$ is $(p+q)/q$.
... | 26,082 |
A Real Challenge
Description:
## Input
The input consists of a single integer $a$ ($1
\le a \le 10^{18}$), the area in square meters of Old
MacDonald’s pasture.
## Output
Output the total length of fence needed for the pasture, in
meters. The length should be accurate to an absolute or
relative erro... | 26,083 |
A Recurring Problem
Description:
You have a very big problem! You love recurrence relations,
perhaps a bit too much. In particular, you are a fan of
positive linear recurrence relations (PLRR), which can be
defined as follows. First, you choose the order $k$ of the relation. Then you choose
coefficient... | 26,084 |
A Royal Problem
Description:
The two rulers of Equestria, Princess Celestia and Princess
Luna, got into a massive argument, and Starlight Glimmer needs
to help them resolve it, lest the kingdom of Equestria fall
into chaos!
For now, Starlight needs to ensure that Celestia and Luna do
not encounter eac... | 26,085 |
A Safe Bet
Description:
Safe Ltd. is a company that manufactures high-quality
safes. Its latest invention is an optical closure mechanism
that uses a laser beam passing through a rectangular grid with
several mirrors.
When the laser is activated, a beam enters the top row of
the grid horizontally from... | 26,086 |
A Second Opinion
Description:
Write a program that, given a duration in seconds as input,
outputs the same duration as hours, minutes, and seconds.
Hint: use integer division (//)
and remainder (%).
## Input
One line containing the integer $s$, the number of seconds that should
be rewritten, where $0 \l... | 26,087 |
A Shortcut to What?
Description:
Write a program that reads an integer $n$ from the input. The program should
add five to $n$, then
triple the value and finally subtract ten. You are welcome to
simplify the formula if you can, as long as the program gives
the correct results.
## Input
Input consists ... | 26,088 |
A Simple Game
Description:
Whenever Tyko and his mother Maj get into a disagreement on
Tyko’s bedtime, they play $10^5$ rounds of their favorite game.
If Tyko plays well enough, he gets to stay up for $1$ more hour! The game can be seen as
an evolved version of rock-paper-scissors-lizard-Spock, in that
... | 26,089 |
A Stack of Gold
Description:
Lt. Columbo, arguably the best detective in the world,
was faced with a problem. He was asked: if he was placed in a
room with some number of stacks of gold-colored coins, where
all but one stack consisted solely of tungsten coins, and the
remaining stack consisted solely o... | 26,090 |
A Star not a Tree?
Description:
Luke wants to upgrade his home computer network from 10mbs
to 100mbs. His existing network uses 10base2 (coaxial) cables
that allow you to connect any number of computers together in a
linear arrangement. Luke is particulary proud that he solved a
nasty NP-complete probl... | 26,091 |
A Towering Problem
Description:
You’ve been put in charge of an art exhibit from the famous
minimalist sculptor J (even his name is minimalist!). J’s work
involves the careful layout of vertically dispositioned
orthogonal parallelpipeds in a set of tapering obelisks — in
other words, he puts smaller bo... | 26,092 |
A Tree and Two Edges
Description:
Given a connected simple graph (with at most one edge
between any pair of nodes) with $n$ nodes and $n+1$ edges (that’s a tree with two
extra edges), answer a list of queries: for two distinct nodes,
how many simple paths are there between them? A simple path is
a path... | 26,093 |
A Trivial Pursuit
Description:
It’s time for the Trivia Trot, a competition where
anything—and everything—can be asked! Twilight is absolutely
ready to wreck the competition and win it for the three-peat;
she’s studied Ancient Legends, Wonderbolt History, and Spells
So Old, Not Even Star Swirl the Bear... | 26,094 |
A Vicious Pikeman (Easy)
Description:
Note that this is an easier version of the problem
pikemanhard.
One of the reasons for this somewhat peculiar theory was the
finding of ancient pike, a combat spear. Scientists have found
many of these throughout the years. They come with a special
symbol carved i... | 26,095 |
A Vicious Pikeman (Hard)
Description:
Note that this is a harder version of the problem
pikemaneasy.
One of the reasons for this somewhat peculiar theory was the
finding of ancient pike, a combat spear. Scientists have found
many of these throughout the years. They come with a special
symbol carved in... | 26,096 |
A Walk Through The Forest
Description:
Jimmy experiences a lot of stress at work these days,
especially since his accident made working difficult. To relax
after a hard day, he likes to walk home. To make things even
nicer, his office is on one side of a forest, and his house is
on the other. A nice wa... | 26,097 |
A+B Problem
Description:
Given $N$ integers in
the range $[-50\, 000, 50\,
000]$, how many ways are there to pick three integers
$a_ i$, $a_ j$, $a_ k$, such that $i$, $j$, $k$ are pairwise distinct and
$a_ i + a_ j = a_ k$? Two
ways are different if their ordered triples $(i, j, k)$ of indices are... | 26,098 |
A+B or A-B?
Description:
Alice believes that a friendly mid-term contest should start
with an $A+B$ problem. But
Bob disagrees. To increase creativity, he thinks an
$A-B$ problem should be
used instead.
To settle the dispute, the contest organizers have decided
to use both problems. Given two inte... | 26,099 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.