id
stringlengths
10
13
content
stringlengths
424
1.17M
app_data_2800
Alice and Bob created a new game while at the beach this summer. All they need is a set of numbered playing cards. They start by creating $P$ piles with all cards face-up and select a non-negative number $K$. After that, they take turns like this: - A player starts by selecting one of the piles. - Then, he removes fr...
app_data_2801
Margriet A. is in pizza heaven! She has bought a one-day access pass to Pizza World. Pizza World is a food festival, where all stands have their own special type of pizza. Margriet would really like to try many different types of pizza, but she thinks that she can only eat two pizzas in total. Therefore, she has come u...
app_data_2802
Your friend Claire has dragged you along to a speedcubing event that is happening in Eindhoven. These events are all about solving the Rubik’s cube and similar twisty puzzles as quickly as possible. The attendants of the event can enter into various competitions based on the type and size of the puzzle, and there are e...
app_data_2803
You are playing a game in which a group of players take turns saying animal names. The animal name you say when it is your turn must start with the same letter as the previously said animal ends with and it must not have been said previously in this round of the game. If there is no valid name or you cannot come up wit...
app_data_2804
The impending doom called final examination is approaching this year’s high school seniors: one of the compulsory tasks is going to be writing an essay in their mother tongue. Mirko is under the impression that certain political parties are going to keep their promises, those regarding informatization and digitalizatio...
app_data_2805
Little Frane is already in tenth grade, but is still struggling with Pascal in computer class. For homework, his teacher wrote the following program into his notebook, and he needs to determine the output, given the integer $N$. readln(N); counter := 0; for i := N - 1 downto 1 do begin counter := counter + 1; if N...
app_data_2806
The mole family recently decided to dig a new tunnel network. The layout, which has already been decided, consists of chambers and bidirectional tunnels connecting them, forming a connected graph. Mother mole wants to use the opportunity to teach her two mole kids how to dig a tunnel network. As an initial quick demo...
app_data_2807
Ms. Thomas is managing her class of $n$ students. She placed all her students in a line, and gave the $i$-th student from the left a card with the letter $a_ i$ written on it. She would now like to rearrange the students so that the $i$-th student from the left has a card with the letter $b_ i$ written on it. To do ...
app_data_2808
Peter is in charge of food service on a passenger train. The train has $n$ cars ordered sequentially starting from the locomotive. The $i$-th car has $p_ i$ passengers. There are $m$ food carts Peter may put into service. Each food cart serves a unique type of food. The $j$-th food cart can move between the $l_ j$-th c...
app_data_2809
Consider a very large number $R$ in a compressed format. It is compressed as a binary string $s$, and an integer $k$. Start with the empty string, and append $s$ to it $k$ times to get the binary representation of $R$. The string $s$ is guaranteed to have a leading $1$. Now, with $R$, solve the following problem: How m...
app_data_2810
Luke likes to ride on public transit in different cities he visits, just for fun. He tries to find unique ways to travel in loops: leaving from one transit station, traveling along the transit connections to at least one other station, and returning to the station where he started. He is finding lots of loops, and he w...
app_data_2811
You are given a rooted tree with $n$ nodes. The nodes are numbered $1..n$. The root is node $1$, and $m$ of the nodes are colored red, the rest are black. You would like to choose a subset of nodes such that there is no node in your subset which is an ancestor of any other node in your subset. For example, if A is the...
app_data_2812
When ninjas go to conferences they wear fake nametags. One ninja in particular wants to impress his Sensei. His Sensei chooses a new favorite number every day. The pupil wants to put a name on his nametag that encodes his Sensei’s favorite number! This name will consist of only lower case letters. He assigns a value to...
app_data_2813
A haiku is a Japanese form of poetry. It consists of three phrases of $5$, $7$ and $5$ syllables each. Once a year, HiQ has a haiku contest, where employees submit their best poems. The poems are then judged based on a wide range of aspects, such as - creativity - simplicity - beauty - whether the poem is actually...
app_data_2814
Concentration is a not so popular 2 player card game of both skill and luck. The standard Concentration game is played with one or two 52-card decks, however, for the sake of the problem, we will look at a variation of Concentration. The rules are as follows: - A card is represented by a single integer. Two cards $i$...
app_data_2815
Theta has been learning about powers of $2$ in school. She notices that some numbers when written out contain powers of $2$ in their digit representation: for instance, $12560$ contains $256$ which is a power of $2$. She has been wondering how many such numbers there are. Can you write a program that counts how many n...
app_data_2816
Vjekoslav the Wolf is running away from a bunch of blood hungry hunters. The hunters are smart and hide behind trees. Vjekoslav knows this, but doesn’t know which trees. He would like to run to his comfortable, civilized cottage (as opposed to the hunters quite uncivilized den, yes I am rooting for the Wolf here) stayi...
app_data_2817
In competitive weightlifting, you must perform a sequence of lifts. You have a constant strength $s$, and a decreasing energy reserve $e$. For each lift, you may choose any positive (not necessarily integer) weight $w$ to attempt. If $s \ge w$, the lift succeeds and your energy goes down by $e_{\text {success}}$; if $s...
app_data_2818
There are $N$ balloons floating in the air in a large room, lined up from left to right. Young Perica likes to play with arrows and practice his hunting abilities. He shoots an arrow from the left to the right side of the room from an arbitrary height he chooses. The arrow moves from left to right, at a chosen height $...
app_data_2819
The boardgame Chaos is an exotic variant of Chess, played by two players in alternating turns on an $n\times n$ playing board. All pieces have the same set of $n$ valid moves which are agreed on ahead of the game. In a single turn a player can pick exactly one of their pieces and perform one of the following actions:...
app_data_2820
Jack, naïve fellow that he is, has fallen into the clutches of a dastardly and sophisticated multi-level marketing scheme. It all started when a mysterious stranger pushed upon young Jack a bag of ordinary beans, promising that if only he could amass the right quantities of each kind of bean, he could grow a mighty be...
app_data_2821
Everybody is into cloud computing these days, so quite a few different business models are being experimented with. You are trying a very simple one: you sell time on your machines in one of two batches called slots. A customer can buy one second of CPU time or $Q$ seconds for some integer $Q$. Each time slot a custom...
app_data_2822
You are playing hide-and-go-seek in a forest with Belle. The forest has one tree at each of the positive integer lattice points. That is, there is a tree at every point $(x,y)$ where $x$ and $y$ are both positive integers. You may consider each tree as a point. A logging company has cut down all of the trees in some ax...
app_data_2823
A multinational company is asking you to help them genetically modify an apple. In order for the apples to grow faster, to get more of them, to make them bigger and make them look nicer and more symmetrical, the apple’s DNA requires an insertion of a certain swine gene. The apple’s DNA is represented by a series of ch...
app_data_2824
To save money, Santa Claus has started hiring other animals besides reindeer to pull his sleigh via short term ‘gig’ contracts. As a result, the actual animals that show up to pull his sleigh for any given trip can vary greatly in size. Last week he had $2$ buffalo, $37$ voles and a schnauzer. Unfortunately, both buff...
app_data_2825
A group of friends snuck away from their school campus, but now they must return from the main campus gate to their dorm while remaining undetected by the many teachers who patrol the campus. Fortunately, they have an invisibility cloak, but it is only large enough to cover two people at a time. They will take turns as...
app_data_2826
In geometry, ellipses are defined by two focal points $f_1, f_2$ and a length $D$. The ellipse consists of all points $p$ such that $\mathop {\mathrm{distance}}(f_1, p) + \mathop {\mathrm{distance}}(f_2, p) = D$. When one normally thinks of ellipses, it is in the context of the Euclidean 2D plane, with the Euclidean d...
app_data_2827
You are part of an elite hacking group who has just invented a new type of malware, called the hoppers. Hoppers can operate in any high-security computer networks; however, they can only propagate themselves in a very limited way. A computer network is a set of hosts $V$ ($|V| = N$) and direct links $E$ ($|E| = M$). E...
app_data_2828
Mirko has an array of $N$ different words that he wants to encrypt using a substitution cypher. We encrypt the text using a substitution cypher by first choosing a key – a permutation of the English alphabet. Then we replace all occurrences of letter ‘a’ with the first letter of the key, all occurrences of letter ‘b’ ...
app_data_2829
Morse Code is an assignment of sequences of dots and dashes to alphabet characters. You are to create a Morse-like code that yields the shortest total length to a given message, and return that total length. A dot symbol has length $1$. A dash symbol has length $3$. The gap between symbols within a character encoding ...
app_data_2830
You are on an $n \times m$ grid where each square on the grid has a digit on it. From a given square that has digit $k$ on it, a Move consists of jumping exactly $k$ squares in one of the four cardinal directions. A move cannot go beyond the edges of the grid; it does not wrap. What is the minimum number of moves requi...
app_data_2831
You have located a major supply line that the enemy has been using. With satellite imaging, you’ve been able to determine the current location and velocity of every vehicle along the supply line, which is for all practical purposes an infinitely long straight line. Furthermore, you know that each vehicle moves at const...
app_data_2832
Pixels in a digital picture can be represented with three integers in the range $0$ to $255$ that indicate the intensity of the red, green, and blue colors. To compress an image or to create an artistic effect, many photo-editing tools include a “posterize” operation which works as follows. Each color channel is examin...
app_data_2833
Damir likes to rotate. Right now he is rotating tables of letters. He wrote an $R\times C$ table onto a piece of paper. He has also chosen an angle $K$, a multiple of $45$, and wants to rotate his table that many degrees clockwise. It turns out this task is a bit too hard for Damir, so help him out. -----Input----- T...
app_data_2834
Digits $4$ and $7$ are lucky, while all others are unlucky. An integer is lucky if it contains only lucky digits in decimal notation. We would like to know the $K$-th lucky positive integer. -----Input----- The first and only line of input contains a positive integer $K$ ($1 \le K \le 10^9$). -----Output----- The fir...
app_data_2835
You are given two strings $s$, and $t$. Count the number of substrings of $s$ that contain $t$ as a subsequence at least once. Note that a $substring$ and a $subsequence$ both consist of characters from the original string, in order. In a $substring$, the characters must be contiguous in the original string, but in a ...
app_data_2836
Brojko and Brojana are happily married with $N$ little boys. The boys are named with distinct even integers $P_1, P_2, \ldots , P_ N$. Brojko and Brojana are expecting an addition to their family and have to come up with a nice name for the little girl. They have decided that the name will be an odd integer in the ran...
app_data_2837
Mirko has been a very good boy, so he got exactly what he wanted for his birthday, a “Young physicist” kit! In the kit, there are $N$ types of resistors, connecting wires and an ohmmeter. If a resistor is of type $i$, it provides a resistance of precisely $R_ i$ ohms. As we all know, resistors can be connected in two ...
app_data_2838
Mirko was bored at his chemistry class, so he played Bomb Switcher on his cell phone. Unfortunately, he was spotted and was given a ridiculously heavy assignment for homework. For a given valid math expression with brackets, he must find all different expressions that can be obtained by removing valid pairs of brackets...
app_data_2839
VisuAlgo (http://visualgo.net) is a website developed by a team of staff and students of School of Computing, National University of Singapore, the host of the 2015 ACM-ICPC Asia Singapore Regional. VisuAlgo visualizes a number of popular data structures and algorithms in the Computer Science curriculum. Currently, it ...
app_data_2840
When dealt cards in the card game Plump it is a good idea to start by sorting the cards in hand by suit and rank. The different suits should be grouped and the ranks should be sorted within each suit. But the order of the suits does not matter and within each suit, the cards may be sorted in either ascending or descend...
app_data_2841
Yancy is designing a new board game called Colorland. The rules of Colorland are as follows: - Colorland’s board is a linear sequence of $N+1$ squares. The first square is a special start square, the remaining $N$ squares are colored blue, orange, pink, green, red, or yellow. - The goal of Colorland is to move your g...
app_data_2842
Battleship is a game played by two players. Each player has their own grid, which is hidden from their opponent. Each player secretly places some ships on their grid. Each ship covers a horizontal or vertical straight line of one or more contiguous squares. Ships cannot overlap. All ships are considered distinct, even ...
app_data_2843
You are given $W$, a set of $N$ words that are anagrams of each other. There are no duplicate letters in any word. A set of words $S \subseteq W$ is called “swap-free” if there is no way to turn a word $x \in S$ into another word $y \in S$ by swapping only a single pair of (not necessarily adjacent) letters in $x$. Fin...
app_data_2844
The evil emperor Cactus has in his possession the Magic Keg and has flooded the Enchanted Forest! The Painter and the three little hedgehogs now have to return to the Beaver’s den where they will be safe from the water as quickly as possible! The map of the Enchanted Forest consists of R rows and C columns. Empty fiel...
app_data_2845
Alice is a queen bee living in Beeland (a honeycomb structure described by $R$, the number of cells of the side of honeycomb). The cells in Beeland are numbered from $1$ to $R^3 - (R-1)^3$ in row major order. For example for $R = 3$, the Beeland that Alice lives in looks like this: Now Alice lives in a house that occu...
app_data_2846
In research, it is tough to determine how good of a researcher you are. One way that people determine how good you are is by looking at your $H$-Index. Each paper has a certain number of citations. Your $H$-Index is the largest number $H$ such that you have $H$ papers with at least $H$ citations. Given the number of c...
app_data_2847
Every day after school, you and your friends get together and play in a band. Over the past couple of months, the band has been rehearsing a large number of songs. Now it’s time to go out and perform in front of a crowd for the first time. In order to do so, a set list for the concert needs to be determined. As it tur...
app_data_2848
There is a heavy rainfall over the Antique Cultural Museum, and the roof has sprung a leak! All the beautiful paintings risk destruction, if it weren’t for one brave night watchman standing in the water’s way – Klunkas Plaskocek. To protect all of the paintings, Klunkas has brought $N$ buckets and placed them in a lon...
app_data_2849
Most of us like playing video games. Benni prefers to play the video game Digbuild. Digbuild is primarily about surviving for as long as possible. In the game almost everything is possible. You can climb mountains, build castles, and fish, just to name a few options. The gameworld consists of large cubes, all the same ...
app_data_2850
Brandon Greg Jr. is moving to the United States to double his salary. He has $n$ items that he needs to pack into $k$ big boxes. The $n$ items are currently arranged in a row, and Brandon doesn’t want to bother reordering them, so he will partition the $n$ items into $k$ groups of consecutive items, and put each of the...
app_data_2851
Mirko has received a homework assignment to compute the greatest common divisor of the two positive integers $A$ and $B$. Since the numbers are quite large, the teacher provided him with $N$ smaller integers whose product is $A$, and $M$ integers with product $B$. Mirko would like to verify his result, so he has asked...
app_data_2852
Angela is a new PhD student and she is nervous about the upcoming paper submission deadline of this year’s research conference. She has been working on multiple projects throughout the past year. Luckily most of the projects concluded successfully, and she came up with $n$ candidate papers. However not all of the paper...
app_data_2853
A new town is being built far out in the country, and currently there are $N$ houses. People have already started moving in. However, some of the houses aren’t connected to the internet yet, and naturally residents are outraged. The houses are numbered $1$ to $N$. House number $1$ has already been connected to the int...
app_data_2854
A molecule consists of atoms that are held together by chemical bonds. Each bond links two atoms together. Each atom may be linked to multiple other atoms, each with a separate chemical bond. All atoms in a molecule are connected to each other via chemical bonds, directly or indirectly. The chemical properties of a mo...
app_data_2855
Your friend has gotten lost in the woods. He has called and asked for you to come get him, but you are very busy and would rather just stay home. You quickly look up a map of the woods. It appears that the woods consist of a small number of clearings, with paths connecting them. You hope that the woods are sufficiently...
app_data_2856
Biologists have discovered a strange DNA molecule, best described as a sequence of $N$ characters from the set $\{ A, B\} $. An unlikely sequence of mutations has resulted in a DNA strand consisting only of $A$’s. Biologists found that very odd, so they began studying the mutations in greater detail. They discovered t...
app_data_2857
$N$ points are placed in the coordinate plane. Write a program that calculates how many ways we can choose three points so that they form a right triangle with legs parallel to the coordinate axes. A right triangle has one 90-degree internal angle. The legs of a right triangle are its two shorter sides. -----Input--...
app_data_2858
Mafia is a social game played frequently by high school competitors in informatics on summer and winter camps and national competitions, usually very late at night, drinking various fruit sodas. This game is not about winning, it’s about los taking part, like in competitions. To solve this task, you don’t need to know...
app_data_2859
Particle colliders are difficult to build and experiments are costly to run. Before running any real experiments it is better to do a simulation to test out the ideas first. You are required to write a very simple simulator for this problem. There are only three particles in this system, and all particles are confined...
app_data_2860
You are a stone-chiseler in Ancient Greece, charged with copying the text from famous monuments onto new stones. The existing inscriptions use boustrophedon writing, in which the lines of text alternate direction, and if a line ends in the middle of a word, the word simply continues on the next line. For example, an in...
app_data_2861
The Production Manager of a dance company has been tasked with determining the cost for the seasonal dance recital. Because of their exceptional skills, many dancers will perform in more than one routine, but this presents a problem; each dance routine incorporates a unique costume, so between routines, dancers must re...
app_data_2862
The hit new RPG mobile game Curveknights was recently released and Yraglac has been absolutely obsessed with it. Yraglac has been trying to farm materials for hours on end so he can promote his units but has suddenly realized that he has forgotten about an integral system that might speed this up: the crafting system! ...
app_data_2863
Emma and Marcos are two friends who love horror films. This year, and possibly the years hereafter, they want to watch as many films together as possible. Unfortunately, they do not exactly have the same taste in films. So, inevitably, every now and then either Emma or Marcos has to watch a film she or he dislikes. Whe...
app_data_2864
Developed in the 1940s in the United Kingdom, the game of Cluedo is one of the most popular board games in the world. The object of the game is to determine who murdered Mr. Body, which weapon was used to murder him, and where the murder took place. The game uses a set of cards representing six persons (labeled A, B, …...
app_data_2865
It’s the slow crawl of rush hour. At any point of time, each vehicle is either stopped or is moving at the extremely slow speed of $1$ meter per second. Lately, vehicles come equipped with a simple “black box” that record all changes in a vehicle’s speed. In this problem, speeds change instantaneously. The road is mo...
app_data_2866
The technology behind the fridge has changed little over the years. Even so, many of the original owners of the Fred W. Wolf domestic refrigerator of 1913 would be amazed by the size and features of the modern appliances. However, since the 1960s one thing has been common for all fridge owners around the world: fridge ...
app_data_2867
Years have passed since Bash dropped out of university to become a Pokenom trainer. The adventure was full of difficulties and hardship, but Bash overcame all obstacles and became the best Pokenom trainer, like no one ever was! Today Bash is celebrating his $13$th anniversary of dropping out of university and becoming...
app_data_2868
Little Marin spent all his day generating test data for COCI. He simply couldn’t make it work, so he had a nervous breakdown and can’t even see clearly anymore. Every time he blinks while reading, the letters in a word get mixed up so that the letters from the second half of the word (the shorter half, if the length is...
app_data_2869
Using roman numerals the numbers $1, 2, 3, 4, 5, 6, 7, 8, 9$ are written as ‘I’, ‘II’, ‘III’, ‘IV’, ‘V’, ‘VI’, ‘VII’, ‘VIII’, ‘IX’. The numbers $10, 20, 30, 40, 50, 60, 70, 80, 90$ are written as ‘X’, ‘XX’, ‘XXX’, ‘XL’, ‘L’, ‘LX’, ‘LXX’, ‘LXXX’, ‘XC’. Any number smaller than $100$ can be written by converting tens and ...
app_data_2870
Your family has been blessed with chocolate! A huge piece of chocolate has been given to you and your sister to share. However, as you gobbled up the large majority last time, your parents have invented a game to keep things fair (and to keep you occupied while they hide all the other chocolate). To keep things interes...
app_data_2871
The annual student team competition in table tennis of students enrolled in University of Zagreb takes place next Saturday! Each team consists of $K$ students. The excited students, $N$ of them, are waiting in queue to register. Krešo works at the registration desk. He doesn’t really feel like doing his job so he deci...
app_data_2872
Friday is the highlight of Børge and Åse’s life. They can meet up with their buddies in the ITU Friday bar and discuss anything they want: the weather, sports, favourite editors, politics, religion, and gossip about celebrities. Life can be good. Unfortunately, they don’t know which day of the week it is! They’ve woke...
app_data_2873
Lea runs into a lot of words in her life. A lot of them she finds unpleasant. To compensate for that she started making up pleasant words. Lea makes up new words by writing a nice looking string of characters on a piece of paper. She than erases a few of the most nasty looking characters and replaces them with undersco...
app_data_2874
It’s Christmas time and JW’s $1$-dimensional shop is selling Christmas trees. However, the demand for trees is much higher than the number of trees available. Hence, JW has come up with a special strategy to help decide who gets what tree: a game of Musical Trees! Musical Trees is much like the game Musical Chairs. Th...
app_data_2875
As a huge fan of the popular collectible card game Numinous Wilds: the Elven Reign Chronicles (NWERC), you have a large collection of cards which you carefully organise by their rarity. One day you notice that someone has touched your collection, and that some of the cards are now out of order. The most natural suspect...
app_data_2876
Today you are doing your calculus homework, and you are tasked with finding a Lipschitz constant for a function f(x), which is defined for $N$ integer numbers $x$ and produces real values. Formally, the Lipschitz constant for a function f is the smallest real number $L$ such that for any $x$ and $y$ with f(x) and f(y) ...
app_data_2877
Mario is making up silly games again instead of reading Dostoevsky for school. The rules of his newest game follow. First he chooses a random word from the book. Then he splits the word in two arbitrary places to get three separate words. After that he reverses the order of the letters in each of those three words (exc...
app_data_2878
Mirko and Slavko are playing a new game, “Trojke” (Triplets, in English). First they use a chalk to draw an $N \times N$ square grid on the road. Then they write letters into some of the squares. No letter is written more than once in the grid. The game consists of trying to find three letters on a line as fast as pos...
app_data_2879
A polyomino is a polyform with the square as its base form. It is a connected shape formed as the union of one or more identical squares in distinct locations on the plane, taken from the regular square tiling, such that every square can be connected to every other square through a sequence of shared edges (i.e., shape...
app_data_2880
In this economy, we all know how hard it is to get a job. Mirko, a recent college graduate, however, got lucky – he is now employed as a runeologist by the Language Institute of Croatia. His friend Slavko believes runeology isn’t a science and is hence angry at Mirko for believing the opposite. One foggy Christmas day,...
app_data_2881
Match sticks can be used to form digital numbers. The arrangement of matches that forms each digit between ‘0’ and ‘9’ is illustrated in the figure. You are given two sequences of digits $X$ and $Y$. There are matches that have been arranged to form the digits in $X$. Can you move exactly one match from them, so that ...
app_data_2882
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set is: [ "((()))", "(()())", "(())()", "()(())", "()()()" ] class Solution: def generateParenthesis(self, n): """ :type n: int :rt...
app_data_2883
Given a collection of intervals, merge all overlapping intervals. Example 1: Input: [[1,3],[2,6],[8,10],[15,18]] Output: [[1,6],[8,10],[15,18]] Explanation: Since intervals [1,3] and [2,6] overlaps, merge them into [1,6]. Example 2: Input: [[1,4],[4,5]] Output: [[1,5]] Explanation: Intervals [1,4] and [4,5] are ...
app_data_2884
Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate numbers sums to target. Each number in candidates may only be used once in the combination. Note: All numbers (including target) will be positive integers. ...
app_data_2885
Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary). You may assume that the intervals were initially sorted according to their start times. Example 1: Input: intervals = [[1,3],[6,9]], newInterval = [2,5] Output: [[1,5],[6,9]] Example 2: Input: intervals = [[...
app_data_2886
Given a string t, we will call it unbalanced if and only if the length of t is at least 2, and more than half of the letters in t are the same. For example, both voodoo and melee are unbalanced, while neither noon nor a is. You are given a string s consisting of lowercase letters. Determine if there exists a (contiguou...
app_data_2887
Ash like soup very much! So, on the Raksha Bandhan day, his sister gave him a soup maker as a gift. Soup maker in the ith hour will make volume Vi liters of soup and pours it in a bowl. Each hour, the Volume of soup in every bowl is reduced due to evaporation. More precisely, when the temperature on a given hour is Ti...
app_data_2888
-----INOI 2017, Problem 2, Training----- Ash and his Pokemon Pikachu are going on a journey. Ash has planned his route for the journey so that it passes through N cities, numbered 1, 2, …, N, and in this order. When they set out, Pikachu has an initial strength of Sin as well as an experience value (XV) of 0. As they...
app_data_2889
You have just bought a new house, and it has a huge, beautiful lawn. A lawn that needs cutting. Several times. Every week. The whole summer. After pushing the lawnmower around the lawn during the hottest Saturday afternoon in history, you decided that there must be a better way. And then you saw the ads for the new r...
app_data_2890
The city of Xentopia has a well-connected railway network. The city has $N$ junctions numbered from $1$ to $N$. There are $M$ pairs of railway tracks that exist between the junctions. Trains can travel in both directions on each track. Each railway track is labelled either red, blue, or white in colour. Tima, a touris...
app_data_2891
The Birthday Paradox is the name given to the surprising fact that if there are just $23$ people in a group, there is a greater than $50\% $ chance that a pair of them share the same birthday. The underlying assumptions for this are that all birthdays are equally likely (which isn’t quite true), the year has exactly $3...
app_data_2892
Matryoshkas are sets of traditional Russian wooden dolls of decreasing size placed one inside the other. A matryoshka doll can be opened to reveal a smaller figure of the same sort inside, which has, in turn, another figure inside, and so on.The Russian Matryoshka Museum recently exhibited a collection of similarly des...
app_data_2893
In this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of $n$ distinct integers by swapping two adjacent sequence elements until the sequence is sorted in ascending order. For the input sequence 9 1 0 5 4 , Ultra-QuickSort produces the output 0 1 4 5 9 . Your task is...
app_data_2894
Rainfall is measured in millimeters. The rain is collected in a vertical transparent tube with millimeter markings, and once the rain has stopped falling, one can check the height of the water in the tube. In our problem, the tube unfortunately has a leak at height $L$ millimeters (mm). If the water level is above the...
app_data_2895
An ironman triathlon is a race where participants swim for $3.86$ km, ride a bicycle for $180.25$ km, and finally run a marathon, and it is considered one of the toughest sport events. Viveka has been training for an even more challenging competition: the $n$-athlon. In an $n$-athlon race, participants have to go from ...
app_data_2896
Some viruses replicate by replacing a piece of DNA in a living cell with a piece of DNA that the virus carries with it. This makes the cell start to produce viruses identical to the original one that infected the cell. A group of biologists is interested in knowing how much DNA a certain virus inserts into the host gen...
app_data_2897
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 being in decimal and give him a $10011100010000$ oun...
app_data_2898
You administer a large cluster of computers with hard drives that use various file system types to store data. You recently decided to unify the file systems to the same type. That is quite a challenge since all the drives are currently in use, all of them are filled with important data to the limits of their capacitie...
app_data_2899
As a new employee at the Northwestern Europe Routing Company (NWERC), you do a lot of thinking about wireless network architectures. Lately you learned about a multi-channel mesh network architecture (called Hyacinth) that equips each mesh network node with multiple network interface cards (NICs) to increase the networ...