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,729 problems
TitleLevelTopicsSolvedTime limitMemory limitJudge
Average and MedianRead five natural numbers and print their average and median.Easy1SortingArray+1No attempts yet1s128 MBJudgeable
Sort NumbersRead N integers and print them sorted in ascending order, one per line.Easy1SortingNo attempts yet1s128 MBJudgeable
Sorting Three NumbersRead three distinct integers and print them sorted from smallest to largest.Easy1SortingNo attempts yet1s128 MBJudgeable
ABCSort three distinct numbers into A, B, C and print them in an order given by a 3-letter permutation string.Easy1SortingImplementationNo attempts yet1s128 MBJudgeable
Triangle and Its Three SidesRead triples of positive integers until 0 0 0, and for each print Equilateral, Isosceles, Scalene, or Invalid based on equal sides and the triangle inequality.Easy1ImplementationMath+1No attempts yet1s128 MBJudgeable
Score TallyDrop the highest and lowest of five judge scores, print KIN when the remaining three span 4 or more, else print their sum.Easy1SortingImplementationNo attempts yet1s128 MBJudgeable
Right TriangleGiven three side lengths per test case in any order, decide whether they form a right triangle.Easy1MathSortingNo attempts yet1s128 MBJudgeable
Three NumbersPrint the median of three given integers between 1 and 100.Easy1SortingNo attempts yet1s256 MBJudgeable
Extreme SortCheck whether the given numbers are in non-decreasing order and print yes or no.Easy1ArraySortingNo attempts yet1s256 MBJudgeable
Choosing subjectsPick the three highest scores among the four science subjects and the higher of history and geography, then print their sum.Easy1GreedySortingNo attempts yet2s512 MBJudgeable
A debugging life that starts with std::sortPrint N = 2 and the two points (1, 0) and (0, 1), a fixed counterexample for a broken comparator in std::sort.Easy1ImplementationSorting+2No attempts yet2s512 MBJudgeable
Passionate SortingRead N numbers and print them in ascending order separated by spaces.Easy1SortingImplementationNo attempts yet1s512 MBJudgeable
ExamRead three scores and print the sum of the two largest.Easy1ArrayImplementation+1No attempts yet2s512 MBJudgeable
Word SortingDeduplicate a list of words and sort them first by length, then lexicographically.Easy2SortingStringNo attempts yet2s256 MBJudgeable
Sort Digits DescendingRearrange the digits of a given natural number so they appear in descending order and print the result.Easy2SortingString+1No attempts yet2s128 MBJudgeable
Dobby's Case-Insensitive Word TestFor each test case, output the original-cased word that is smallest in dictionary order when comparisons ignore letter case.Easy2StringSorting+1No attempts yet1s128 MBJudgeable
Third Largest NumberFor each test case of 10 positive integers, output the third largest distinct-position value in the array.Easy2SortingArrayNo attempts yet1s32 MBJudgeable
Sort Numbers 2Read up to one million distinct integers and print them in ascending order.Easy2SortingImplementationNo attempts yet2s256 MBJudgeable
Score CalculationGiven 8 distinct problem scores, output the sum of the top 5 and their original indices in increasing order.Easy2SortingArray+1No attempts yet1s128 MBJudgeable
Sorting Wooden PiecesSimulate repeated bubble-sort passes on five labeled pieces, printing the arrangement after every swap until sorted.Easy2SimulationSorting+1No attempts yet1s128 MBJudgeable
Equal-Size Interval ClusteringSort points lexicographically, split them into K consecutive groups of nearly equal size, and print each group's coordinate average.Easy2SortingArray+1No attempts yet5s128 MBJudgeable
Right TriangleRead triples of side lengths until 0 0 0, and print right if the squares of the two shorter sides sum to the square of the longest, else wrong.Easy2MathImplementation+2No attempts yet1s128 MBJudgeable
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
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
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
ContestGiven 20 scores, split into two groups of 10, output each group's sum of its top 3 scores.Easy2SortingImplementationNo 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
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
Scavenger HuntList every pair (x, y) where x divides P and y divides Q, sorted by x then y.Easy2MathBrute force+1No attempts yet1s128 MBJudgeable
StatisticsRead N integers, print their mean and median rounded to six decimal places.Easy2ArraySorting+2No attempts yet1s128 MBJudgeable
Time on TaskGiven a time limit and chore durations, find the largest number of chores that can be completed in any order.Easy2GreedySortingNo attempts yet1s128 MBJudgeable
Computer PurchaseGiven n computers with RAM, CPU speed, and disk values, sort by the score 2R + 3S + D and print the top two names, breaking ties by smaller name.Easy2SortingImplementationNo attempts yet2s512 MBJudgeable
Who is in the middle?Given the weights of three bowls, print the middle value among the three weights.Easy2SortingImplementationNo attempts yet1s128 MBJudgeable
Anagram CheckerDecide whether two phrases are anagrams, ignoring spaces and letters only.Easy2Hash mapString+1No attempts yet1s128 MBJudgeable
AnagramsGiven two lowercase words, decide whether one can be rearranged into the other, and print the result with the words.Easy2StringHash map+1No attempts yet1s128 MBJudgeable
NumbersGiven three distinct digits and one of their six permutations, find that number's 1-based rank when all six permutations are sorted ascending.Easy2MathSorting+2No attempts yet1s1024 MBJudgeable
Right Triangle CheckFor each of n triples of side lengths, decide whether the triangle is right by checking if the largest side squared equals the sum of the other two squared.Easy2MathGeometry+2No attempts yet1s128 MBJudgeable
MP3 SongsRead several lists of tune names and print each list sorted alphabetically while ignoring case and keeping input order for ties.Easy2SortingString+1No attempts yet1s128 MBJudgeable
AAAAHH! Overbooked!Given N event time ranges in hh:mm-hh:mm format, check whether any two events overlap in time.Easy2IntervalsSortingNo attempts yet1s128 MBJudgeable
Closing the CircuitShift every given upper pair forward by one position modulo n and print the sorted lower pairs after TAK.Easy2ImplementationSorting+1No attempts yet3s128 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
ClockFind the time with the median clock-hand angle among five given times, breaking angle ties by earlier time.Easy2MathSorting+1No attempts yet1s128 MBJudgeable
The Friend of My Enemy Is My EnemyPrint the direct friends of suspect s in increasing order for each network.Easy2GraphSortingNo attempts yet1s128 MBJudgeable
Length and Frequency of SentencesCount the words in each of N sentences and report how often each length occurs in ascending order.Easy2StringHash map+1No attempts yet1s128 MBJudgeable
Divide the land into trianglesSort all pegs by x then y, split the order into consecutive triples, and print each triple's input numbers in increasing order.Easy2SortingNo attempts yet1s16 MBJudgeable
Distribution in MetagoniaRepeatedly peel off 2^a times the largest power of 3 fitting the odd part of the remainder until it hits zero, then print the pieces sorted.Easy2SimulationMath+1No attempts yet2s256 MBJudgeable
A Towering ProblemSplit six distinct box heights into two triples matching the two given tower heights and print each triple in decreasing order.Easy2Brute forceSortingNo attempts yet1s256 MBJudgeable
Moist's Card SortingCount the cards a robot moves while it insertion sorts each deck of names into lexicographic order.Easy2SimulationSortingNo attempts yet5s512 MBJudgeable
Second Cheapest PresentGiven a list of distinct prices, print the second cheapest one, formatted with two decimal places.Easy2SortingImplementationNo attempts yet2s512 MBJudgeable
Country Leader (Small)For each test case, find the name with the most distinct letters, breaking ties by ASCII alphabetical order, and print it.Easy2StringImplementation+2No attempts yet5s512 MBJudgeable
Country LeaderFor each test case, pick the name with the most distinct letters, breaking ties by lexicographic order where a space sorts before any letter.Easy2StringSorting+2No attempts yet5s512 MBJudgeable
2017 Ajou University Programming Contest (Small)Given up to three contestants' scores, submission counts, and last scoring upload times, output the number of the top-ranked contestant by the tie-break rules.Easy2SortingImplementationNo attempts yet1s512 MBJudgeable
2017 Ajou Programming Contest (Large)Given each contestant's score, submission count, and last scoring upload time, print the number of the first-place contestant.Easy2SortingNo attempts yet1s512 MBJudgeable
Stacking CupsRead each cup's message, recover its radius from either token order, then print colors from smallest to largest cup.Easy2SortingImplementationNo attempts yet1s512 MBJudgeable
Qualifiers for the Next PhaseGiven N scores and a minimum cutoff rank K, count how many competitors advance when ties at the K-th score also qualify.Easy2SortingArray+1No attempts yet1s1024 MBJudgeable
What Is Your HandleSort N distinct handles by ASCII dictionary order and print the I-th one.Easy2SortingString+1No attempts yet1s512 MBJudgeable
Buying SnacksGiven price and weight for three snacks, print the name of the one whose 10-bag weight per discounted price is highest.Easy2ImplementationMath+2No attempts yet1s1024 MBJudgeable
BagsGiven n waste pieces with identifiers, find the minimum number of bags so that each bag holds pieces of only one identifier.Easy2Hash mapImplementation+2No attempts yet1s512 MBJudgeable
What Is My Grade?Given 50 distinct scores sorted in descending order and Hongik's score, print the letter grade matching his rank using the fixed cutoffs.Easy2ArrayImplementation+2No attempts yet1s256 MBJudgeable
This Problem’s a Slam DunkGiven the heights of five players on each of two teams, count how many State U players are taller than the opponent they guard after sorting both teams by height.Easy2SortingArray+1No attempts yet1s512 MBJudgeable
MergeMerge two sorted sequences into one sorted sequence using the given tie-breaking rule, which takes from A when the front elements are equal.Easy2Two pointersImplementation+2No attempts yet2s512 MBJudgeable
A Problem for Testing a New Regrade MethodRead two integers A and B, print their sum, then read N numbers and print them sorted in ascending order.Easy2SortingImplementationNo attempts yet5s512 MBJudgeable
TreasureGiven two arrays A and B, rearrange A (B stays fixed) to minimize the sum of elementwise products, using the sorted pairing strategy.Easy3GreedySorting+1No attempts yet2s128 MBJudgeable
Symmetric DifferenceGiven two sets of natural numbers, compute the size of their symmetric difference.Easy3Hash mapArray+1No attempts yet2s256 MBJudgeable
BestsellerGiven N book titles sold in a day, find the most frequent title, breaking ties by lexicographically smallest.Easy3Hash mapSorting+1No attempts yet2s128 MBJudgeable
Serial NumbersSort serial numbers by length, then digit-sum, then a custom lexicographic rule where digits precede letters.Easy3SortingString+1No attempts yet2s128 MBJudgeable
Repairing Pipe LeaksGiven leak positions and a fixed tape length, compute the minimum number of length-L tapes needed so each leak is covered with at least 0.5 margin on both sides.Easy3GreedySorting+1No attempts yet2s128 MBJudgeable
Seongjun and ChocolateGiven chocolate and coffee doses with time-decaying effect radii, sum the positive radii (minimum 1) for each query time.Easy3SimulationBrute force+2No attempts yet1s128 MBJudgeable
Number Word SortSort integers from M to N by comparing their digits spelled out as English words rather than by numeric value, then print 10 per line.Easy3SortingString+1No attempts yet2s128 MBJudgeable
Common NamesGiven two lists of unique lowercase names, find and print the count and sorted list of names common to both.Easy3Hash mapSorting+1No attempts yet2s256 MBJudgeable
Set DifferenceGiven two sets of up to 500,000 natural numbers each, output the count and sorted list of elements present in A but not in B.Easy3Hash mapSorting+1No attempts yet2s256 MBJudgeable
Median FilterApply a 3x3 median filter over an image and count filtered pixels whose median value is at least a given threshold.Easy3MatrixSorting+1No attempts yet2s128 MBJudgeable
Finding NumbersGiven N integers and M queries, output for each query whether it exists in the array, requiring an efficient lookup method.Easy3Binary searchSorting+1No attempts yet1s128 MBJudgeable
Find Prime NumbersPrint all prime numbers between two given bounds M and N, one per line, using an efficient sieve up to 1,000,000.Easy3MathNumber theory+1No attempts yet2s256 MBJudgeable
Meeting Room SchedulingGiven N meetings with start and end times, select the maximum number of non-overlapping meetings using a classic greedy interval scheduling approach.Easy3GreedySorting+1No attempts yet2s128 MBJudgeable
Jumong's Armor MaterialsCount how many pairs of given numbers sum to a target value M, using each material at most once per pair.Easy3Two pointersArray+1No attempts yet2s128 MBJudgeable
StatisticsGiven N odd integers, compute and print the rounded mean, median, mode (second smallest if tied), and range.Easy3ArraySorting+1No attempts yet2s256 MBJudgeable
Drawing LinesGiven N line segments on a number line, compute the total length covered by at least one segment, merging overlaps.Easy3IntervalsSorting+1No attempts yet1s192 MBJudgeable
RopesChoose a subset of ropes so that each rope's capacity times the count of chosen ropes is maximized, to find the greatest liftable weight.Easy3SortingGreedyNo attempts yet2s192 MBJudgeable
AuctionGiven a sequence of bids, find the least-frequent price (lowest if tied) and output the name of the first bidder who offered that price.Easy3Hash mapImplementation+1No attempts yet2s128 MBJudgeable
Seven DwarfsGiven nine distinct heights, find seven that sum to exactly 100 and print them in ascending order.Easy3Brute forceArray+1No attempts yet2s128 MBJudgeable
Asian Informatics OlympiadSort students by descending score and pick the top three medalists while capping each country to at most two medals.Easy3SortingGreedy+1No attempts yet1s128 MBJudgeable
Representative Natural NumberFind the smallest integer minimizing the sum of absolute differences to a list of numbers, which is the lower median.Easy3SortingMath+1No attempts yet1s128 MBJudgeable
Two Representative Natural NumbersGiven up to 5,000,000 integers from 1 to 10,000, output the median (smallest if tie) and the rounded mean as representatives.Easy3MathSorting+1No attempts yet2s256 MBJudgeable
Paper CuttingGiven a rectangular sheet and a series of horizontal or vertical cuts along grid lines, compute the area of the largest resulting piece.Easy3SortingArray+1No attempts yet1s128 MBJudgeable
Memory MasterFor each queried integer, check whether it exists in a large set of stored integers and print 1 or 0 for up to a million queries per test case.Easy3Hash mapArray+1No attempts yet2s256 MBJudgeable
BlackjackGiven N card values and a target M, find the maximum sum of three distinct cards not exceeding M.Easy3Brute forceTwo pointers+1No attempts yet1s128 MBJudgeable
Math HomeworkExtract every maximal run of digits from up to 100 strings, strip leading zeros, and print all extracted numbers sorted nondecreasing.Easy3StringSorting+1No attempts yet1s128 MBJudgeable
Most Visited DomainsParse a list of URLs to extract each domain suffix and print the maximum visit count along with all domains that reach it, sorted alphabetically.Easy3StringHash map+1No attempts yet1s128 MBJudgeable
Journey with PigsGiven pig weights and per-village net price coefficients, assign pigs to villages one-to-one to maximize total revenue (sort and multiply greedily).Easy3GreedySorting+1No attempts yet2s64 MBJudgeable
Control PointsGiven sorted coordinates of control points, find the minimum number of length-1 half-open intervals needed to cover all points using a greedy sweep.Easy3GreedySorting+1No attempts yet1s128 MBJudgeable
Mowing the LawnDetermine if sorted mower path coordinates with a given strip width fully cover a 75x100 rectangle in both directions, across multiple test cases until a terminator line.Easy3SortingSimulation+1No attempts yet1s128 MBJudgeable
Memorable Phone NumbersNormalize each listed phone number to seven digits and report those appearing more than once, sorted, with their counts.Easy3StringHash map+2No attempts yet1s128 MBJudgeable
Conformity PrizeCanonicalize each frosh's five courses, count how many frosh share each set, then output the total over all sets with the maximum count.Easy3Hash mapSorting+2No attempts yet1s128 MBJudgeable
EcologyCount how many times each tree species line appears, then print each species in lexicographic order with its share of the total, rounded to four decimals.Easy3Hash mapString+1No attempts yet1s256 MBJudgeable
ForestsCount how many distinct nonempty sets of trees appear among the (person, tree) pairs; people who heard nothing are excluded.Easy3Hash mapSorting+2No attempts yet1s128 MBJudgeable
Zipf's LawFor each test case, count the words in a book body and print the words that appear exactly n times, in lowercase alphabetical order.Easy3Hash mapString+2No attempts yet1s128 MBJudgeable
Request for ProposalGiven a set of requirements, score each proposal by how many requirements it meets, then pick the best one by compliance and price.Easy3Hash mapString+2No attempts yet1s128 MBJudgeable
Rout 66Simulate an invader whose strength drops after each stronghold it breaks, processing strongholds nearest first, and report whether all fall.Easy3SimulationSorting+1No attempts yet1s128 MBJudgeable
Symmetric OrderGiven a list of names sorted by length, rearrange them so shorter names sit at the top and bottom and longer ones in the middle, pairing names from the start.Easy3ArrayImplementation+2No attempts yet1s128 MBJudgeable