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 results2,730 problems
TitleLevelTopicsSolvedTime limitMemory limitJudge
Sorting Numbers 3Sort up to 10,000,000 integers no greater than 10,000 in ascending order, one per line.Easy3SortingArrayNo attempts yet5s8 MBJudgeable
K-th smallest numberSort the N given integers in ascending order and print the element at position K.Easy3SortingNo attempts yet2s512 MBJudgeable
Rings of SaturnFind every connected group of exactly seven people, sum the threat levels inside each group, and list them by total threat.Easy3Union-findSortingNo attempts yet2s256 MBJudgeable
Ruben SpawnsPick the fewest minions whose combined work capacities reach the required workload W.Easy3GreedySortingNo attempts yet1s256 MBJudgeable
Birds on a WireCount how many more birds can sit on a wire of length l when birds stay d apart and 6 cm from each pole.Easy3GreedySorting+1No attempts yet1s256 MBJudgeable
Choosing Pizza ToppingsSimulate the given repair loop that flips one unfulfilled topping of the first unhappy friend until every friend has more than a third of wishes met.Easy3SimulationImplementation+1No attempts yet1s256 MBJudgeable
PollingCount the votes for each candidate and print the names with the most votes in alphabetical order.Easy3Hash mapSortingNo attempts yet1s256 MBJudgeable
CandyPack J candies using the fewest boxes by filling the largest capacity boxes first.Easy3GreedySortingNo attempts yet1s256 MBJudgeable
Contest RankingParse each team per-problem records, sum the weights of solved problems, and print teams ranked by points with ties sharing a rank.Easy3ImplementationSortingNo attempts yet1s256 MBJudgeable
Best BuddiesSort all participants by last name then first name, split the order into consecutive triples, and print each queried person's two teammates.Easy3SortingHash mapNo attempts yet2s256 MBJudgeable
Bitcoin ProfitsGiven share difficulties, pick the integer k of at least 1 that maximizes k times the count of shares at or above k, breaking ties toward the smaller k.Easy3SortingPrefix sumNo attempts yet2s256 MBJudgeable
There is no place like 127.0.0.1Replace each IPv4 address in the text with its mapped word from single entries and non-overlapping ranges, leaving unmatched addresses unchanged.Easy3Binary searchSorting+1No attempts yet2s256 MBJudgeable
Cornell PartyDecide whether two arrival logs match up to a renaming of guests by comparing the multisets of visit counts.Easy3Hash mapSortingNo attempts yet3s256 MBJudgeable
ATMReorder N people by withdrawal time so the sum of all waiting-plus-service finish times is as small as possible.Easy3GreedySorting+1No attempts yet1s256 MBJudgeable
RummikubDecide whether a hand of numbered suit tiles contains a valid group or run of at least three tiles.Easy3ImplementationSorting+1No attempts yet1s256 MBJudgeable
Conversation LogFind words used at least once by every user and list them by total frequency, breaking ties alphabetically.Easy3Hash mapSortingNo attempts yet2s256 MBJudgeable
Buy Two Get One FreeSort all prices from high to low and take every third pack free to pay the smallest possible total.Easy3GreedySortingNo attempts yet1s64 MBJudgeable
Chicken Top NPrint the row after one bottom-up merge sort stage by merging each pair of sorted groups of length N/(2k) into one sorted group of length N/k.Easy3SimulationSortingNo attempts yet5s256 MBJudgeable
ClassySort people by refined class rank, treating missing levels as middle, breaking ties by name.Easy3SortingString+1No attempts yet2s256 MBJudgeable
Class TimeSort the student names by last name, breaking ties by first name, and print them in that order.Easy3SortingNo attempts yet2s256 MBJudgeable
Physical MusicGiven a permutation of chart positions, list the download-chart positions of entries that a later single outranks, in ascending order.Easy3ArraySortingNo attempts yet5s256 MBJudgeable
Xedni DrawkcabReverse each uppercase word and print the reversed words in alphabetical order.Easy3StringSortingNo attempts yet1s256 MBJudgeable
Sorting Points by CoordinatesSort N planar points by increasing x coordinate, breaking ties by increasing y, and print them in order.Easy3SortingNo attempts yet1s256 MBJudgeable
Sorting Coordinates 2Sort N points by increasing y coordinate, breaking ties by increasing x, and print them.Easy3SortingNo attempts yet1s256 MBJudgeable
CardsCount the N card values and print the most frequent one, breaking ties by the smaller value.Easy3Hash mapSortingNo attempts yet1s256 MBJudgeable
Suffix ArrayGiven a lowercase string, print all of its suffixes in lexicographic order, one per line.Easy3SortingStringNo attempts yet1s256 MBJudgeable
Programming Contest StrategyPick and order contest problems to solve the most within the time limit with the smallest total penalty time.Easy3GreedySortingNo attempts yet1s256 MBJudgeable
Sorting Numbers 4Sort N distinct integers in descending order and print one per line.Easy3SortingNo attempts yet2s256 MBJudgeable
ACM-ICPC ScoreboardReplay the judging log to count each team's solved problems and penalty time, then print all teams in rank order.Easy3SimulationSortingNo attempts yet1s128 MBJudgeable
Angry Cows (Bronze)Starting from the best bale, count how many bales explode as the blast radius grows by one each step.Easy3SimulationSortingNo attempts yet2s512 MBJudgeable
Balanced Fence PartitionPlace one vertical and one horizontal fence between grid points to minimize the largest cow count in the four regions.Easy3Brute forceSortingNo attempts yet2s512 MBJudgeable
Diamond Collector (Bronze)Choose the largest group of diamonds whose sizes differ by at most K.Easy3SortingSliding windowNo attempts yet2s512 MBJudgeable
gRanks (Small)Rank every athlete by summing only their M highest weighted place points, breaking ties alphabetically with skipped ranks.Easy3SortingHash map+1No attempts yet5s512 MBJudgeable
gRanksRank athletes by summing each athlete's top M weighted placement scores and ordering by total, breaking ties alphabetically.Easy3SortingHash map+1No attempts yet5s512 MBJudgeable
H-IndexGiven N citation counts, compute the largest H with at least H papers cited at least H times.Easy3SortingNo attempts yet1s256 MBJudgeable
Bookshelf SortingSeparate books into odd and even worths, sort the odds up and the evens down, then refill each position with the matching owner.Easy3SortingArrayNo attempts yet5s512 MBJudgeable
Sorting the BookshelfSeparate the books by odd and even worth, sort the odd ones increasingly and the even ones decreasingly, then put each back on its owner labeled spots.Easy3SortingArrayNo attempts yet5s512 MBJudgeable
Aerobics (Large)Sort students by reach, largest first, then place them line by line on the mat following the prescribed packing rule.Easy3SimulationSortingNo attempts yet5s512 MBJudgeable
Rope IntranetCount the cable pairs that cross by sorting on the left height and counting opposite-ordered right heights.Easy3SortingBrute forceNo attempts yet5s512 MBJudgeable
Rope IntranetCount wire pairs that cross by sorting on one endpoint height and counting inverted pairs on the other.Easy3SortingBrute forceNo attempts yet5s512 MBJudgeable
Text Messaging Outrage (Small)Assign letters of given frequencies to at most K keys, P letters per key, to minimize total key presses; sort frequencies descending and fill positions greedily.Easy3GreedySorting+1No attempts yet5s512 MBJudgeable
Who is the final winner?Each of N players holds M cards; every round all players play their largest remaining card and whoever plays the highest value scores a point. Report the player(s) with the most points.Easy3SortingSimulation+2No attempts yet1s128 MBJudgeable
Will the Second IUPC Go Well?Given the pen counts of N members, find the fewest members whose pens total at least M*K, or print STRESS if the total falls short.Easy3GreedySorting+2No attempts yet1s128 MBJudgeable
Selection of Participants of an ExperimentGiven a list of student scores, find the smallest absolute difference between any two of them.Easy3SortingArrayNo attempts yet2s512 MBJudgeable
RuneFor each language, compute each rune's power as the number of maximal runs of consecutive vowels, then sort by power descending and by name ascending.Easy3SortingString+2No attempts yet1s512 MBJudgeable
Formula 1 World ChampionGiven each driver's finishing place in every race, compute total points under several scoring systems and print the champion(s), breaking ties by listing all joint champions.Easy3ImplementationArray+1No attempts yet2s512 MBJudgeable
Parliamentary RankingsGiven members and weekly action codes with point values, print the highest and lowest scores with the matching names in id order.Easy3Hash mapSorting+1No attempts yet2s512 MBJudgeable
Wildcard AnagramGiven two equal-length strings, check whether the second is an anagram of the first after treating its asterisks as any letters.Easy3StringHash map+2No attempts yet2s512 MBJudgeable
IOI 2017 Logo VoteEach voter ranks up to three logos worth 3, 2, 1 points; find all logos winning on score, then first votes, then second votes.Easy3ImplementationSorting+1No attempts yet2s512 MBJudgeable
Three SticksGiven three stick lengths, shorten them to positive integers so they form a non-degenerate triangle with the largest possible perimeter.Easy3GreedyMath+2No attempts yet2s512 MBJudgeable
Rank and File (Large)Given all but one of the rows and columns of a sorted grid, find the missing list of heights in increasing order.Easy3ImplementationHash map+1No attempts yet5s512 MBJudgeable
Don't Be Last!Sum each of the seven cows' milk output, then report the cow with the second-smallest total, or Tie if none or several qualify.Easy3Hash mapSortingNo attempts yet2s512 MBJudgeable
Why Did the Cow Cross the Road 3Given each cow's arrival and inspection time, find the earliest time all cows finish entering when inspected one at a time in arrival order.Easy3SortingSimulationNo attempts yet2s512 MBJudgeable
Election of EvilGiven directed persuasion edges and a set of already-controlled representatives, list the reachable members of target set V in alphabetical order.Easy3GraphBFS+2No attempts yet2s512 MBJudgeable
VoteSum each candidate's results across vote centers and report the unique top scorer, or a dilemma if there is a tie.Easy3Hash mapImplementation+1No attempts yet2s512 MBJudgeable
Closest bus stopsGiven n distinct integer coordinates on a line, find the smallest absolute difference between any two and count how many pairs achieve it.Easy3SortingArray+1No attempts yet1s128 MBJudgeable
Salt and Pepper (Small)Given an M by N brightness matrix and odd window size W, output the median of every W by W window.Easy3ArraySorting+1No attempts yet1s512 MBJudgeable
Kim's DinerMaintain a list of pending orders under append, sort by (time, table), and delete-by-table commands, printing the list after each query.Easy3SimulationSorting+2No attempts yet2s256 MBJudgeable
High Tide, Low TideGiven N distinct measurements taken alternately low, high, low, high..., with rising highs and falling lows, reconstruct the original order.Easy3SortingGreedy+1No attempts yet1s512 MBJudgeable
Password HackingGiven each password's probability of being correct, find the expected number of attempts when trying passwords in the order that minimizes it.Easy3GreedySorting+2No attempts yet1s512 MBJudgeable
County Fair EventsGiven N intervals, find the maximum number of non-overlapping intervals John can attend.Easy3GreedySorting+1No attempts yet2s512 MBJudgeable
Younghoon the Informatics GodCompute Younghoon's total score from N solved problems, then compare it against P scores to decide whether his rank is within the top 15%.Easy3MathImplementation+1No attempts yet2s512 MBJudgeable
Finding matching pairsGiven 2 to 10 integers and a target, print every position pair that sums to the target in lexicographic order, then the count.Easy3SortingBrute force+1No attempts yet2s512 MBJudgeable
Law 11: Offside PositionGiven the ball's position and 11 attackers plus 11 defenders, decide whether any attacker is in an offside position per two coordinate conditions.Easy3ImplementationGeometry+2No attempts yet2s512 MBJudgeable
League TablesGiven each team's current record and a list of match results, update the records and print the table sorted by points, goal difference, goals scored, then name.Easy3ImplementationSorting+2No attempts yet2s512 MBJudgeable
Number PairsCount pairs of distinct values in a sequence that sum to a target K, where order does not matter and each element is used once.Easy3ArrayHash map+2No attempts yet2s512 MBJudgeable
CipherSort a sequence of N integers by decreasing frequency, breaking ties by the order each value first appears in the input.Easy3SortingHash map+1No attempts yet2s512 MBJudgeable
Olivander's wand boxesGiven N wand lengths and N box sizes, decide whether every wand can be paired with a distinct box whose size is at least the wand length.Easy3SortingGreedy+2No attempts yet1s64 MBJudgeable
Äventyr 1On a path 1 to N, vertices become active over time; after each activation, answer the distance from a query vertex to the nearest active vertex, or -1 if none exists yet.Easy3ArraySorting+2No attempts yet1s256 MBJudgeable
Length M sequences from N numbersGiven N distinct numbers and an M, print every length-M permutation of the numbers in lexicographic order without repeats.Easy3BacktrackingRecursion+2No attempts yet1s512 MBJudgeable
N and M (6)Given N distinct natural numbers and M, print every ascending M-element subsequence in lexicographic order without repeats.Easy3BacktrackingSorting+2No attempts yet1s512 MBJudgeable
N and M (10)Given N numbers and an M, print every non-decreasing length-M selection of the numbers in lexicographic order without duplicates.Easy3BacktrackingSorting+2No attempts yet1s512 MBJudgeable
Sorting numbers 5Read up to a million integers and print them in non-decreasing order, one per line.Easy3SortingArray+1No attempts yet10s128 MBJudgeable
Stella Gives Chicken GiftsRank participants by solved count, then penalty, and count how many solved as many problems as the fifth place but finished below it.Easy3SortingImplementationNo attempts yet2s512 MBJudgeable
Girl Group Master JunseokRead N girl groups with member lists, then answer M quizzes: list a team's members sorted, or name a member's team.Easy3Hash mapSorting+1No attempts yet2s128 MBJudgeable
CupidFilter N users by gender preference and distance limit, sort the matching names lexicographically, and print them or "No one yet".Easy3SortingImplementationNo attempts yet1.004s512 MBJudgeable
ConcertGiven up to one million first-round ticket numbers, find the smallest positive integer not among them.Easy3SortingImplementationNo attempts yet1s512 MBJudgeable
Grouping Identical WordsCount words that are permutations of each other using letter counts, and print the number of distinct letter multisets.Easy3SortingHash map+1No attempts yet2s512 MBJudgeable
Congestion Charging ZoneGiven up to 100 camera sighting times for one vehicle, find its first and last times in 6:30 to 19:00 and output the matching charge from the table.Easy3ImplementationSortingNo attempts yet2s512 MBJudgeable
Why Did APC Become a Subtask Contest?Given N problems each with an easy and hard difficulty and a solve limit K, find the maximum score Hyunjung can earn with skill L. Each problem's easy part is worth 100 and the hard part adds 40, and solving the hard part counts as one problem.Easy3GreedySorting+2No attempts yet1s512 MBJudgeable
Server RoomAir rises one unit per minute from the bottom of an N x N grid of stacked computers; find the earliest minute when at least half of all computers are cooled.Easy3SortingBinary search+2No attempts yet1s256 MBJudgeable
Keyboard EventGiven key presses with keyboard number, time, and character, print the characters ordered by time, breaking ties by keyboard number.Easy3SortingImplementation+1No attempts yet1s256 MBJudgeable
You Have To Solve This One!Sort the array, then answer range-sum queries over the sorted sequence efficiently.Easy3SortingPrefix sum+1No attempts yet1s512 MBJudgeable
Hamster BallTape can seal a ball only if its tape needed is at most the radius; each ball of radius s costs 2*pi*s, so pick sizes with the cheapest cost per ball.Easy3GreedySorting+2No attempts yet1s512 MBJudgeable
Lost LineupGiven each of Jimmy's friends' distance (number of people between them and Jimmy) from the front, reconstruct the original lineup with Jimmy first.Easy3ArraySorting+2No attempts yet1s512 MBJudgeable
Price EvaluationGiven property prices and a list of m property names where some entries are unknown, find the minimum and maximum possible total price.Easy3ImplementationGreedy+2No attempts yet2s512 MBJudgeable
Expeditious CubingGiven four of Claire's five solve times and a target final score (average of the middle three), find the largest fifth solve time that still meets the target, or report impossible or infinite.Easy3MathSorting+2No attempts yet2s512 MBJudgeable
solved.acGiven up to 300,000 difficulty votes, output the 30% trimmed mean, rounding the count trimmed at each end and the final average to the nearest integer.Easy3SortingMath+1No attempts yet1s1024 MBJudgeable
Livestock LineupGiven at most 7 'must be milked beside' constraints among 8 cows, output the alphabetically first permutation satisfying all of them.Easy3Brute forceBacktracking+2No attempts yet1s512 MBJudgeable
Duplicate FilesGiven file names and unique IDs, keep the smallest ID for each distinct name and print the surviving IDs in increasing order.Easy3Hash mapSorting+1No attempts yet2s512 MBJudgeable
Please Write the If Statements for MeGiven N titles ordered by increasing power upper bounds, print for each of M power values the first title whose bound is at least that value.Easy3Binary searchArray+2No attempts yet1s1024 MBJudgeable
SortingGiven a list of question difficulties, determine the minimum number of adjacent swaps needed to sort them into increasing order.Easy3SortingGreedy+1No attempts yet1s512 MBJudgeable
LunchBoxGiven N lunch boxes and each school's request ki, choose schools to satisfy fully (all ki boxes or none) so the count of served schools is maximized.Easy3GreedySorting+2No attempts yet0.5s512 MBJudgeable
Advertising on the FenceGiven n intervals over boards 1 to m, decide whether their union covers every board from 1 to m.Easy3IntervalsSorting+1No attempts yet2s512 MBJudgeable
Restoring the SequenceGiven n, m, and m board values, decide whether they are 1..n with exactly one number erased, and print that number.Easy3ImplementationMath+2No attempts yet1s512 MBJudgeable
AppointmentsGiven N pairs of appointment and arrival times, find how many integer shifts T minimize the total waiting time, which reduces to counting optimal medians of the differences.Medium4SortingMath+1No attempts yet2s128 MBJudgeable
Make a PalindromeRearrange the letters of a given uppercase string into the lexicographically smallest palindrome, or report it is impossible.Medium4StringGreedy+1No attempts yet2s128 MBJudgeable
Online Egg SalesGiven N eggs and M customers' maximum bid prices, pick the selling price (lowest if tied) that maximizes total revenue when all customers bidding at least that price buy an egg, capped at N sales.Medium4SortingGreedy+1No attempts yet2s128 MBJudgeable
Time ManagementGiven tasks with durations and deadlines, find the latest single start time so that all tasks scheduled back to back meet their deadlines, or report -1 if impossible.Medium4GreedySorting+1No attempts yet2s128 MBJudgeable
Platform Support PillarsGiven platforms with heights and horizontal spans, compute the total length of vertical support pillars placed slightly inside each platform's ends resting on the floor or a lower platform.Medium4SimulationSorting+2No attempts yet2s128 MBJudgeable