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
| Title | Level | Topics | Solved | Time limit | Memory limit | Judge |
|---|---|---|---|---|---|---|
| Sorting Numbers 3Sort up to 10,000,000 integers no greater than 10,000 in ascending order, one per line. | Easy3 | SortingArray | No attempts yet | 5s | 8 MB | Judgeable |
| K-th smallest numberSort the N given integers in ascending order and print the element at position K. | Easy3 | Sorting | No attempts yet | 2s | 512 MB | Judgeable |
| Rings of SaturnFind every connected group of exactly seven people, sum the threat levels inside each group, and list them by total threat. | Easy3 | Union-findSorting | No attempts yet | 2s | 256 MB | Judgeable |
| Ruben SpawnsPick the fewest minions whose combined work capacities reach the required workload W. | Easy3 | GreedySorting | No attempts yet | 1s | 256 MB | Judgeable |
| 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. | Easy3 | GreedySorting+1 | No attempts yet | 1s | 256 MB | Judgeable |
| 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. | Easy3 | SimulationImplementation+1 | No attempts yet | 1s | 256 MB | Judgeable |
| PollingCount the votes for each candidate and print the names with the most votes in alphabetical order. | Easy3 | Hash mapSorting | No attempts yet | 1s | 256 MB | Judgeable |
| CandyPack J candies using the fewest boxes by filling the largest capacity boxes first. | Easy3 | GreedySorting | No attempts yet | 1s | 256 MB | Judgeable |
| Contest RankingParse each team per-problem records, sum the weights of solved problems, and print teams ranked by points with ties sharing a rank. | Easy3 | ImplementationSorting | No attempts yet | 1s | 256 MB | Judgeable |
| Best BuddiesSort all participants by last name then first name, split the order into consecutive triples, and print each queried person's two teammates. | Easy3 | SortingHash map | No attempts yet | 2s | 256 MB | Judgeable |
| 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. | Easy3 | SortingPrefix sum | No attempts yet | 2s | 256 MB | Judgeable |
| 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. | Easy3 | Binary searchSorting+1 | No attempts yet | 2s | 256 MB | Judgeable |
| Cornell PartyDecide whether two arrival logs match up to a renaming of guests by comparing the multisets of visit counts. | Easy3 | Hash mapSorting | No attempts yet | 3s | 256 MB | Judgeable |
| ATMReorder N people by withdrawal time so the sum of all waiting-plus-service finish times is as small as possible. | Easy3 | GreedySorting+1 | No attempts yet | 1s | 256 MB | Judgeable |
| RummikubDecide whether a hand of numbered suit tiles contains a valid group or run of at least three tiles. | Easy3 | ImplementationSorting+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Conversation LogFind words used at least once by every user and list them by total frequency, breaking ties alphabetically. | Easy3 | Hash mapSorting | No attempts yet | 2s | 256 MB | Judgeable |
| Buy Two Get One FreeSort all prices from high to low and take every third pack free to pay the smallest possible total. | Easy3 | GreedySorting | No attempts yet | 1s | 64 MB | Judgeable |
| 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. | Easy3 | SimulationSorting | No attempts yet | 5s | 256 MB | Judgeable |
| ClassySort people by refined class rank, treating missing levels as middle, breaking ties by name. | Easy3 | SortingString+1 | No attempts yet | 2s | 256 MB | Judgeable |
| Class TimeSort the student names by last name, breaking ties by first name, and print them in that order. | Easy3 | Sorting | No attempts yet | 2s | 256 MB | Judgeable |
| Physical MusicGiven a permutation of chart positions, list the download-chart positions of entries that a later single outranks, in ascending order. | Easy3 | ArraySorting | No attempts yet | 5s | 256 MB | Judgeable |
| Xedni DrawkcabReverse each uppercase word and print the reversed words in alphabetical order. | Easy3 | StringSorting | No attempts yet | 1s | 256 MB | Judgeable |
| Sorting Points by CoordinatesSort N planar points by increasing x coordinate, breaking ties by increasing y, and print them in order. | Easy3 | Sorting | No attempts yet | 1s | 256 MB | Judgeable |
| Sorting Coordinates 2Sort N points by increasing y coordinate, breaking ties by increasing x, and print them. | Easy3 | Sorting | No attempts yet | 1s | 256 MB | Judgeable |
| CardsCount the N card values and print the most frequent one, breaking ties by the smaller value. | Easy3 | Hash mapSorting | No attempts yet | 1s | 256 MB | Judgeable |
| Suffix ArrayGiven a lowercase string, print all of its suffixes in lexicographic order, one per line. | Easy3 | SortingString | No attempts yet | 1s | 256 MB | Judgeable |
| Programming Contest StrategyPick and order contest problems to solve the most within the time limit with the smallest total penalty time. | Easy3 | GreedySorting | No attempts yet | 1s | 256 MB | Judgeable |
| Sorting Numbers 4Sort N distinct integers in descending order and print one per line. | Easy3 | Sorting | No attempts yet | 2s | 256 MB | Judgeable |
| ACM-ICPC ScoreboardReplay the judging log to count each team's solved problems and penalty time, then print all teams in rank order. | Easy3 | SimulationSorting | No attempts yet | 1s | 128 MB | Judgeable |
| Angry Cows (Bronze)Starting from the best bale, count how many bales explode as the blast radius grows by one each step. | Easy3 | SimulationSorting | No attempts yet | 2s | 512 MB | Judgeable |
| Balanced Fence PartitionPlace one vertical and one horizontal fence between grid points to minimize the largest cow count in the four regions. | Easy3 | Brute forceSorting | No attempts yet | 2s | 512 MB | Judgeable |
| Diamond Collector (Bronze)Choose the largest group of diamonds whose sizes differ by at most K. | Easy3 | SortingSliding window | No attempts yet | 2s | 512 MB | Judgeable |
| gRanks (Small)Rank every athlete by summing only their M highest weighted place points, breaking ties alphabetically with skipped ranks. | Easy3 | SortingHash map+1 | No attempts yet | 5s | 512 MB | Judgeable |
| gRanksRank athletes by summing each athlete's top M weighted placement scores and ordering by total, breaking ties alphabetically. | Easy3 | SortingHash map+1 | No attempts yet | 5s | 512 MB | Judgeable |
| H-IndexGiven N citation counts, compute the largest H with at least H papers cited at least H times. | Easy3 | Sorting | No attempts yet | 1s | 256 MB | Judgeable |
| Bookshelf SortingSeparate books into odd and even worths, sort the odds up and the evens down, then refill each position with the matching owner. | Easy3 | SortingArray | No attempts yet | 5s | 512 MB | Judgeable |
| 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. | Easy3 | SortingArray | No attempts yet | 5s | 512 MB | Judgeable |
| Aerobics (Large)Sort students by reach, largest first, then place them line by line on the mat following the prescribed packing rule. | Easy3 | SimulationSorting | No attempts yet | 5s | 512 MB | Judgeable |
| Rope IntranetCount the cable pairs that cross by sorting on the left height and counting opposite-ordered right heights. | Easy3 | SortingBrute force | No attempts yet | 5s | 512 MB | Judgeable |
| Rope IntranetCount wire pairs that cross by sorting on one endpoint height and counting inverted pairs on the other. | Easy3 | SortingBrute force | No attempts yet | 5s | 512 MB | Judgeable |
| 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. | Easy3 | GreedySorting+1 | No attempts yet | 5s | 512 MB | Judgeable |
| 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. | Easy3 | SortingSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| 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. | Easy3 | GreedySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Selection of Participants of an ExperimentGiven a list of student scores, find the smallest absolute difference between any two of them. | Easy3 | SortingArray | No attempts yet | 2s | 512 MB | Judgeable |
| 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. | Easy3 | SortingString+2 | No attempts yet | 1s | 512 MB | Judgeable |
| 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. | Easy3 | ImplementationArray+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Parliamentary RankingsGiven members and weekly action codes with point values, print the highest and lowest scores with the matching names in id order. | Easy3 | Hash mapSorting+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Wildcard AnagramGiven two equal-length strings, check whether the second is an anagram of the first after treating its asterisks as any letters. | Easy3 | StringHash map+2 | No attempts yet | 2s | 512 MB | Judgeable |
| 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. | Easy3 | ImplementationSorting+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Three SticksGiven three stick lengths, shorten them to positive integers so they form a non-degenerate triangle with the largest possible perimeter. | Easy3 | GreedyMath+2 | No attempts yet | 2s | 512 MB | Judgeable |
| 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. | Easy3 | ImplementationHash map+1 | No attempts yet | 5s | 512 MB | Judgeable |
| 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. | Easy3 | Hash mapSorting | No attempts yet | 2s | 512 MB | Judgeable |
| 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. | Easy3 | SortingSimulation | No attempts yet | 2s | 512 MB | Judgeable |
| Election of EvilGiven directed persuasion edges and a set of already-controlled representatives, list the reachable members of target set V in alphabetical order. | Easy3 | GraphBFS+2 | No attempts yet | 2s | 512 MB | Judgeable |
| VoteSum each candidate's results across vote centers and report the unique top scorer, or a dilemma if there is a tie. | Easy3 | Hash mapImplementation+1 | No attempts yet | 2s | 512 MB | Judgeable |
| 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. | Easy3 | SortingArray+1 | No attempts yet | 1s | 128 MB | Judgeable |
| 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. | Easy3 | ArraySorting+1 | No attempts yet | 1s | 512 MB | Judgeable |
| 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. | Easy3 | SimulationSorting+2 | No attempts yet | 2s | 256 MB | Judgeable |
| High Tide, Low TideGiven N distinct measurements taken alternately low, high, low, high..., with rising highs and falling lows, reconstruct the original order. | Easy3 | SortingGreedy+1 | No attempts yet | 1s | 512 MB | Judgeable |
| Password HackingGiven each password's probability of being correct, find the expected number of attempts when trying passwords in the order that minimizes it. | Easy3 | GreedySorting+2 | No attempts yet | 1s | 512 MB | Judgeable |
| County Fair EventsGiven N intervals, find the maximum number of non-overlapping intervals John can attend. | Easy3 | GreedySorting+1 | No attempts yet | 2s | 512 MB | Judgeable |
| 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%. | Easy3 | MathImplementation+1 | No attempts yet | 2s | 512 MB | Judgeable |
| 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. | Easy3 | SortingBrute force+1 | No attempts yet | 2s | 512 MB | Judgeable |
| 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. | Easy3 | ImplementationGeometry+2 | No attempts yet | 2s | 512 MB | Judgeable |
| 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. | Easy3 | ImplementationSorting+2 | No attempts yet | 2s | 512 MB | Judgeable |
| 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. | Easy3 | ArrayHash map+2 | No attempts yet | 2s | 512 MB | Judgeable |
| CipherSort a sequence of N integers by decreasing frequency, breaking ties by the order each value first appears in the input. | Easy3 | SortingHash map+1 | No attempts yet | 2s | 512 MB | Judgeable |
| 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. | Easy3 | SortingGreedy+2 | No attempts yet | 1s | 64 MB | Judgeable |
| Ä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. | Easy3 | ArraySorting+2 | No attempts yet | 1s | 256 MB | Judgeable |
| 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. | Easy3 | BacktrackingRecursion+2 | No attempts yet | 1s | 512 MB | Judgeable |
| N and M (6)Given N distinct natural numbers and M, print every ascending M-element subsequence in lexicographic order without repeats. | Easy3 | BacktrackingSorting+2 | No attempts yet | 1s | 512 MB | Judgeable |
| 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. | Easy3 | BacktrackingSorting+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Sorting numbers 5Read up to a million integers and print them in non-decreasing order, one per line. | Easy3 | SortingArray+1 | No attempts yet | 10s | 128 MB | Judgeable |
| 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. | Easy3 | SortingImplementation | No attempts yet | 2s | 512 MB | Judgeable |
| 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. | Easy3 | Hash mapSorting+1 | No attempts yet | 2s | 128 MB | Judgeable |
| CupidFilter N users by gender preference and distance limit, sort the matching names lexicographically, and print them or "No one yet". | Easy3 | SortingImplementation | No attempts yet | 1.004s | 512 MB | Judgeable |
| ConcertGiven up to one million first-round ticket numbers, find the smallest positive integer not among them. | Easy3 | SortingImplementation | No attempts yet | 1s | 512 MB | Judgeable |
| Grouping Identical WordsCount words that are permutations of each other using letter counts, and print the number of distinct letter multisets. | Easy3 | SortingHash map+1 | No attempts yet | 2s | 512 MB | Judgeable |
| 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. | Easy3 | ImplementationSorting | No attempts yet | 2s | 512 MB | Judgeable |
| 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. | Easy3 | GreedySorting+2 | No attempts yet | 1s | 512 MB | Judgeable |
| 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. | Easy3 | SortingBinary search+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Keyboard EventGiven key presses with keyboard number, time, and character, print the characters ordered by time, breaking ties by keyboard number. | Easy3 | SortingImplementation+1 | No attempts yet | 1s | 256 MB | Judgeable |
| You Have To Solve This One!Sort the array, then answer range-sum queries over the sorted sequence efficiently. | Easy3 | SortingPrefix sum+1 | No attempts yet | 1s | 512 MB | Judgeable |
| 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. | Easy3 | GreedySorting+2 | No attempts yet | 1s | 512 MB | Judgeable |
| 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. | Easy3 | ArraySorting+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Price EvaluationGiven property prices and a list of m property names where some entries are unknown, find the minimum and maximum possible total price. | Easy3 | ImplementationGreedy+2 | No attempts yet | 2s | 512 MB | Judgeable |
| 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. | Easy3 | MathSorting+2 | No attempts yet | 2s | 512 MB | Judgeable |
| 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. | Easy3 | SortingMath+1 | No attempts yet | 1s | 1024 MB | Judgeable |
| Livestock LineupGiven at most 7 'must be milked beside' constraints among 8 cows, output the alphabetically first permutation satisfying all of them. | Easy3 | Brute forceBacktracking+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Duplicate FilesGiven file names and unique IDs, keep the smallest ID for each distinct name and print the surviving IDs in increasing order. | Easy3 | Hash mapSorting+1 | No attempts yet | 2s | 512 MB | Judgeable |
| 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. | Easy3 | Binary searchArray+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| SortingGiven a list of question difficulties, determine the minimum number of adjacent swaps needed to sort them into increasing order. | Easy3 | SortingGreedy+1 | No attempts yet | 1s | 512 MB | Judgeable |
| 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. | Easy3 | GreedySorting+2 | No attempts yet | 0.5s | 512 MB | Judgeable |
| Advertising on the FenceGiven n intervals over boards 1 to m, decide whether their union covers every board from 1 to m. | Easy3 | IntervalsSorting+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Restoring the SequenceGiven n, m, and m board values, decide whether they are 1..n with exactly one number erased, and print that number. | Easy3 | ImplementationMath+2 | No attempts yet | 1s | 512 MB | Judgeable |
| 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. | Medium4 | SortingMath+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Make a PalindromeRearrange the letters of a given uppercase string into the lexicographically smallest palindrome, or report it is impossible. | Medium4 | StringGreedy+1 | No attempts yet | 2s | 128 MB | Judgeable |
| 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. | Medium4 | SortingGreedy+1 | No attempts yet | 2s | 128 MB | Judgeable |
| 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. | Medium4 | GreedySorting+1 | No attempts yet | 2s | 128 MB | Judgeable |
| 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. | Medium4 | SimulationSorting+2 | No attempts yet | 2s | 128 MB | Judgeable |