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
| Title | Level | Topics | Solved | Time limit | Memory limit | Judge |
|---|---|---|---|---|---|---|
| HamzaFind the shortest prefix of the category list that contains every distinct category appearing in the whole list. | Easy3 | Hash mapArray | No attempts yet | 1s | 256 MB | Judgeable |
| Number CardsCheck each of M query integers against a set of N owned cards and print 1 for a match and 0 otherwise. | Easy3 | Hash mapBinary search | No attempts yet | 2s | 256 MB | Judgeable |
| Number Cards 2Count how many of N owned cards equal each of M query integers and print the counts in order. | Easy3 | Hash map | No attempts yet | 1s | 256 MB | Judgeable |
| Heading to World FinalsRank all teams by solved problems, then penalty, and print the best team from each of the top K universities. | Easy3 | SortingHash map | No attempts yet | 1s | 128 MB | Judgeable |
| Almost an AnagramGiven two lowercase words, order them by length then alphabetically and report whether they are identical, anagrams, almost anagrams, or unrelated. | Easy3 | Hash mapString | No attempts yet | 2s | 256 MB | Judgeable |
| Abandon ShipProcess each damage report in order and print the recalibrate, invert, divert, or abandon ship order for its category. | Easy3 | SimulationHash map | No attempts yet | 1s | 256 MB | Judgeable |
| PeragramsGiven a lowercase string, find the fewest letters to delete so the remaining letters can be rearranged into a palindrome. | Easy3 | Hash mapString | 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 |
| PinkThe program counts how many registered 44-letter chromosomes contain each ten-letter query as a contiguous block. | Easy3 | Hash mapString | No attempts yet | 1s | 256 MB | Judgeable |
| 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. | Easy3 | BacktrackingDFS+1 | No attempts yet | 2s | 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 |
| StrfryFor each pair of lowercase strings, decide whether the second is a rearrangement of the first. | Easy3 | Hash mapString | 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 |
| Cornell Party RetryCount distinct names across two guest lists to find the minimum party attendance. | Easy3 | Hash map | No attempts yet | 3s | 256 MB | Judgeable |
| Olympic ParadeFind the ID that does not appear a multiple of K times among N given IDs. | Easy3 | Hash map | 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 |
| 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. | Easy3 | Hash mapString | No attempts yet | 1s | 32 MB | Judgeable |
| Morse CodeGiven a Morse table and a dictionary, match each gapless Morse code word to its dictionary word or report the first missing one. | Easy3 | Hash mapString | No attempts yet | 1s | 256 MB | Judgeable |
| 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. | Easy3 | SimulationHash map | No attempts yet | 1s | 256 MB | Judgeable |
| FootprintsCount distinct grid cells visited when walking L steps from the origin following N, S, E, and W commands. | Easy3 | SimulationHash map | No attempts yet | 2s | 256 MB | Judgeable |
| ComplexityYou delete the fewest letters so at most two distinct letters remain. | Easy3 | Hash mapGreedy | No attempts yet | 2s | 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 |
| Settlement OfficeReport each row or column sum in a grid holding x plus y, zeroing that row or column after each query. | Easy3 | Hash mapMath | No attempts yet | 1s | 256 MB | Judgeable |
| 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. | Easy3 | SimulationHash map | 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 |
| Sort a scrambled itinerary (Small)Rebuild each shuffled set of flight tickets into the single chain where each arrival matches the next departure. | Easy3 | Hash mapGraph | No attempts yet | 5s | 512 MB | Judgeable |
| Sort a scrambled itinerary (Large)Rebuild the flight order by chaining tickets from the starting city that never appears as a destination. | Easy3 | Hash map | No attempts yet | 5s | 512 MB | Judgeable |
| Sudoku Solution CheckerCheck whether each completed 9x9 grid has digits 1 to 9 exactly once in every row, column, and 3x3 box. | Easy3 | MatrixHash map | No attempts yet | 5s | 512 MB | Judgeable |
| 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. | Easy3 | MatrixHash map+1 | No attempts yet | 5s | 512 MB | Judgeable |
| Speaking in Tongues (Small)Translate each Googlerese line back to English with the fixed substitution mapping derived from the given hints and example. | Easy3 | Hash mapString | No attempts yet | 5s | 512 MB | Judgeable |
| 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. | Easy3 | ArrayHash map+2 | No attempts yet | 5s | 512 MB | Judgeable |
| 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. | Easy3 | Hash mapArray | No attempts yet | 5s | 512 MB | Judgeable |
| T9 SpellingGiven messages, output the keypad press sequences that type them, inserting a space between consecutive presses on the same key. | Easy3 | StringImplementation+2 | No attempts yet | 5s | 512 MB | Judgeable |
| 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. | Easy3 | Hash mapString+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Passport CheckingCount how many passport numbers on a check list appear in a list of stolen numbers, counting duplicates each time. | Easy3 | Hash mapString | No attempts yet | 1s | 64 MB | Judgeable |
| 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. | Easy3 | QueueHash map+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Rhyming SlangGiven a word and lists of rhyming endings, decide for each phrase whether its last word shares a rhyming ending with the word. | Easy3 | StringHash map+1 | No attempts yet | 2s | 512 MB | Judgeable |
| 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. | Easy3 | Two pointersArray+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 |
| 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. | Easy3 | Hash mapBit manipulation+2 | 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 |
| 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. | Easy3 | StringSimulation+2 | No attempts yet | 1s | 32 MB | Judgeable |
| 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. | Easy3 | GreedyHash map+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 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. | Easy3 | ArrayImplementation+2 | 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 |
| 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. | Easy3 | Hash mapImplementation+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Happy NumberDecide whether repeatedly summing the squares of a number's decimal digits ever reaches 1. | Easy3 | SimulationHash map+1 | No attempts yet | 0.2s | 512 MB | Judgeable |
| 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. | Easy3 | Hash mapGreedy+2 | No attempts yet | 2s | 512 MB | Judgeable |
| 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. | Easy3 | SimulationImplementation+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 |
| Poker Card CombinationsGiven six card ranks, count how often each rank appears and print which of the nine named poker combinations the hand forms. | Easy3 | Hash mapImplementation+1 | No attempts yet | 1s | 512 MB | Judgeable |
| 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. | Easy3 | ImplementationHash map+2 | No attempts yet | 2s | 512 MB | Judgeable |
| IDN Homograph AttackGiven a string, decide whether some character can be swapped for a different character that normalizes to the same form. | Easy3 | StringHash map+2 | No attempts yet | 1s | 256 MB | Judgeable |
| 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. | Easy3 | Brute forceImplementation+2 | 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 |
| A Homogeneous CountryCount class label frequencies over up to 100,000 lines and compute 1 minus the sum of squared relative frequencies. | Easy3 | Hash mapMath | No attempts yet | 1s | 256 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 |
| 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. | Easy3 | ImplementationHash map+2 | No attempts yet | 2s | 512 MB | Judgeable |
| 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. | Easy3 | SimulationImplementation+2 | No attempts yet | 1s | 256 MB | Judgeable |
| 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. | Easy3 | ArrayHash map+1 | No attempts yet | 1s | 512 MB | Judgeable |
| 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. | Easy3 | StringImplementation+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| Issuing PlatesFor each of M plates, decide whether any of N bad words appears as a substring after mapping leetspeak digits to letters. | Easy3 | StringString matching+2 | No attempts yet | 1s | 512 MB | Judgeable |
| BiodiversityGiven the species names of N animals, print the species that appears more times than all other species combined, or NONE. | Easy3 | Hash mapImplementation+2 | No attempts yet | 3s | 512 MB | Judgeable |
| 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. | Easy3 | StringImplementation+1 | No attempts yet | 2s | 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 |
| 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. | Easy3 | Hash mapImplementation+2 | No attempts yet | 1s | 512 MB | Judgeable |
| 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. | Medium4 | SimulationMath+1 | No attempts yet | 2s | 128 MB | Judgeable |
| 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. | Medium4 | RecursionDynamic programming+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Similar WordsCount unordered pairs of equal-length words that are related by some bijection between letters, similar to the isomorphic-strings check. | Medium4 | StringHash map+1 | No attempts yet | 2s | 128 MB | Judgeable |
| English ReadingCount how many dictionary-word combinations match each scrambled sentence when each word's middle letters can be permuted freely. | Medium4 | Hash mapString+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Glyph DecodingCount how many length-g substrings of S are letter-for-letter rearrangements of a given word W. | Medium4 | Sliding windowString+1 | No attempts yet | 2s | 128 MB | Judgeable |
| 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. | Medium4 | Hash mapGeometry+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Chemistry 101Parse a chemical equation with molecule multipliers and element counts, then report which elements differ in count between reagents and products. | Medium4 | StringHash map+1 | No attempts yet | 1s | 128 MB | Judgeable |
| 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. | Medium4 | Prefix sumHash map+1 | No attempts yet | 2s | 128 MB | Judgeable |
| 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. | Medium4 | Hash mapSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| 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. | Medium4 | MathHash map+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Keyword MatchingGiven weighted keyword lists for pages and queries, compute matching scores and output up to 5 top-scoring pages per query. | Medium4 | SortingHash map+1 | No attempts yet | 2s | 128 MB | Judgeable |
| 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. | Medium4 | SimulationHash map+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Frequency SortSort a sequence of up to 1000 integers by descending frequency, breaking ties by the value's first appearance order in the input. | Medium4 | Hash mapSorting+1 | No attempts yet | 1s | 128 MB | Judgeable |
| 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. | Medium4 | SimulationHash map+1 | No attempts yet | 1s | 128 MB | Judgeable |
| 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. | Medium4 | Hash mapImplementation+1 | No attempts yet | 3s | 256 MB | Judgeable |
| 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. | Medium4 | MathNumber theory+1 | No attempts yet | 3s | 256 MB | Judgeable |
| Divisible Contiguous SubarraysCount contiguous subarrays whose sum is divisible by a given d, using prefix sums modulo d and counting equal remainders. | Medium4 | Prefix sumHash map+1 | No attempts yet | 1s | 128 MB | Judgeable |
| 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. | Medium4 | SimulationHash map+1 | No attempts yet | 1s | 128 MB | Judgeable |
| 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. | Medium4 | Hash mapSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Society MembersGiven nested society membership definitions with possible society-name references, compute the total number of distinct human members in the first listed society. | Medium4 | GraphDFS+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Pizza HawaiiFor each local ingredient and native ingredient, output the pair when the two words appear on exactly the same set of pizza names. | Medium4 | Hash mapSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| 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. | Medium4 | StringSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Course SchedulingGiven n course requests as (first name, last name, course) triples, count the distinct students per course and print courses in ASCII order. | Medium4 | Hash mapSorting | No attempts yet | 1s | 128 MB | Judgeable |
| Unique SnowflakesGiven a stream of integer snowflake ids, find the length of the longest contiguous block in which every value is distinct. | Medium4 | Sliding windowHash map+2 | No attempts yet | 1s | 128 MB | Judgeable |
| 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. | Medium4 | SimulationImplementation+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Antiarithmetic?Given a permutation of 0 to n-1, decide whether any three positions contain values forming an arithmetic progression. | Medium4 | Hash mapBrute force+1 | No attempts yet | 1s | 128 MB | Judgeable |