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,020 problems
TitleLevelTopicsSolvedTime limitMemory limitJudge
HamzaFind the shortest prefix of the category list that contains every distinct category appearing in the whole list.Easy3Hash mapArrayNo attempts yet1s256 MBJudgeable
Number CardsCheck each of M query integers against a set of N owned cards and print 1 for a match and 0 otherwise.Easy3Hash mapBinary searchNo attempts yet2s256 MBJudgeable
Number Cards 2Count how many of N owned cards equal each of M query integers and print the counts in order.Easy3Hash mapNo attempts yet1s256 MBJudgeable
Heading to World FinalsRank all teams by solved problems, then penalty, and print the best team from each of the top K universities.Easy3SortingHash mapNo attempts yet1s128 MBJudgeable
Almost an AnagramGiven two lowercase words, order them by length then alphabetically and report whether they are identical, anagrams, almost anagrams, or unrelated.Easy3Hash mapStringNo attempts yet2s256 MBJudgeable
Abandon ShipProcess each damage report in order and print the recalibrate, invert, divert, or abandon ship order for its category.Easy3SimulationHash mapNo attempts yet1s256 MBJudgeable
PeragramsGiven a lowercase string, find the fewest letters to delete so the remaining letters can be rearranged into a palindrome.Easy3Hash mapStringNo 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
PinkThe program counts how many registered 44-letter chromosomes contain each ten-letter query as a contiguous block.Easy3Hash mapStringNo attempts yet1s256 MBJudgeable
Travel of AlphabetsCount all length-L walks on a letter grid and the distinct strings among them, discarding any word containing a, c, or m.Easy3BacktrackingDFS+1No attempts yet2s256 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
StrfryFor each pair of lowercase strings, decide whether the second is a rearrangement of the first.Easy3Hash mapStringNo 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
Cornell Party RetryCount distinct names across two guest lists to find the minimum party attendance.Easy3Hash mapNo attempts yet3s256 MBJudgeable
Olympic ParadeFind the ID that does not appear a multiple of K times among N given IDs.Easy3Hash mapNo 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
Card SetSplit S into 3-character card names, print GRESKA if any card repeats, otherwise print the missing count out of 13 for suits P, K, H and T.Easy3Hash mapStringNo attempts yet1s32 MBJudgeable
Morse CodeGiven a Morse table and a dictionary, match each gapless Morse code word to its dictionary word or report the first missing one.Easy3Hash mapStringNo attempts yet1s256 MBJudgeable
ACM Contest ScoringProcess the team's submission log in order and report the number of solved problems and the total penalty including 20 minutes per prior wrong attempt.Easy3SimulationHash mapNo attempts yet1s256 MBJudgeable
FootprintsCount distinct grid cells visited when walking L steps from the origin following N, S, E, and W commands.Easy3SimulationHash mapNo attempts yet2s256 MBJudgeable
ComplexityYou delete the fewest letters so at most two distinct letters remain.Easy3Hash mapGreedyNo attempts yet2s256 MBJudgeable
CardsCount the N card values and print the most frequent one, breaking ties by the smaller value.Easy3Hash mapSortingNo attempts yet1s256 MBJudgeable
Settlement OfficeReport each row or column sum in a grid holding x plus y, zeroing that row or column after each query.Easy3Hash mapMathNo attempts yet1s256 MBJudgeable
Mowing the FieldSimulate the grid walk and report the smallest time gap between two visits to the same cell, or -1 when no cell repeats.Easy3SimulationHash mapNo 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
Sort a scrambled itinerary (Small)Rebuild each shuffled set of flight tickets into the single chain where each arrival matches the next departure.Easy3Hash mapGraphNo attempts yet5s512 MBJudgeable
Sort a scrambled itinerary (Large)Rebuild the flight order by chaining tickets from the starting city that never appears as a destination.Easy3Hash mapNo attempts yet5s512 MBJudgeable
Sudoku Solution CheckerCheck whether each completed 9x9 grid has digits 1 to 9 exactly once in every row, column, and 3x3 box.Easy3MatrixHash mapNo attempts yet5s512 MBJudgeable
Sudoku Solution CheckerCheck whether each completed N-squared by N-squared grid has every row, column, and N by N block holding 1 to N-squared exactly once.Easy3MatrixHash map+1No attempts yet5s512 MBJudgeable
Speaking in Tongues (Small)Translate each Googlerese line back to English with the fixed substitution mapping derived from the given hints and example.Easy3Hash mapStringNo attempts yet5s512 MBJudgeable
Store CreditGiven a credit C and a list of item prices, find the two positions whose prices sum exactly to C and print them in increasing order.Easy3ArrayHash map+2No attempts yet5s512 MBJudgeable
Store Credit (Large)For each test case, find the two item positions whose prices sum to the credit C, and print the smaller position first.Easy3Hash mapArrayNo attempts yet5s512 MBJudgeable
T9 SpellingGiven messages, output the keypad press sequences that type them, inserting a space between consecutive presses on the same key.Easy3StringImplementation+2No attempts yet5s512 MBJudgeable
Secret CodeGiven a secret code with all distinct characters, score each same-length guess by counting exact position matches and characters present in the code but at a wrong position.Easy3Hash mapString+2No attempts yet2s512 MBJudgeable
Passport CheckingCount how many passport numbers on a check list appear in a list of stolen numbers, counting duplicates each time.Easy3Hash mapStringNo attempts yet1s64 MBJudgeable
Course registrationGiven a click log of student numbers and K seats, keep each student's last click, then print the first K distinct students in that order.Easy3QueueHash map+1No attempts yet1s256 MBJudgeable
Rhyming SlangGiven a word and lists of rhyming endings, decide for each phrase whether its last word shares a rhyming ending with the word.Easy3StringHash map+1No attempts yet2s512 MBJudgeable
Card TradeGiven two sorted card piles, find the largest N such that Alice and Beatriz can each give away N cards of distinct kinds that the other does not own.Easy3Two pointersArray+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
Hot Air BallooningEach trainee's flight record is an integer whose digits are the balloon types flown; count how many distinct sets of digits appear.Easy3Hash mapBit manipulation+2No 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
Ticket machine keyboardGiven destination names and a pressed prefix, mark on a 4x8 grid every letter that can immediately follow the prefix in some name.Easy3StringSimulation+2No attempts yet1s32 MBJudgeable
Array and OperationGiven an array and a fixed K, decide if adding K to elements any number of times can turn it into a permutation of 1 to N.Easy3GreedyHash map+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 1Given observations of which side of the road each of 10 cows stands on, count how many times a cow changes sides between consecutive observations of that cow.Easy3ArrayImplementation+2No 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
Sickly YeongjeongMap each symptom to its medicine name, then for every query list output the matching medicines in order or YOU DIED if any symptom is untreatable.Easy3Hash mapImplementation+2No attempts yet1s512 MBJudgeable
Happy NumberDecide whether repeatedly summing the squares of a number's decimal digits ever reaches 1.Easy3SimulationHash map+1No attempts yet0.2s512 MBJudgeable
Is Everybody Appy?Given each kid's ranked list of apps from oldest to youngest, assign each kid the highest-ranked app not already taken by an older kid.Easy3Hash mapGreedy+2No attempts yet2s512 MBJudgeable
FitnessSimulate moves around 8 circularly numbered stations and print the visited sequence, marking it reject if fewer than 5 distinct stations appear or any station repeats.Easy3SimulationImplementation+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
Poker Card CombinationsGiven six card ranks, count how often each rank appears and print which of the nine named poker combinations the hand forms.Easy3Hash mapImplementation+1No attempts yet1s512 MBJudgeable
Accepted ratioGiven a submission log, ignore the administrator, count solvers and the rejections each made before their first accepted submission, then print the accepted ratio with 10 decimals.Easy3ImplementationHash map+2No attempts yet2s512 MBJudgeable
IDN Homograph AttackGiven a string, decide whether some character can be swapped for a different character that normalizes to the same form.Easy3StringHash map+2No attempts yet1s256 MBJudgeable
Team Tic Tac ToeGiven a filled 3x3 board of letters, count single cows that own a full line and two-cow teams that together own a line with both letters present.Easy3Brute forceImplementation+2No 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
A Homogeneous CountryCount class label frequencies over up to 100,000 lines and compute 1 minus the sum of squared relative frequencies.Easy3Hash mapMathNo attempts yet1s256 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
Switches and LampsGiven N switches that each light some lamps and together cover every lamp, decide whether leaving out one switch still covers all lamps.Easy3ImplementationHash map+2No attempts yet2s512 MBJudgeable
I AM IRONMANSimulate N games: look up each opponent in a win/loss table, add W or subtract L (floored at 0), and report whether the score ever reaches G.Easy3SimulationImplementation+2No attempts yet1s256 MBJudgeable
Awkward PartyGiven a row of n language labels, find the smallest gap between two positions holding the same label, or n if all labels are distinct.Easy3ArrayHash map+1No attempts yet1s512 MBJudgeable
Strange Cipher CodeSplit a string into case-insensitive runs of equal letters, map each run to 1 if its length is at least K and 0 otherwise, and drop later runs whose letter already appeared.Easy3StringImplementation+2No attempts yet1s1024 MBJudgeable
Issuing PlatesFor each of M plates, decide whether any of N bad words appears as a substring after mapping leetspeak digits to letters.Easy3StringString matching+2No attempts yet1s512 MBJudgeable
BiodiversityGiven the species names of N animals, print the species that appears more times than all other species combined, or NONE.Easy3Hash mapImplementation+2No attempts yet3s512 MBJudgeable
SENTIRead L comments, each ending with a period, and count how many contain a word from a given positive list and how many contain one from a negative list.Easy3StringImplementation+1No attempts yet2s512 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
CoffeeFor each person, add the price of their ordered coffee size to a shared delivery fee of floor(100/P), then snap the total to a multiple of 5 only when it is 1 off.Easy3Hash mapImplementation+2No attempts yet1s512 MBJudgeable
Digit-Power SequenceFor each N from A to B, repeatedly sum the K-th powers of its digits, detect the eventual cycle, and sum the minimum value reached over all sequences.Medium4SimulationMath+1No attempts yet2s128 MBJudgeable
Infinite SequenceCompute the N-th term of a sequence where A_i equals A at floor(i/P) plus A at floor(i/Q), using memoized recursion for huge N.Medium4RecursionDynamic programming+2No attempts yet2s128 MBJudgeable
Similar WordsCount unordered pairs of equal-length words that are related by some bijection between letters, similar to the isomorphic-strings check.Medium4StringHash map+1No attempts yet2s128 MBJudgeable
English ReadingCount how many dictionary-word combinations match each scrambled sentence when each word's middle letters can be permuted freely.Medium4Hash mapString+2No attempts yet2s128 MBJudgeable
Glyph DecodingCount how many length-g substrings of S are letter-for-letter rearrangements of a given word W.Medium4Sliding windowString+1No attempts yet2s128 MBJudgeable
Center of SymmetryDecide whether a set of up to 10000 integer points has a center point such that every point's mirror image is also in the set.Medium4Hash mapGeometry+2No attempts yet1s128 MBJudgeable
Chemistry 101Parse a chemical equation with molecule multipliers and element counts, then report which elements differ in count between reagents and products.Medium4StringHash map+1No attempts yet1s128 MBJudgeable
Sum of Numbers 4Count the number of contiguous subarray sums of an array that equal a given target K, using prefix sums and a hash map.Medium4Prefix sumHash map+1No attempts yet2s128 MBJudgeable
Transaction Limit CheckingParse bank customer, account, and transaction records to validate ownership and per-day, per-type transaction and exposure limits, printing a result per instruction.Medium4Hash mapSimulation+1No attempts yet1s128 MBJudgeable
Symmetric DrawingGiven N marked points, decide if there is a vertical line x=c so that folding the plane along it maps the point set onto itself, and output that x-coordinate or NO.Medium4MathHash map+1No attempts yet2s128 MBJudgeable
Keyword MatchingGiven weighted keyword lists for pages and queries, compute matching scores and output up to 5 top-scoring pages per query.Medium4SortingHash map+1No attempts yet2s128 MBJudgeable
Polycube Surface AreaValidate that unit cubes placed in a given order always connect by a face to a prior cube starting at the origin, then output the polycube's surface area or the index of the first invalid cube.Medium4SimulationHash map+1No attempts yet1s128 MBJudgeable
Frequency SortSort a sequence of up to 1000 integers by descending frequency, breaking ties by the value's first appearance order in the input.Medium4Hash mapSorting+1No attempts yet1s128 MBJudgeable
CampfireSimulate campfire nights where Sunyoung's presence introduces a new song and other nights merge attendees' known songs, then output everyone who ends up knowing all songs.Medium4SimulationHash map+1No attempts yet1s128 MBJudgeable
Homo or Hetero?Maintain a list under insert and delete-first-occurrence operations and classify it after each step as homogeneous, heterogeneous, both, or neither.Medium4Hash mapImplementation+1No attempts yet3s256 MBJudgeable
DepositsCount pairs of deposits and requests where the deposit amount is divisible by the request length, using frequency counts and divisor enumeration up to 10^6.Medium4MathNumber theory+1No attempts yet3s256 MBJudgeable
Divisible Contiguous SubarraysCount contiguous subarrays whose sum is divisible by a given d, using prefix sums modulo d and counting equal remainders.Medium4Prefix sumHash map+1No attempts yet1s128 MBJudgeable
KCPCFrom a submission log, compute each team's best-per-problem total score, break ties by submission count then last submission time, and output a given team's rank.Medium4SimulationHash map+1No attempts yet1s128 MBJudgeable
Peer ReviewGiven each author's institution and their K assigned papers to review, count how many papers violate review-count, self-review, collaborator, or duplicate-review rules.Medium4Hash mapSimulation+1No attempts yet1s128 MBJudgeable
Society MembersGiven nested society membership definitions with possible society-name references, compute the total number of distinct human members in the first listed society.Medium4GraphDFS+1No attempts yet1s128 MBJudgeable
Pizza HawaiiFor each local ingredient and native ingredient, output the pair when the two words appear on exactly the same set of pizza names.Medium4Hash mapSorting+2No attempts yet1s128 MBJudgeable
Touchscreen KeyboardGiven a typed word and a list of same-length dictionary words, print each with its keyboard Manhattan distance, sorted by distance then lexicographically.Medium4StringSorting+2No attempts yet1s128 MBJudgeable
Course SchedulingGiven n course requests as (first name, last name, course) triples, count the distinct students per course and print courses in ASCII order.Medium4Hash mapSortingNo attempts yet1s128 MBJudgeable
Unique SnowflakesGiven a stream of integer snowflake ids, find the length of the longest contiguous block in which every value is distinct.Medium4Sliding windowHash map+2No attempts yet1s128 MBJudgeable
Rock-Paper-Scissors TournamentCount wins and losses for each player across all games, then print each player's win average w/(w+l) to three decimals, or - if the denominator is 0.Medium4SimulationImplementation+2No attempts yet1s256 MBJudgeable
Antiarithmetic?Given a permutation of 0 to n-1, decide whether any three positions contain values forming an arithmetic progression.Medium4Hash mapBrute force+1No attempts yet1s128 MBJudgeable