task stringlengths 0 154k | __index_level_0__ int64 0 39.2k |
|---|---|
Jupiter Orbiter
Description:
Although we imagine interplanetary probes to be very
sophisticated pieces of technology, their information systems
are quite archaic. You might assume that they have a certain
amount of contiguous main memory and can store their data
wherever is convenient, but unfortunatel... | 28,400 |
Jurassic Jigsaw
Description:
The famous Jurassic park biologist Dean O’Saur has
discovered new samples of what he expects to be the DNA of a
dinosaur. With the help of his assistant Petra Dactil, he
managed to sequence the samples, and now they are ready for
analysis. Dean thinks this dinosaur was affe... | 28,401 |
Jurassic Jungle
Description:
After having read all the books and watched all the movies
from the ‘Jurassic Park’ franchise, Jarvi now knows all about
dinosaurs. He has decided to build his own ‘Jurassic Park’ …no,
parks are too small, Jarvi will build his own ‘Jurassic
Jungle’.
Jarvi has already start... | 28,402 |
Jury Jeopardy
Description:
What would a programming contest be without a problem
featuring an ASCII-maze? Do not despair: one of the judges has
designed such a problem.
The problem is about a maze that has exactly one
entrance/exit, contains no cycles and has no empty space that
is completely enclosed... | 28,403 |
Jus Accrescendi
Description:
“Say not you know another entirely, till
you have divided an inheritance with him.” –Johann
Lavater.
There has been a heated broil between the three children of
the late prime minister over how to divide their father’s
property. Reading the will, it is discovered that the... | 28,404 |
Just A Few More Triangles!
Description:
Recently, Simon has discovered the fantastic world of
counting modulo some integer $n$. As you may imagine, he quickly
realizes that there are multitudes of Pythagorean triples to
which he has previously been oblivious! Simon therefore sets
out to find all Pythag... | 28,405 |
Just Do It
Description:
Given an array $a_1, a_2,
\ldots , a_ n$ of integers, find the following value,
modulo $1\, 000\, 003\,
233$:
## Input
The first line of input contains an integer $n$, denoting the size of the array
($1 \leq n \leq 300\,
000$).
The second line of input contains $n$ intege... | 28,406 |
Just Enough Bridges
Description:
Chimera Ant is an intelligent and hard-working species.
There is a colony of $n$ Chimera Ants living near Han River
in Danang, Vietnam. They have built $n$ houses (one house for one ant) on
one side of Han River, and $n$ feeding grounds on the other side
of Han River. The ... | 28,407 |
Just Enough Water
Description:
As you may remember, in The $2\, 016$ ICPC Nha Trang Regional
Contest, the problem Reservoir, we have
built a reservoir near the Red River. The reservoir can be
viewed as a rectangular box with unit-length width. Its length
can be divided into $n$
sections of unit-len... | 28,408 |
Just Passing Through
Description:
Justin and Fred are taking a road trip, traveling from West
to East across their state. They have a few Road Trip
Rules:
* They must have an awesome time!
* The trip must begin somewhere along the Western edge of
the state and finish somewhere along the Eastern edge ... | 28,409 |
Just a Minute
Description:
The American Commuter Movement and the International
Commuting Peoples’ Community have had it with this. Especially
Johan, a young student, who has decided to investigate this
matter further. Johan went to one of the stations, and studied
the behaviour of the displays. Each t... | 28,410 |
Just a Quiz
Description:
In the TV quiz Monstermind, a contestant chooses a
topic and is then asked questions about it during a fixed
period of time. The contestant earns one point for each correct
answer. When the time runs out, the contestant must be
silent.
Teresa has figured out such a niche topic... | 28,411 |
Just for Sidekicks
Description:
The ponies’ pets are playing with some gems they found.
There are six types of gems, with values $V_1, V_2, \dots , V_6$,
respectively.
They have laid out $N$
gems in a row. The $i^\text
{th}$ of these gems is of type $P_ i$.
Now, with nothing better to do and no bette... | 28,412 |
Justice Served
Description:
You looked at the security recordings and saw a total of
$n$ suspects that had been
in the room where you left your stroopwafel, each entering and
leaving the room exactly once. After seeing this, you already
had a good idea who took it since your archrival Rob – who has
... | 28,413 |
Justice for Ants
Description:
Chimera Ant is an intelligent and hard-working species.
There is a colony of Chimera Ants living in Danang, Vietnam.
With careful infrastructure planning and hard work, they have
built their kingdom with $n$ towns, numbered from $1$ to $n$. The towns are connected by
$n - 1$ ... | 28,414 |
K-In-A-Row
Description:
Hansel and Gretel do not listen to their teacher at school.
Instead they secretly play a game called K-In-A-Row. One day in
the evening they started to argue who had won more games that
day. They collected all the papers they had used for playing
the game and they started to cou... | 28,415 |
K-Inversions
Description:
You are given a string $s$ consisting only of upper case
letters A and B. For an
integer $k$, a pair of
indices $i$ and
$j$ ($1 \le i<j \le n$) is called a
$k$-inversion if and only
if $s[i] = \textbf{B}$,
$s[j] = \textbf{A}$ and
$j-i = k$.
Consider the string... | 28,416 |
K-Rotating
Description:
A new school year has started. The high school for gifted
students of Ho Chi Minh city has $N$ classes numbered from $1$ to $N$. All $N$ classes will go through
$M$ studying weeks. The
high school has $N$
teachers numbered from $1$
to $N$. At the beginning
teacher $i$ is... | 28,417 |
K-Walks
Description:
It is the final team contest. After some persuasion from his
fellow problem setters, Lord Pooty decided to make an
easy problem. Today, he was thinking about shortest path
problems. It is a classic problem with many variants. Today, he
decided to ask you on one interesting variant ... | 28,418 |
KALLAX Construction
Description:
You are the owner of IKEA, and you need to order a large
number of bolts $B$. There
is a single bolt manufacturer, but there are multiple companies
reselling these bolts in packs (e.g. boxes, pallets). These
companies form a directed chain, where each company buys packs... | 28,419 |
KATT:s and rats
Description:
A special type of mutated giant rats have taken over the
sewers of Gothenburg, and the city management has asked for
your help in solving the problem.
The sewer consists of $N$ manholes numbered from
$1$ to $N$, with $N-1$ pipes connecting the manholes.
Each pipe connects ... | 28,420 |
Kabobs
Description:
Anna wants to open a marvelous restaurant, “Candy Mountain”,
serving only candy kabobs: sticks on which one puts
various pieces of food, to be eaten from the tip to the
base.
Like other kabob enthusiasts, when Anna eats a pattern of
consecutive types of food in a kabob, she expects... | 28,421 |
Kaboom
Description:
Luka found an interesting tape in the chem lab. The tape is
divided into $N$ segments
of equal length, and can easily be bent between two segments,
but only by exactly $180$
degrees.
One side of the tape is completely covered with a very
volatile chemical. If the chemical comes... | 28,422 |
Kaffiskömmtun
Description:
One of the most important resources to a university is
coffee. It is of the utmost importance that this resource is
utilized to its maximum potential.
To this end, coffee has to be prepared regularly. This
preparation has to be timed correctly, since computer science
profess... | 28,423 |
Kafkaesque
Description:
Getting a business permit in Kafkatown requires a trip to
City Hall. There you are given a permit form that must be
signed by $K$ city clerks
whose names are printed at the bottom of the form.
Entering the clerks’ room, you find a long line of people
working their way down a na... | 28,424 |
Kaguya Wa Saketakunai
Description:
The Shinomiya corporation is Japan’s
biggest family-owned conglomerate, with a portfolio of multiple
businesses in railway, trade and retail. With a family of such
high esteem, it is important to maintain their status and
image, paramount to stereotypical Asian cultur... | 28,425 |
Kaleidoscopic Palindromes
Description:
Nicholas Neverson was a student at Northlings Neverland
Academy. As with any daydreaming student, Nicholas was playing
around with a Kaleidoscope one day instead of paying attention
to the teacher. Since this was math class, his daydreams
quickly turned to palindr... | 28,426 |
Kamioni
Description:
We are observing the movement of $N$ trucks on the road. The road can
be represented as a number line. The points on the line
denoting cities are integers. The cities are denoted with the
number of the corresponding point on the line.
All trucks are moving with the same speed and
... | 28,427 |
Kamp
Description:
In a certain flooded village, a secret superhuman
humanitarian camp is being opened as we speak. The village
consists of $N$ houses
marked with integers from $1$ to $N$. The houses are connected to each
other with $N-1$ roads so
that there is a unique way between each two houses.
... | 28,428 |
Kanna's Friendship
Description:
Kanna is new to the human world and
has recently made new friends due to her kind and personable
nature. Possessing a sharp mind and an insatiable curiousity
towards learning about the human world, Kanna is always keen to try new things. One day,
while playing with her b... | 28,429 |
Karel the Robot
Description:
Did you know that the word “robot” is almost $100$ years old? It was first
introduced in $1920$, in
the science-fiction theatrical play R.U.R., written by
Karel Čapek. As a tribute to this Czech writer, an educational
programming language was named Karel many years later at... | 28,430 |
Karl Coder
Description:
Karl is an aspiring C programmer, and is excited by the
risks and rewards of low-level manual memory management. In the
program he currently develops, he stores a string containing
$N$ non-zero bytes into a
buffer named “buf”. By mistake he
accidentally made the buffer $2
... | 28,431 |
Karte
Description:
Recently, Pero has been into robotics, so he decided to make
a robot that checks whether a deck of poker cards is
complete.
He’s already done a fair share of work—he wrote a programme
that recognizes the suits of the cards. For simplicity’s sake,
we can assume that all cards have a ... | 28,432 |
Kastenlauf
Description:
Once every year, Jo and his friends want to visit the local
fair in Erlangen, called Bergkirchweih. This year, they want to
make a Kastenlauf (box run). They start at Jo’s home, and have
one box (Kasten) of beer (with twenty bottles). As they are
very thirsty, they drink one bot... | 28,433 |
Kattis
Description:
Kattis is tired of your shit. Every day, she has to compile
your shit code (that probably won’t even compile...), run it on
some test data, and then validate your shit answers (assuming
your code will actually finish in time – as if!). But no more.
The world had for a long time been... | 28,434 |
Kattis Speedrun
Description:
Joshua’s New Year’s resolution for 2024 was to solve half of
all problems on the Kattis platform before the year ends. As
the year draws to a close, he realizes he’ll need to use every
strategy he knows to reach his goal. So far, he has only solved
others’ problems on Katti... | 28,435 |
Kattis' Little Helpers
Description:
But help is on its way! Kattis has recently acquired a
number of programmable catbots, which she can send off on all
these errands instead of going herself. Each catbot is equipped
with a top-of-the-line MeowFi antenna, with which it can
instantly transfer any materi... | 28,436 |
Kattis's Quest
Description:
Kattis the Cat enjoys clearing quests on her mobile game.
Each quest has an energy consumption $E$, and gold reward $G$. However, as Kattis has become
very busy lately with grading her student’s problem sets, she
does not have much spare time as before to keep clearing
quest... | 28,437 |
Kayaking Trip
Description:
The kayaks are of different types and have different amounts
of packing, so some are more easily paddled than others. This
is captured by a speed factor $c$ that you have already figured out
for each kayak. The final speed $v$ of a kayak, however, is also
determined by the st... | 28,438 |
Kebab Pizza
Description:
Alice loves pizza and plans to throw a pizza party for her
birthday, where she will make one big, round pizza for all her
guests. She knows that her friends are a bit special when it
comes to pizza: Julie does not want any vegetables but loves
kebab meat on her pizza. Katy woul... | 28,439 |
Keep Calm And Carry Off
Description:
A few weeks ago, she also learnt a simpler method of
addition. In this method, you repeatedly add $1$ to one of the numbers and subtract
$1$ from the other, until
the second one reaches zero. This can of course take a lot of
time for large numbers.
Petra now wants ... | 28,440 |
Keep Him Inside
Description:
As a result of a long-standing war between the Sorcerers and
the Orcs, you have been assigned as officer of one of the
prison blocks. Recently the leader of the Orcs has been
captured and placed inside a special cell. It works as follows:
the cell is a convex polygon with a... | 28,441 |
Keep It Sorted
Description:
Gon has a permutation $a =
(a_1, a_2, \ldots , a_ n)$ of integers between
$1$ and $n$ (inclusive), and wants to sort it
in increasing order. However, sorting is trivial — anyone
can sort an array!
Thus, Gon decides to only use the following operation to
sort:
* Select ... | 28,442 |
Keep Them Separated
Description:
Team Socket was defeated by Bash — the Pokenom trainer — and
Bash’s best Pokenom Chikapu for the $10^9 +
7$-th time. Team Socket realized that Bash and
Chikapu were simply too strong together. Now team Socket is
devising an evil plan to keep Bash and Chikapu separated! ... | 28,443 |
Keep it Cool
Description:
You can only refill the fridge from the front, so in an
ideal world, you would first take out all the sodas currently
in the fridge, then put in the $n$ new ones, and then put the old and
cold sodas in front of the new ones. But in an ideal world you
would also not have two ex... | 28,444 |
Keep the Parade Safe
Description:
The 1941 October Revolution Parade of
November $7^{th}$, 1941,
taking place in Moscow, Soviet Union, was a parade in honor of
the October Revolution 24 years ealier.
It was one of the most memorable parade because of the serious
circumstance at that time: Soviet’s ... | 28,445 |
Keeping On Track
Description:
Acmar and Ibmar are at war! You are in charge of a rail
network that transports important supplies throughout the great
state of Acmar during this delicate time. The rail system is
made up of a set of rail lines which meet at various junction
points. While there is no limi... | 28,446 |
Keeping the Dogs Apart
Description:
Shadow and Lydia have a particular walk they each prefer and
know by heart. If you just let them out, they will follow their
favorite walk, eventually ending up in their respective
doghouses. Problem solved!
Sadly, you realize that if you just let both dogs out at the
... | 28,447 |
Kemija
Description:
Instead of paying attention in class, Luka is killing time
playing with numbers again. This time, he wrote $N$ non-negative integers so that they
form a ring (circle). After that he formed a new ring by adding
to each number its two neighbours.
The teacher noticed this and took away th... | 28,448 |
Kemija
Description:
Luka is fooling around in chemistry class again! Instead of
balancing equations he is writing coded sentences on a piece of
paper. Luka modifies every word in a sentence by adding, after
each vowel (letters ’a’, ’e’, ’i’, ’o’ and ’u’), the letter ’p’
and then that same vowel again. ... | 28,449 |
KenKen You Do It?
Description:
KenKen is a popular logic puzzle developed in Japan in 2004.
It consists of an $n \times
n$ grid divided up into various non-overlapping
sections, where each section is labeled with an integer target
value and an arithmetic operator. The object is to fill in the
entir... | 28,450 |
Ketek Counting
Description:
Define a Ketek to be a sentence that reads the same
forwards and backwards, by word. For example, ‘fall leaves
after leaves fall’ is a Ketek since the words in
reverse order are the same as the original order.
Given a string consisting of lower-case letters and the
characte... | 28,451 |
Key Item Recovery
Description:
Pichuu, the Pokemon Master, faced a dilemma after destroying
Team Galactic, becoming the champion and catching every
legendary Pokemon. He realized he had lost his town map, a
precious item given to him by his mother and also a Key Item!
To avoid her scolding, Pichuu deci... | 28,452 |
Key to Knowledge
Description:
A while ago a class of students took an exam. It consisted
of true-or-false questions only, but the questions were really
tough! Even afterward, with the help of the book, lecture notes
and each other, the students are not sure what all the correct
answers were. They could... | 28,453 |
Keyboard Queries
Description:
Katrín and her friends are university students, and they go
to a seminar every week. At the start of each seminar, the
professor divides the students into groups randomly. Katrín and
her friends dislike random groups, they want to form a group
together so they can chat wit... | 28,454 |
Keyboardd
Description:
This could not have happened at a more inconvenient time; it
is the start of the contest and she was just about to type in
the solution to the first problem! Joanna does not have time to
remove and clean every key on her keyboard, so she wonders if
there is a way to quickly ident... | 28,455 |
Keyboarding
Description:
How many keystrokes are necessary to type a text message?
You may think that it is equal to the number of characters in
the text, but this is correct only if one keystroke generates
one character. With pocket-size devices, the possibilities for
typing text are often limited. So... | 28,456 |
Keyboards in Concert
Description:
Olav has some electronic keyboards and would like to play a
tune. Unfortunately all of Olav’s keyboards are broken so each
of them can only play some of the notes. By switching which
instrument he is using he will be able to play the whole tune,
but moving keyboards ar... | 28,457 |
Keylogger
Description:
Thore likes mechanical keyboards. He uses a highly
customised design, where every key has been carefully selected
for resistance, actuation point, tactile feedback, travel
distance, and clickiness. He finds the sound of the mechanical
keys very satisfying. Your office is next to ... | 28,458 |
Keys
Description:
Adam carries a bunch of keys attached to key rings, some of
which may be connected to each other. The rings are common key
rings, so a key can be attached to or detached from a ring by
sliding along the spiral. In the same way, two rings can be
connected or disconnected. Adam wants to... | 28,459 |
Keys, Phone, Wallet
Description:
Oh no, you slept in and have to rush to get to work on time!
It is also very cold outside!
In your rush to put on Winter gear and leave home quickly,
you wonder if you forgot your keys,
phone, or wallet. You had better check.
## Input
The first line of input contains a s... | 28,460 |
Keywords
Description:
Catherine is a brilliant software engineer, but she has been
having difficulty landing a job, despite having submitted a
superb resume to dozens of tech companies. After doing some
research, she discovered that most tech companies in her area
use an algorithm to prescreen resumes ... | 28,461 |
Kiki Boba
Description:
“Kiki” and “boba” form a fascinating sound-symbolic
connection, where people spontaneously associate sharp sounds
like “kiki” with jagged shapes and
softer sounds like “boba” with
rounder shapes. This reveals an underlying link between sounds
and visual properties, providing ... | 28,462 |
Killing Aliens in a Borg Maze
Description:
The Borg is an immensely powerful race of enhanced humanoids
from the delta quadrant of the galaxy. The Borg collective is
the term used to describe the group consciousness of the Borg
civilization. Each Borg individual is linked to the collective
by a sophist... | 28,463 |
Killing Chaos
Description:
In the dangerous wild west, robbers are attacking a long
train with many coaches. Chaos erupts, and the robbers realize
that the amount of chaos equals the number of passengers in the
train, rounded up to the nearest multiple of $10$. In order to quench the chaos,
they theref... | 28,464 |
Kinda Ok Array Problem
Description:
This is an array problem.
You are given an array $A$ that contains $N$ numbers, $A_1, \dots , A_ N$. Count the number
of distinct subarrays of $A$ where the sum of the elements in
the subarray is even.
Note that an subarray is a contiguous part of an array (E.g.
$[2, 3... | 28,465 |
Kindergarten
Description:
Every year the three friendly teachers at the kindergarten
let their classes’ kids change classes to form three new ones.
Some kids, of course, are old enough to leave, but those who
stay for another year are rearranged among the three
teachers.
The teachers even let the kids... | 28,466 |
Kindergarten
Description:
You know the kids in your group very well. Each kid is
jealous of one other kid, who is cooler than them, and they
might misbehave in the telescope room if they know the kid
they’re jealous of will be there at some point after them—not
necessarily immediately after them, just ... | 28,467 |
Kindergarten Excursion
Description:
The kindergarten teachers had finally managed to get all the
kids in a line for the walk to the bus station and the weekly
excursion. What they hadn’t thought of was the fact that today
different kids were supposed to go to different excursions.
They should walk as o... | 28,468 |
King of Spades
Description:
“King of Spades” is a two-player card game which is played
with an unconventionally large deck composed of standard
playing cards. The game is set up by splitting the deck into
two arbitrary piles, and then the cards from each pile are laid
face-up in a line.
A player’s tur... | 28,469 |
King of the Waves
Description:
You are organising a king of the hill tournament, the Buenos
Aires Paddleboarding Competition (BAPC), with $n$ participants. In a king of the
hill tournament, one person starts as a “king” and is then
challenged by another person, the winning person becomes the
new king. ... | 28,470 |
King's Colors
Description:
The flag will of course consist of the King’s favorite tree,
which contains $n$ nodes.
The King would be happy to just have the tree colored in black
and white, but for the sake of his wife the Queen, he decided
that the tree will contain all the favorite colors of their
... | 28,471 |
King's Decree
Description:
The Cat Kingdom is a very large kingdom, with $n$ cats living in it. The cats are
numbered from $1$ to
$n$.
King SoCCat has noticed a glaring problem in the kingdom —
the uneven distribution of wealth among the cats. To solve this
problem, King SoCCat has decreed that wealth... | 28,472 |
Kingdom of Ants
Description:
The Chimera Ants are building their own kingdom!
There are $n$ ants
numbered from $1$ to
$n$. Each ant is
responsible for kingdom construction in a rectangular region.
More precisely, the $i$-th
ant is assigned a rectangular region in Cartesian plane, with
edges pa... | 28,473 |
Kingdom of Cats
Description:
You probably still remember the problem Kingdom of Kittens from The $2\, 018$ ICPC Asia Hanoi Regional
Contest. It has been two years since then, the kingdom has
since evolved into Kingdom of Cats, with
even more challenging problems.
As their kingdom grows, the cats need to s... | 28,474 |
Kingdom of Hamsters
Description:
Near the great desert of Byteland lies a technologically
advanced kingdom of hamsters. In the year 2020, to protect
better their territories, the hamsters have decided to build a
great wall surrounding crucial parts of their kingdom.
The kingdom of hamsters is represented ... | 28,475 |
Kingdom of Kittens
Description:
In a country far far away, there are so many cats. The cats
quickly dominate the whole area, they can even overwhelm
humans! Mature cats plan to establish their own kingdom for
their own kittens! The first thing to do is setting the border
of their kingdom.
One day, the... | 28,476 |
Kingdoms
Description:
Several kingdoms got into serious financial troubles. For
many years, they have been secretly borrowing more and more
money from each other. Now, with their liabilities exposed, the
crash is inevitable…
There are $n$ kingdoms.
For each pair $(A, B)$ of
kingdoms, the amount of... | 28,477 |
Kingpin Escape
Description:
You are the kingpin of a large network of criminal hackers.
Legend has it there has never been a richer criminal than you.
Not just because you are the smartest, but also because you are
the stingiest.
The police have been after you for years, but they have
never been able ... | 28,478 |
Kinking Cables
Description:
You need to lay a cable to connect two computers with each
other. This cable however has a very specific length and you
need to use exactly the full length of the cable. Moreover, the
cable cannot intersect itself and one part of the cable cannot
be too close to another part... | 28,479 |
Kinky Word Search
Description:
You’re probably familiar with regular word searches, where
you’re presented with a grid of letters and a word to find. The
word can be in a straight line horizontally, vertically, or
diagonally (and perhaps backwards in any of those directions).
For example, here is a gri... | 28,480 |
Kitchen Combinatorics
Description:
Each potential dish has a list of ingredients. Each
ingredient is in turn available from a few different brands.
Each brand is of course unique in its own special way, so using
a particular brand of an ingredient will always result in a
completely different dinner exp... | 28,481 |
Kitchen Measurements
Description:
You are making a recipe and need to measure a precise volume
of liquid. There are an assortment of cups of varying volumes
in your kitchen, however no cup has any markings on it other
than to indicate its total volume, and none of them match the
volume that you want. Y... | 28,482 |
Kitesurfing
Description:
Nora the kitesurfer is taking part in a race across the
Frisian islands, a very long and thin archipelago in the north
of the Netherlands. The race takes place on the water and
follows a straight line from start to finish. Any islands on
the route must be jumped over – it is no... | 28,483 |
Kitten of Chaos
Description:
Now, Klaus’ paw slowly executes his diabolical deed. His
cute fluffy face radiates inadvertent innocence. Knowing that
any intervention would only delay the inevitable, Karen wonders
what will happen to the string her sister Kim wrote on the
precious glass object. After all... | 28,484 |
Kitten on a Tree
Description:
## Input
The input is a description of a single tree. The first line
contains an integer $K$,
denoting the branch on which the kitten got stuck. The next
lines each contain two or more integers $a, b_1, b_2, \ldots $. Each such line
denotes a branching: the kitten can rea... | 28,485 |
Kiwi Trees
Description:
You are about to plant a pair of fine kiwi trees inside your
big property. You are worried that tree branches would grow
beyond the boundaries of your property, making your neighbours
complain. You must also avoid planting the two trees too close
to each other so that the branch... | 28,486 |
Kjördæmi Königsbergs
Description:
Königsberg, now known as Kaliningrad, is a city well known
for its bridges. Now bridges are to be built between the
districts of the city to ensure travels around the city are
possible. Each bridge connects two districts of the city.
Building the bridges can be expensive ... | 28,487 |
Kleptocrat
Description:
Your company has a policy that every employee should be
refunded an amount of money proportional to the shortest
distance between their home and office. This causes the
loophole that many employees intentionally move very far away
to claim the maximum possible reimbursement.
On... | 28,488 |
Kleptography
Description:
John likes simple ciphers. He had been using the “Caesar”
cipher to encrypt his diary until recently, when he learned a
hard lesson about its strength by catching his sister Mary
browsing through the diary without any problems.
Rapidly searching for an alternative, John found a s... | 28,489 |
Kletva
Description:
As punishment for destroying half of his city with his
monster truck, Mirko now has to pay off his dept to society. He
works as an assistant for a famous archaeologist. One of his
duties include crafting keys for ancient document boxes.
In ancient times document boxes were locked using... | 28,490 |
Klompendans
Description:
In traditional Dutch clog dancing, you as the dancer need to
follow a very specific sequence of movements. The dance takes
place on a square grid of square tiles, and at the start of the
dance you stand on the top left corner tile of the grid. You
then alternate between two typ... | 28,491 |
Klósettröð
Description:
## Input
The input consists of two lines. The first line contains a
single integer $1 \le n \le 1\,
000$. The second line contains $n$ integers $1 \le a_i \le n$. It will hold for
all $i \neq j$ that
$a_i \neq a_j$. Worded
differently, the values are unique.
## Output
Pri... | 28,492 |
Knapsack
Description:
Implement a solution to the classic knapsack problem. You
are given a knapsack that can hold up to a certain weight (its
capacity), and several items you may choose to put in the
knapsack. Each item has a weight and a value. Choose a subset
of the items (which could be all of them... | 28,493 |
Knapsack 101
Description:
Everyone knows that the knapsack problem is NP-hard. That
is, everyone except for you! You are not convinced;
after all, you know that P = NP!
Your friend, determined you are wrong, challenges you to
solve the following variant of the knapsack problem.
There are $2n$ items,
... | 28,494 |
Knapsack Collection
Description:
The baggage carousel consists of $s$ luggage slots, numbered in
ascending order from $0$
to $s-1$. Since the
baggage carousel is cyclic, luggage slots $s-1$ and $0$ also lie side by side. The
carousel turns in such a way that if Gerald stands in front of
slot $i$ at... | 28,495 |
Knapsack Packing
Description:
One of the most difficult things about going on a holiday is
making sure your luggage does not exceed the maximum weight.
You, chairman of the Backpacker’s Association for Packing
Carry-ons, are faced with exactly this problem. You are going
on a lovely holiday with one of... | 28,496 |
Knight Fly
Description:
You are given a $2\, 000\,
000\, 000$ by $2\, 000\,
000\, 000$ chessboard. The bottom-left most cell has
coordinates ($1$,
$1$). The board is full of
blocked cells, and no chess piece may be placed on those cells.
Because there are so many blocked cells on the chessboard... | 28,497 |
Knight Jump
Description:
You are given a two dimensional chess board of size
$N \times N$ ($1$-based indexing). Some of the cells
on this board are ‘.’ denoting an empty
cell. Some of the cells on this board are ‘#’ denoting a blocked cell, which you are not
allowed to visit. Exactly one of the cells o... | 28,498 |
Knight Packing
Description:
On a $N \times N$ chess
board, two players alternate placing a knight on the board. A
knight can only be placed if there is no other knight which
would be either $1$ row
and $2$ columns or
$2$ rows and $1$ column away from it. The first
player who cannot place a knig... | 28,499 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.