Problems

Pick a problem and write your solution in the built-in editor. The judge runs it against real test cases while you watch, and the wider archive is open to read whenever you like.

Total results1,798 problems
TitleLevelTopicsSolvedTime limitMemory limitJudge
Gnome SequencingFor each of N triples of beard lengths, decide whether the three values are strictly increasing or strictly decreasing, then print Ordered or Unordered.Easy2ImplementationSorting+2No attempts yet1s128 MBJudgeable
Remove the DuplicatesFor each test case, collapse every run of consecutive equal numbers into a single value and print the result.Easy2ArrayImplementationNo attempts yet1s128 MBJudgeable
DoublesFor each list of 2 to 15 natural numbers ending in 0, count how many values x have 2x also in the same list.Easy2ArrayHash map+1No attempts yet1s128 MBJudgeable
Magnificent MeatballsGiven a circular list of guest meatball counts, find the position k where the sum of positions 1 through k equals the sum of the rest.Easy2ArrayPrefix sum+1No attempts yet1s128 MBJudgeable
Filling Out the TeamFor each player's speed, weight, and strength, print the positions whose limits the player satisfies, in table order, or No positions.Easy2ImplementationBrute force+1No attempts yet1s128 MBJudgeable
Judging OlympiaFor each line of six judge grades, discard the highest and lowest and print the average of the remaining four, stopping at the all-zero line.Easy2ImplementationMath+1No attempts yet1s128 MBJudgeable
ICPC Score Totalizer SoftwareFor each contestant, drop one highest and one lowest judge score, then output the truncated average of the rest.Easy2ImplementationSorting+2No attempts yet1s128 MBJudgeable
DVDsApply a series of clamped sale and restock transactions to each DVD title's stock and report the final count.Easy2ImplementationSimulation+2No attempts yet1s128 MBJudgeable
Oil ExplorationFor each column of a grid, scan downward and sum drilling costs (H costs 3, S costs 1) until the first oil cell, or print N if none exists.Easy2ArraySimulation+1No attempts yet1s128 MBJudgeable
Map InterfaceGiven station coordinates and a visited sequence, count how many stations fall inside the smallest axis-aligned rectangle covering the visited stations.Easy2ArrayImplementation+2No attempts yet1s128 MBJudgeable
Contest SeatsCount how many participants fail to get their chosen seat, since only the first arrival for a seat can sit there.Easy2ImplementationHash map+1No attempts yet1s128 MBJudgeable
Civil EngineeringRead material densities and oblong dimensions, then sum each oblong's volume times its material density for each data set.Easy2ImplementationMath+2No attempts yet1s128 MBJudgeable
Stacked Floating MountainsGiven several sequences, decide for each whether every element from the third onward equals the sum of the two before it.Easy2ImplementationArray+1No attempts yet1s128 MBJudgeable
Chess PuzzleFor each board, read the rook coordinates and report SAFE if no two rooks share a row or column, otherwise NOT SAFE.Easy2ImplementationHash map+2No attempts yet1s128 MBJudgeable
Checkerboard RowsFor each of B boards, read n pieces given as column-row pairs and print the largest number of pieces sharing the same row.Easy2ArrayHash map+1No attempts yet1s128 MBJudgeable
Secret LocationEach of six lines encodes one number by its character count; print the first three as Latitude and the last three as Longitude in the given format.Easy2StringImplementation+2No attempts yet1s128 MBJudgeable
Total CountRead fighter names until a line with 0, print each name with its kill count in first-appearance order, then the grand total.Easy2Hash mapImplementation+2No attempts yet1s128 MBJudgeable
LeagueGiven every match result in a round-robin soccer league, compute each team's total points and print its rank, where tied teams share the best rank.Easy2ImplementationArray+2No attempts yet1s128 MBJudgeable
Dice GameSimulate a piece on a board of cells, applying a die roll then the cell's instruction, and report how many rolls reach the goal.Easy2SimulationArrayNo attempts yet1s128 MBJudgeable
Card Flipping GameGiven two rows of n digit cards, reveal pairs left to right; the larger card wins both cards' sum, and equal cards each keep their own.Easy2SimulationImplementation+1No attempts yet1s128 MBJudgeable
Tunnel Entrance and ExitTrack the number of cars in a tunnel each minute from entrance and exit counts, and print the maximum count, or 0 if it ever goes negative.Easy2ImplementationSimulation+1No attempts yet1s128 MBJudgeable
BirthdayGiven each student's name and birthday, print the name of the youngest student, then the oldest.Easy2ImplementationSorting+1No attempts yet1s128 MBJudgeable
Weekend LotteryGiven N past draws of C distinct numbers from 1 to K, print all numbers that appeared the fewest times, in increasing order.Easy2ArrayImplementationNo attempts yet3s128 MBJudgeable
Head or TailFor each test case, count the zeros and ones in the list of game results and print how many games Mary and John each won.Easy2ImplementationArray+1No attempts yet1s128 MBJudgeable
Pascal LibraryGiven D attendance rows over N alumni, decide whether some alumnus attended every dinner.Easy2ArrayImplementation+1No attempts yet1s128 MBJudgeable
Grade StatisticsFor each class, read the scores, then report the maximum, the minimum, and the largest gap between neighboring scores after sorting in descending order.Easy2SortingImplementation+1No attempts yet1s128 MBJudgeable
Breed ProximityGiven a line of N cows with breed ids, find the largest breed id whose two occurrences lie within K positions of each other, or -1 if none exist.Easy2ArrayHash map+1No attempts yet1s128 MBJudgeable
Papaya JungleBessie moves greedily through a grid, always stepping to the adjacent square with the most uneaten papayas, and we sum the fruit she eats until she reaches the bottom-right corner.Easy2SimulationArray+2No attempts yet1s128 MBJudgeable
Hay ExpensesGiven N daily hay counts and Q ranges, output the sum of counts over each range from S to E inclusive.Easy2Prefix sumArrayNo attempts yet1s128 MBJudgeable
Time CardsFor each cow, pair her START and STOP entries and print the total time she spent at the milking machine as hours and minutes.Easy2ImplementationSimulation+1No attempts yet1s128 MBJudgeable
StatisticsRead N integers, print their mean and median rounded to six decimal places.Easy2ArraySorting+2No attempts yet1s128 MBJudgeable
TV ReportsTrack daily Dollar prices against the previous day and the running all-time high, printing NTV drop headlines and BBTV record headlines in day order.Easy2ImplementationSimulation+2No attempts yet1s128 MBJudgeable
Do the ShuffleSimulate a fixed 5-song playlist through button presses that rotate left, rotate right, or swap the first two songs, then print the final order.Easy2SimulationImplementation+1No attempts yet1s128 MBJudgeable
It's Cold Here!Read city names with integer temperatures, one per line, and print the name of the city with the lowest temperature.Easy2ImplementationArray+2No attempts yet1s128 MBJudgeable
Deal or No Deal CalculatorRead eliminated case numbers and a Banker's offer, compute the average of the remaining amounts, and print deal if the offer is higher, otherwise no deal.Easy2ImplementationArray+1No attempts yet1s128 MBJudgeable
Mouse MoveThe cursor starts at (0,0) on a screen of width c and height r; each relative move is clamped to the screen edges, and the position after every move must be printed.Easy2SimulationImplementation+2No attempts yet1s128 MBJudgeable
Smile with SimilesGiven up to five adjectives and five nouns, print every phrase of the form "<adjective> as <noun>" in nested input order.Easy2ImplementationBrute force+2No attempts yet1s128 MBJudgeable
NonogramGiven a grid of black and white squares, print the lengths of the consecutive black blocks in each row and then each column.Easy2ImplementationArray+2No attempts yet1s1024 MBJudgeable
CardsA 52-card deck is missing exactly one card; given the other 51 cards as suit and value pairs, output the missing suit and value.Easy2ArrayHash map+2No attempts yet1s1024 MBJudgeable
The Worm TurnsSimulate a 20-cell worm on a 50x50 grid through a list of moves, stopping when it hits itself, leaves the board, or finishes.Easy2SimulationImplementation+2No attempts yet1s128 MBJudgeable
Programming Contest PasswordsFor each test case, read a word list and participant index sequences, then print each password formed by concatenating the indexed words.Easy2ImplementationArray+1No attempts yet1s128 MBJudgeable
ExerciseFor each machine, multiply each exercise level's energy rate by its duration and sum the totals per person.Easy2SimulationImplementation+1No attempts yet1s128 MBJudgeable
The PaintingRead an n by m grid of . and # characters and print it rotated 90 degrees clockwise, producing m rows of n characters.Easy2ArrayMatrix+1No attempts yet1s128 MBJudgeable
ParkFor each of up to one million heights in order, output the maximum height to its west and to its east, using its own height when no higher point exists.Easy2Prefix sumArrayNo attempts yet1s512 MBJudgeable
Bagels on a StickSlide a chosen bagel off one end of the stick after removing the fewest bagels it cannot slide through.Easy2ArrayNo attempts yet1s512 MBJudgeable
Caesar CipherDecode a Caesar-shifted uppercase message by matching its most frequent letter to the given original letter.Easy2StringArray+1No attempts yet1s512 MBJudgeable
WarehouseTally up to a million signed per-product shipment records and print the remaining stock of each product in alphabetical order.Easy2ArraySimulationNo attempts yet1s512 MBJudgeable
Ranking ManipulationChoose weights on the tasks you solved so you finish first, then count the contestants tied with you.Easy2ArrayImplementationNo attempts yet1s128 MBJudgeable
ThumbtacksFind the smallest jump that crosses the bridge using only planks without thumbtacks.Easy2ArrayNo attempts yet1s128 MBJudgeable
ChessEach row holds at most one rook, so take the largest value in every row with a positive maximum and add them.Easy2GreedyArrayNo attempts yet1s128 MBJudgeable
Pear Trees and Apple TreesFind the largest distance between any pear tree and any apple tree in a row of n trees.Easy2ArrayNo attempts yet1s128 MBJudgeable
SalesFor each test case, count pairs of days where the earlier day sold no more than the later day and print the total.Easy2Brute forceArrayNo attempts yet1s128 MBJudgeable
DisplayAdd K consecutive numbers starting from the B-th value of a length-N sequence that repeats forever.Easy2ArraySimulationNo attempts yet1s128 MBJudgeable
TrainPassengers board in order into the non-full car with the fewest same-initial riders, ties broken by load then car number, and the program prints each car count.Easy2SimulationArrayNo attempts yet1s128 MBJudgeable
Olympic Country RankingCount how many countries beat country K on gold, then silver, then bronze medals, and report its rank.Easy2SortingArrayNo attempts yet1s128 MBJudgeable
DecryptionCount the letters in each sentence ignoring spaces and print the most frequent one, or ? on a tie.Easy2ArrayStringNo attempts yet1s128 MBJudgeable
Ironclad Security AlgorithmYou invert the word permutation defined by the two public keys and apply it to the ciphertext to recover the plaintext.Easy2Hash mapArrayNo attempts yet1s256 MBJudgeable
Fast Food PrizesAdd up, over disjoint prize sets, the prize value times the smallest sticker count among its required kinds.Easy2GreedyMath+1No attempts yet2s128 MBJudgeable
Sequence Folding GameRepeatedly fold the list by adding symmetric pairs until two numbers remain, then Alice wins when the first is larger.Easy2SimulationArrayNo attempts yet1s128 MBJudgeable
Gholam's Simple GameStarting from the marked tile and direction, walk n steps bouncing off both ends and count visits to yellow tiles.Easy2SimulationArrayNo attempts yet1s128 MBJudgeable
Arrangement of ContestCount the titles that form the longest unbroken run from A onward, using each title's first letter and stopping at the first missing letter.Easy2GreedyString+1No attempts yet2s256 MBJudgeable
Perfect ShuffleInterleave the top and bottom halves of a card list to perform one perfect shuffle for each test case.Easy2SimulationArrayNo attempts yet1s128 MBJudgeable
BeeThe program counts logged jobs under each of seven bee work codes and prints each count with its share of the total.Easy2ImplementationArray+1No attempts yet1s128 MBJudgeable
Cuckoo for HashingSimulate cuckoo hashing insertions into two mod-indexed tables with displacement and print the final table contents.Easy2SimulationHash map+1No attempts yet2s128 MBJudgeable
LampGuards patrol in roster order, each toggling the lamps in one arithmetic progression, and you report how many lamps stay on.Easy2SimulationArrayNo attempts yet1s128 MBJudgeable
Maximum FrequencyGiven N integers, count how many times each value appears and print the largest count.Easy2Hash mapArrayNo attempts yet2s1024 MBJudgeable
RouteCount the maximal runs of level, uphill, and downhill metre sections along the looped jogging route starting at pole 1.Easy2ArrayImplementationNo attempts yet2s1024 MBJudgeable
VoteEach judge votes for the most interesting game they can afford, and the game with the most votes wins.Easy2SimulationArrayNo attempts yet1s128 MBJudgeable
Party InvitationSimulate m rounds of removing every person at a multiple of ri from the ordered list and print the survivors in order.Easy2SimulationArrayNo attempts yet2s256 MBJudgeable
Odysseus and the SirensThe program scores every melody under each candidate key by summing note penalties and prints the numbered key with the smallest total.Easy2ImplementationString+1No attempts yet1s256 MBJudgeable
Turtle GraphicsSimulate a turtle that steps forward and turns on a 64 by 64 grid, then report its final cell and how many cells it visited more than once.Easy2SimulationArrayNo attempts yet1s256 MBJudgeable
Most Chosen NumberPick the number that appears most often in each test case, breaking ties by the smaller number.Easy2ArrayImplementationNo attempts yet5s256 MBJudgeable
Mushrooms on Half a PizzaGiven mushroom counts on eight circular pizza slices, find the largest total on any four consecutive slices.Easy2Brute forceArrayNo attempts yet1s32 MBJudgeable
Cow RoutingFind the cheapest single flight route on which city A appears before city B, or report -1 when none exists.Easy2ImplementationArrayNo attempts yet1s256 MBJudgeable
Paprika ID CardsSimulate one left-to-right pass of conditional card swaps, then count paprikas whose final card matches their goal.Easy2SimulationArrayNo attempts yet1s256 MBJudgeable
Weather ForecasterClouds drift east one cell per minute, and each cell reports how many minutes until a cloud first arrives, or -1 if none ever does.Easy2SimulationArrayNo attempts yet1s256 MBJudgeable
Reversing basketsApply M given interval reversals in order to baskets numbered 1 to N, then print the final order from the left.Easy2ArraySimulationNo attempts yet1s256 MBJudgeable
Rotating the basket orderPerform M given segment rotations on baskets numbered 1 to N and print the final left-to-right order.Easy2SimulationArrayNo attempts yet1s256 MBJudgeable
Counting FriendsCount the friends of each of N students from M mutual friendship pairs and print the N totals.Easy2GraphArrayNo attempts yet1s256 MBJudgeable
Inverse Move-to-Front TransformReconstruct the lowercase string from its move-to-front code by simulating the 26-letter list.Easy2SimulationArrayNo attempts yet2s256 MBJudgeable
Entrance ExaminationPick the cutoff n between nmin and nmax with a strict score split that maximizes the gap between the lowest passing and highest failing scores.Easy2ArrayImplementationNo attempts yet1s256 MBJudgeable
Flag QuizPrint the alternatives whose maximum position-wise difference to any other alternative is smallest.Easy2Brute forceArrayNo attempts yet1s256 MBJudgeable
Black FridayGiven each person's die roll, print the number of the person holding the highest roll that no one else rolled, or none.Easy2ArrayImplementationNo attempts yet1s256 MBJudgeable
Moist (Small1)For each deck of names, count how many cards the robot moves to sort the deck into lexicographic order.Easy2ArrayStringNo attempts yet5s512 MBJudgeable
GBus Count (Large)Count, for each queried city, how many of the given inclusive intervals cover it.Easy2Brute forceIntervals+1No attempts yet5s512 MBJudgeable
Card Shuffle (Small)Simulate C segment-to-top cuts on a deck of M ordered cards and report the card at position W.Easy2SimulationArrayNo attempts yet5s512 MBJudgeable
Investing at the MarketChoose a buy month and a later sell month from 12 prices to maximize whole-unit profit, breaking ties by lower buy price.Easy2Brute forceArrayNo attempts yet5s512 MBJudgeable
Odd Man OutGiven an odd-length list of invitation codes where every value appears twice except one, find the value that appears once.Easy2Bit manipulationArray+1No attempts yet5s512 MBJudgeable
Immigrate to the CTP principalityConvert each item between uppercase letters and their alphabet positions (A=1 to Z=26), in the direction given by the mode character.Easy2ImplementationString+2No attempts yet1s128 MBJudgeable
StarmanGiven up to 100 year ranges, print the Bowie albums released within each range, in release order, with a count first.Easy2ArrayImplementationNo attempts yet1s128 MBJudgeable
Manhattan TaxiGiven your waiting intersection and up to 100 taxi positions on a 100x100 grid, print the coordinates of the taxi with the smallest Manhattan distance.Easy2ImplementationBrute force+2No attempts yet2s512 MBJudgeable
ChessboardPrint an N by M grid of asterisks and dots where the top left cell is an asterisk and adjacent cells always differ.Easy2ArrayImplementation+2No attempts yet2s512 MBJudgeable
Stock InvestmentGiven each day's profit for three stocks, pick at most one stock per day and maximize the total profit.Easy2ArrayGreedyNo attempts yet1s128 MBJudgeable
Cleaning StationsGiven weights and a feature matrix, print the indices of the rows whose weighted sum is largest, in ascending order, for each of K data sets.Easy2ImplementationArray+1No attempts yet2s512 MBJudgeable
Dangerous DiveGiven N volunteers and the R identifiers that returned, list the missing identifiers in ascending order, or print * if all returned.Easy2ArrayHash mapNo attempts yet2s512 MBJudgeable
Sub-primeGiven each bank's reserve and a list of debentures between banks, check whether every bank ends with a nonnegative balance after all debentures settle at once.Easy2ArrayImplementation+1No attempts yet2s512 MBJudgeable
Enlarging the Cow SignalPrint an M by N grid of dots and X characters with each cell repeated K times in both directions.Easy2ImplementationArrayNo attempts yet2s512 MBJudgeable
Key MakerFor each test case, count how many trash keys have the same cut count and can be deepened, or already match, the customer key.Easy2ArrayImplementationNo attempts yet2s512 MBJudgeable
GradesGiven a list of grades, compare the midpoint of the maximum and minimum against the overall average, and report whether they differ by less than 1.Easy2ArrayMath+1No attempts yet2s512 MBJudgeable
Refreshment AreaCount the number of D-long horizontal or vertical runs of empty cells in an N by M grid.Easy2ArrayImplementation+2No attempts yet2s512 MBJudgeable