task
stringlengths
0
154k
__index_level_0__
int64
0
39.2k
Identifying Map Tiles Description: Map websites such as Bing Maps and Google Maps often store their maps as many different image files, called tiles. The lowest zoom level (level $0$) consists of a single tile with a low-detail image of the whole map, zoom level $1$ consists of four tiles each containi...
28,200
Ignore the Garbage Description: Fred works as an IT consultant in an insurance company. As they always had a large amount of customers waiting and arguing at the front desk, management decided to deploy a ticket machine. Each customer would get a ticket with a number and there will be fancy LCD display...
28,201
Igra Description: Having solved a tedious assignment, Mirko decided to play a game with his good friend Slavko. They have written a sequence of $N$ letters on a piece of paper. Each one of them is trying to put together a word using letters from the sequence. They alternate taking turns consisting of ...
28,202
Iks Description: Mirko’s great grandmother Katica is an avid mathematician. She likes to torment Mirko with math games. This time she wrote down a sequence of numbers on a piece of paper and told Mirko he may do the following: * Choose any two numbers in the sequence (let’s call them $A$ and $B$) ...
28,203
Illiteracy Description: Illiteracy is a simple puzzle game created by Le Sio. 1 The game consists of a sequence of eight icons; the actual icons are very artistic, but for simplicity, we’ll label the icons using a capital letter A—F. Clicking any icon has a unique effect on the other icons, based ...
28,204
Illuminated City Description: To make the city more pleasant, the municipality of Lund has decided to install light strips over the streets. The municipality prefers to have lighting in as many places as possible. There are many locations where light strips could be installed, and since the city counci...
28,205
Illuminati Spotti Description: One of Xxayvier’s favorite pastimes is spotting triangles due to his obsession with the Illuminati. Xxayvier has taken it to the extreme and has been trying to spot triangles on the larger scale. He believes that the Illuminati has control of all cities which have $3$ un...
28,206
Illumination Description: Consider a square grid with lamps in fixed locations. Each lamp can either illuminate its row or its column, but not both. The illumination of each lamp extends over a limited distance. Any square in the grid should only be illuminated by at most one lamp in its row and by at...
28,207
Image Compression Description: Saskia wants to reduce the bandwidth usage of her website, and has investigated how she can compress her PNG images. She got a bit curious on how PNG image optimizers work, and before she knew it, she started working on her own! In PNG, an image is considered a grid of $Y$ r...
28,208
Image Decoding Description: You have been placed in charge of your company’s archive of digital data, and your first job is to convert a lot of old pictures into a newer format. But you have no software to read the old images, so you need to write it. You do have a description of the old image format. The...
28,209
Image Processing Description: Image editing software like Photoshop provide many image effects like blur, sharpen, and edge detection. These effects are commonly implemented through a kernel, a matrix describing a certain image effect. The kernel is applied to an image through convolution: flipping bot...
28,210
Immortal Porpoises Description: As everyone knows, immortal porpoises live on the other side of straight lines and eat live seagulls, although Federal Law prohibits transporting the gulls to them (but that’s another story). The well-known scientist Leo $O$. Pisa studied immortal porpoises at great len...
28,211
Impartial Strings Description: Alice builds machines that generates strings. Alice’s machines each consist of $N$ states, numbered from $1$ to $N$, and a set of directed edges between these states, each labelled with a character from a fixed set. A subset of the states are “final” states. The machine g...
28,212
Imperfect GPS Description: Lots of runners use personal Global Positioning System (GPS) receivers to track how many miles they run. No GPS is perfect, though: it only records its position periodically rather than continuously, so it can miss parts of the true running path. For this problem we’ll consid...
28,213
Imperial Measurement Description: The traditional imperial system has eight units of distance (excluding maritime units and some units used in surveying), related as follows: thou (th) inch (in) 1000 thous foot (ft) 12 inches yard (yd) 3 feet chain (ch) 22 yards furlong (fur) 10 chains mile (mi...
28,214
Implementation Irregularities Description: Impressed by the performance of the top teams at the recent BAPC preliminaries, you started to wonder whether teams were allowed to use one or multiple computers to implement their solutions. Instead of unnecessarily bothering the organization with more quest...
28,215
Import Spaghetti Description: As you sit down and think, you decide that the first thing to do is to eliminate the cycles in the dependency graph. So you start by finding a shortest dependency cycle. ## Input The first line of input contains a number $n$, $1 \le n \le 500$, the number of files. Then foll...
28,216
Impossible Prices Description: Dio’s parents have recently retired to a villa in Greece, leaving him in charge of the family business, a home decor store specializing in ancient pottery (and a proud member of ICPC, the International Consortium of Pottery Companies). Dio enjoys interacting with customer...
28,217
Impressive Integers Description: Recently, Alice and her sister Clara learned about adorable numbers: A positive integer $n$ is called adorable if there exist some integers $a, b,$ and $c$ so that an equilateral triangle with side length $c$ can be tiled with $n$ smaller equilateral triangles, each...
28,218
In Case of an Invasion, Please... Description: After Curiosity discovered not just water on Mars, but also an aggressive, bloodthirsty bunch of aliens, the Louvain-la-Neuve municipal government decided to take precautionary measures; they built shelters in order to shelter everyone in the city in the e...
28,219
In Flagrante Delicto Description: “[There] is a reason why the most successful trial lawyers are often master storytellers, making their cases come to life for their jurors.” ­–G. Christopher Ritter. A good lawyer can take an incomplete set of facts and turn it into a convincing story. Last night, a ...
28,220
InTents Description: A circus is constructing their tent. The tent is a large piece of canvas held up by a given number of various length tent poles. The tent poles go in specific places on the ground, but which tent pole goes in which place is up to you. You need to choose a placement for the given te...
28,221
Incognito Description: ## Input On the first line one positive number: the number of test cases, at most 100. After that per test case: * one line with an integer $n$ ($0\le n \le 30$): the number of available attributes. * $n$ lines with two space-separated strings: the name and the category of...
28,222
Incomplete Sort Description: Merge sort is a sorting algorithm. It works by splitting an array in half, sorting both halves recursively and then merging those halves together to sort the entire array. Your friend is working on an implementation of the merge sort algorithm, but unfortunately he is not q...
28,223
Increasing Subsequence Description: A strictly increasing sequence is a sequence of numbers $a_1, a_2, \ldots , a_ n$ such that, for $1 < i \le n$, $a_{i-1} < a_ i$. A subsequence of $a_1, a_2, \ldots , a_ n$ is identified by a strictly increasing sequence of indices, $x_1, x_2, \ldots , x_ m$ ...
28,224
Incredible Bartender Description: Lars is a bartender in Scrollbar, but he is no regular bartender. He knows incredible recipes where he can mix a little bit of this, and a little bit of that, and suddenly, he magically has a new drink. This process can even increase or decrease the total amount of li...
28,225
Incremental Double Free Strings Description: A string is called double free if no two adjacent letters are the same. A string is called $k$-incremental if for all values of $j$ in the range $[1,k]$, there exists exactly one character with $j$ occurrences, and the string’s length is $1+2+3+\ldots ...
28,226
Incremental Induction Description: According to the ancient customs, contestants who have not been inducted into the Hall of Fame yet (the pathetic nobodies) must stay on the left side of the stage, whereas contestants who have been inducted (the awesome legends) must be on the right side of the stage....
28,227
Indistinguishable Sequences Description: SoCCat defines a map $L: \bigcup _{i\in \mathbb N} \mathbb Z^ i \to \mathbb N$ which takes in a sequence $\mathbf s = (s_1, s_2, \ldots , s_ k)$ of integers and outputs the length of a longest (strictly) increasing subsequence of $\mathbf s$. Two sequences $\ma...
28,228
Indoorienteering Description: Lukáš really likes orienteering, a sport that requires locating control points in rough terrain. To entertain the NWERC participants Lukáš wants to organize an orienteering race. However, it would be too harsh for the participants to be outdoors in this cold Swedish Novemb...
28,229
Infection Estimation Description: While it will take some time until tests get into mass production, one of the research labs is able to perform up to $50$ tests per day. To improve test efficiency, the researchers have decided to combine tests from multiple people. Each test takes in tissue sample...
28,230
Infiltration Description: Rookie Pirate Captain Jack Albatross has secretly laid anchor in a hidden bay not far from Port Wine, the local meeting point for grizzled pirates and denizens of the sea. Disguising as a messenger, you have infiltrated the service of the dreaded legendary Captain Stevie, and ...
28,231
Infiltration Description: Good morning, agent W-12. Your mission, should you choose to accept it, is as follows. We are infiltrating the ever so insidious Association of Chaos and Mischief (ACM) in order to take down their command structure. Unfortunately, they appear to be prepared for such an eventu...
28,232
Infinite 2D Array Description: We define an infinite two dimensional array $F$ using the following formula: * $F_{0, 0} = 0$, * $F_{0, 1} = F_{1, 0} = 1$, * For $i \ge 2$, $F_{i, 0} = F_{i-1, 0} + F_{i-2, 0}$, * For $i \ge 2$, $F_{0, i} = F_{0, i-1} + F_{0, i-2}$, * For $i,...
28,233
Infinite Cash Description: Svalur Handsome has finally graduated with a degree in computer science, and it couldn’t have happened sooner. He has some rather unwise spending habits which he hopes will be more sustainable now that he can get a high paying job as a programmer. He has applied to a few plac...
28,234
Infinite Race Description: Every year, there is a marathon in Eindhoven. This year, the organizers have come up with something special, and instead of being over after 42 kilometres, the race goes on forever! To keep the organization simple, the race takes place on a running track at Eindhoven universi...
28,235
Infinite Slides Description: Agneta and Beata are visiting the famous Swedish Amusement Park of Infinite Fun and Games. Their favourite attraction is the Infinitely Long Slides. Each slide can be viewed as an infinitely long, completely vertical spiral of radius $1$. When projected into the (flat) gro...
28,236
Infinitely Long Game Description: Alice and Bob will play in a directed graph $H$. The $i$-th vertex in $H$ initially has a value $Y_ i$. The game will proceed as follows. If $H$ contains a cycle, then the game is a tie. Otherwise, Alice and Bob will take turns to choose a vertex in $H$ t...
28,237
Inflation Description: To avoid inflating the balloons by hand, the organisers also bought $n$ helium gas canisters. Each canister can only be used to inflate one balloon, and must be emptied completely into that balloon (it is not possible to disconnect a canister from a balloon before the caniste...
28,238
Inflation Description: People in southern Sweden are known to eat falafel a lot. The price of falafel is highly volatile, and the best way to analyze the state of the economy is to go to the same falafel place every day and add up all the prices on their menu. A falafel place has $N$ different dishes ...
28,239
Influencers Description: You are a manager at an ad agency looking to hire the best new influencers to promote your clients’ products. Since you want to build an effective team, you’re looking for influencers who have positive effects on other influencers when they appear together. Meanwhile, $n$ ...
28,240
Ingredients Description: The chef of a restaurant aspiring for a Michelin star wants to display a selection of her signature dishes for inspectors. For this, she has allocated a maximum budget $B$ for the cumulative cost, and she wants to maximize the cumulative prestige of the dishes that she is showi...
28,241
Inheritance Description: The King of Life, the Universe and Everything is nearing the end of his reign. He has started planning for his eventual demise by getting a bunch of kids, hoping one of them will take over after him. The king has a huge fortune of $P$ suns (the currency of the Universe). He wa...
28,242
Initials Description: When marking computer science assignments, markers like to mark each student in order of how they are listed in class. The way the class is listed is quite strange though, a class is sorted by concatenating the first name to the last name (for example Harry Potter becomes PotterHa...
28,243
Ink Blots Description: Figure 1: 1 White Region Figure 2: 3 White Regions Figure 3: 4 White Regions Drops of dark ink can fall on a white piece of paper creating a number of round ink blots. Three examples are shown above. The blots can create multiple distinct white regions. In the first figure, ...
28,244
Inkay Game Description: $456$ Pokémon in crippling debt are recruited to play the dangerous “Inkay Game.” In one round of the game, there are $N$ Pokémon contestants numbered from $1$ to $N$ trying to cross a bridge of glass platforms of $L$ pairs of side-by-side glass steps. In each pair, one step...
28,245
Innvolsarinnihaldslýsing Description: Ingfríður has grown curious about her internal content description. She heard that various properties of an individual can be deduced from these data, so she has to try it. After getting the data sent over from the company Encode she has everything she needs. To an...
28,246
Input Scandal Description: Inputte is solving their first problems Kattis. Most of the problems Inputte have solved so far has been relatively easy, since the number of input rows is always clearly stated in the problem. One day, Inputte was trying a whole new problem. The problem had an unknown amoun...
28,247
Inquiry I Description: The Bureau for Artificial Problems in Competitions wants you to solve the following problem: Given $n$ positive integers $a_1, \dots , a_ n$, what is the maximal value of ## Input * A single line containing an integer $2\leq n\leq 10^6$. * Then follow $n$ lines, the $i$th of ...
28,248
Inquiry II Description: For an undirected, simple graph $G = (V, E)$ we call a subset $V’ \subseteq V$ an independent set if no two elements of $V’$ are connected by an edge. An independent set of $G$ is called a maximum independent set if there is no independent set in $G$ with strictly more v...
28,249
Insider's Identity Description: In a planet far far away, an intelligence agency plans to send some spies to the Earth to investigate the life there. In order to ensure the secret and secure of this scouting campaign, the agency gives a secret ID to each member. Each ID is a binary string of length $n$. T...
28,250
Inspecting Illumination Description: This is an interactive problem The Zoldyck mansion is enormous, with dozens of rooms and hundreds of illuminating sources — light bulbs, chandeliers, lamps, etc. You are recently hired by the Zoldyck family as a butler. Your daily job involves sitting in the illuminat...
28,251
Inspiration Manifestation Description: Rarity is designing new clothes, and she is looking for some inspiration! Recently, she learned about the importance of symmetry, and is trying to find ways to incorporate this idea into her designs. To learn more about symmetry, she decided to search for inspira...
28,252
Installing Apps Description: Each app that Sandra installs has a download size $d$ and a storage size $s$. To download the app, Sandra’s phone must have at least $d$ megabytes of free disk space. After the app has been installed, it then uses $s$ megabytes of disk space on the phone. The download s...
28,253
Institute of Advanced Category Manipulation Description: A certain magazine annually ranks universities across the country in various categories, as a service for readers who may be deciding which university to attend. Each university is given three scores $R$, $T$, and $S$ (integers from $0$ to $100$)...
28,254
Intact Intervals Description: Gustav is an astronaut on the Nordic Celestial Planetary Craft (NCPC), a large space station in orbit around Mars. Today, one of Gustav’s tasks is to look over the satefy routines on board. The space station consists of $n$ modules arranged in a circle, so that module $i$...
28,255
Integer Division Description: In C++ division with positive integers always rounds down. Because of this, sometimes when two integers are divided by the same divisor they become equal even though they were originally not equal. For example in C++, $\verb|5/4|$ and $\verb|7/4|$ are both equal to 1, ...
28,256
Integer Estate Agent Description: After recent riots in Flatland, the leader has granted permission to purchase real estate at the famous Zero street to everyone. Now, not only the noble polygons are allowed to live there, but pentagons, squares, and even triangles as well (if they can afford a house a...
28,257
Integer Lists Description: The programming language Better And Portable Code (BAPC) is a language for working with lists of integers. The language has two built-in functions: ‘R’ (reverse) and ‘D’ (drop). The function ‘R’ reverses its input list, and ’D’ drops the first element of its input and return...
28,258
Integer Rotation Description: An integer $m$ is a rotated number of some integer $n$ if $m$ can be obtained by moving some digits from the back of $n$ to the front without changing their order. In this case, $(n,m)$ is considered as a rotated pair. For example, $(1234,4123)$ is a rotated pair since ...
28,259
Intellectual Property Description: TDP Inc. has decided to sue JCN Inc. for copyright infringement. To this end, TDP wishes to find infringing segments within JCN’s code base, to show to selected media representatives. Since TDP has fired all its technical staff, it is looking to hire a consultant to b...
28,260
Intelligence Exchange Description: Even though they are still high school students, Carmen and Juni are already top-tier spies. Carmen and Juni live in Byteland, which can be modeled as an undirected connected graph with $n$ vertices and $m$ edges. Today morning at exactly 08:00 am, Carmen goes from her h...
28,261
Intelligence Infection Description: You are a spy for the Benevolent Agent Protection Center (BAPC) and have recently obtained some top secret information. As you are very excited about this discovery, you want to inform your fellow spies of these newfound documents by sending a message to each of them...
28,262
Interactive Tic-Tac-Toe Description: Mårten is extremely good at tic-tac-toe. He’s so good you’ve never managed to beat him. Write a program that plays tic-tac-toe for you, and you might have a chance. If you don’t know the rules of the game, you can read them on Wikipedia. ## Interactivity This pro...
28,263
Intercept Description: Fatima commutes from KTH to home by subway every day. Today Robert decided to surprise Fatima by baking cookies and bringing them to an intermediate station. Fatima does not always take the same route home, because she loves to admire the artwork inside different stations in Stoc...
28,264
Interception Description: The system in question consists of listening devices placed on the tin-can phone lines of the street (the idea being that sooner or later the dog doo malefactors will mess up and discuss their dirty deeds over the phone). Each listening device is placed on one of the phone lin...
28,265
Interconnectivity Measure Description: There is a city consisting of $n$ junctions and $m$ roads. Each road is numbered from $1$ to $m$. Road $i$ connects junctions $u_ i$ and $v_ i$ bidirectionally. You can travel between any pair of junctions by traveling through the roads. To travel through roads in th...
28,266
Interesting Integers Description: Undoubtedly you know of the Fibonacci numbers. Starting with $F_1 = 1$ and $F_2 = 1$, every next number is the sum of the two previous ones. This results in the sequence $1,1,2,3,5,8,13,\ldots $. Now let us consider more generally sequences that obey the same recu...
28,267
Interference Description: Physics can be so much fun! Yesterday, your teacher explained how interference works: If you have two waves, their heights add up over the whole waves’ length! So if both waves have a peak, the resulting peak will be even higher. Likewise, if both waves have a wave trough belo...
28,268
Intergalactic Bidding Description: Due to the extremely competitive nature of the auction, as well as the odd mechanics of the intergalactic currency used (far too advanced for mere mortals to understand), the auction was conducted with the following rules: * only one participant was allowed to make a bid...
28,269
Intergalactic Mortgage Description: Many people on Earth want to solve their housing. When they have not enough money to buy their house or flat, they get mortgage from some bank and then they pay fixed monthly payments until they redeem the mortgage. You may think that paying mortgage for $30$ years is a...
28,270
Intergalactic Team Description: The Intergalactic Competitive Programming Contest (ICPC) is coming up, and it’s time to choose a team that will represent our planet in this esteemed competition. The ICPC president has announced the team size for this year’s competition to all planets that want to compe...
28,271
International Dates Description: You read a lot of documents that come from the United States, Europe, and other countries around the world. The issue is that their date formats aren’t consistent! The US formats their dates as MM/DD/YYYY while in Europe they format it as DD/MM/YYYY. That is, in the US ...
28,272
Interplanetary Tunnels Description: One year ago astronauts Alice and Bob set off to explore the galaxy each going their own way. The time has finally come for them to reunite and share their findings. Luckily they have set up a series of “hyper tunnels” between the planets they’ve visited. Each hyper ...
28,273
Interpreter Description: A certain computer has $10$ registers and $1000$ words of RAM. Each register or RAM location holds a $3$-digit integer between $0$ and $999$. Instructions are encoded as $3$-digit integers and stored in RAM. The encodings are as follows: * $1xy$ means halt (regardless of t...
28,274
Intersecting Rectangles Description: You are given a set of $n$ axis-aligned rectangles in a 2D plane. For this problem, two rectangles are considered to intersect if their boundaries contain any common points (in particular, two nesting rectangles don’t count as intersecting). Determine if some pair o...
28,275
Intertwined Description: NCPC (Nordic Cargo Plane Control) are testing a new engine for their cargo planes. To this end they have bound a strong and sturdy infinitely thin rope to the centre of their testing platform, and to the engine. We will place a coordinate system onto this testing platform such ...
28,276
Interval Cover Description: For this problem, you are given two things: a numeric interval $[A,B]$, and a list of other numeric intervals which, when combined, should “cover” (overlap completely with) the interval $[A,B]$. In particular, you should find a minimal set of the intervals needed for the ...
28,277
Interval Scheduling Description: Consider a set of $n$ intervals $I_1,\ldots , I_ n$, each given as an integer tuple $(s_ i, f_ i)$ with $s_ i<f_ i$, such that the $i$th interval starts at $s_ i$ and ends at $f_ i$. We want to determine the maximum number of nonoverlapping intervals. More f...
28,278
Interval Scheduling Description: Many couples will dine out on Valentine’s day. To serve as many customers as possible, a particular Western restaurant adopts the "Staggered Seating" strategy on the night of Valentine’s day. The strategy works as follows: The restaurant divides its opening hours into ...
28,279
Interview Preparation Description: With the internship season coming up, Johnny has began to prepare for the dreaded technical interviews. Johnny has upcoming interviews with $C$ different companies. The $i^\textrm {th}$ company will make Johnny an offer if and only if his technical skill is at lea...
28,280
Interview Question Description: Your task here is to solve the reverse problem: given a transcript of part of the game (not necessarily starting at 1), find possible values of $a$ and $b$ that could have been used to generate it. Figure 1 shows some sample sequences for various values of $a$ and $b$. ...
28,281
Interview Queue Description: A very popular position has just opened up at Poodle Inc. Candidates have formed a queue while they wait for their turn to be interviewed. Competition is fierce and each candidate knows that they will not be selected if another candidate is strictly better than them. Every...
28,282
Introspective Caching Description: However, caches have a nasty tendency to fill up, so at some point, objects must be evicted from the cache to make room for new objects. Choosing what object to remove from the cache is not easy and there are several different algorithms to choose from. The marvelous...
28,283
Intuitive Elements Description: Brandon is learning the periodic table! However, he doesn’t like some of the elements because the symbol of the element contains letters which are not present in the name of the element. He finds this to be unintuitive, especially because in other contexts, he expects ab...
28,284
Invasion Description: Alien invasion began, and scary man-eating aliens are establishing their bases all over the country. You are only safe on the places that are sufficiently far away from all current alien bases. You need to quickly write a program to help you determine where to move. ## Input The...
28,285
Inventing Test Data Description: Preparing a problem set is a very hard task. There are always issues with clarity of problem statements, bugs in our solutions, input or output data, and so on. Sometimes, despite our best efforts, these issues are only found during the contest, and this can really spoi...
28,286
Inverse Factorial Description: A factorial $n!$ of a positive integer $n$ is defined as the product of all positive integers smaller than or equal to $n$. For example, It is straightforward to calculate the factorial of a small integer, and you have probably done it many times before. In this ...
28,287
Inverse Totient Description: Euler’s totient function $\phi (n)$ is defined as the number of integers $j$, between $1$ and $n$, such that the greatest common divisor of $j$ and $n$ equals $1$. Given $\phi (n)$, compute the smallest possible value of $n$. ## Input The first and only line contains the...
28,288
Inverted Deck Description: Is it possible to restore the order of the cards into non-decreasing order of their rarity by reversing just one contiguous batch of cards? ## Input The input consists of: * One line containing an integer $n$ ($1 \le n \le 10^6$), the number of cards in your collection. *...
28,289
Investigating Imposters Description: You have stumbled upon a village. In this village, some of the people are “imposters”, while the rest are not. Fortunately, you know that the number of possible imposters is limited! You would like to determine who is not an imposter in this village. To do so, you ...
28,290
Invoker (Easy) Description: You are an invoker, a master sorcerer that is able to command sources of magic. ## Magical Training There are two sources of magic you can control, $\mathbb {R}$eagus and $\mathbb {I}$magus. Each source has a potency coefficient in front of it. This potency is a real number at...
28,291
Invoker (Hard) Description: You are an Arch-Magus Invoker, one of the strongest sorcerers that is able to command sources of magic. The difference between an Arch-Magus Invoker and a regular Invoker is that an Arch-Magus holds an advanced degree or is pursuing a post-doc in mathemagical studies at the Ins...
28,292
Iron and Coal Description: The board consists of different cells numbered from $1$ to $n$ which can contain resources. The rules for moving from one cell to another are rather complicated: if you can move from cell A to cell B, it does not always mean that you can also move from B to A. For example, if...
28,293
Ironman Description: 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$-...
28,294
Irrational Division Description: The game works as follows. Your parents place a $p \times q$-rectangle of the aforementioned mixed chocolate on a table. You are situated on the west side of the table and your sister on the south side. The side of length $p$ is parallel to the north-south line, while t...
28,295
Is It Even? Description: You are a leading programmer at $\text {Company}^\text {TM}$, and have been given the following task. Given a list of $N$ integers $x_1,\ldots , x_ N$, is their product $x_1\cdot x_2 \cdot \ldots \cdot x_ N$ even? You plug away at the problem using every trick in the book, and ...
28,296
Is Y a Vowel? Description: The Vowels are a, e, i, o and u, and possibly y. People disagree on whether y is a vowel or not. Unfortunately for you, you have been tasked with counting the number of vowels in a word. You’ll have to count how many vowels there are assuming y is a vowel, and assuming y is n...
28,297
Is it My Turn? Description: You just returned to your Uno game after a much-needed visit to the restroom. When you left, the player to your left had the turn, with play going clockwise. You can see that in your absence only Skip cards were played. Is it possible that it’s your turn now? Each Skip card...
28,298
Is-A? Has-A? Who Knowz-A? Description: Two familiar concepts in object oriented programming are the is-a and has-a relationships. Given two classes A and B, we say that A is-a B if A is a subclass of B; we say A has-a B if one of the fields of A is of type B. For example, we could imagine an object-ori...
28,299