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
CDVIIPair each vehicle's enter records with the immediately following exit, charge per-kilometre tolls by start hour plus fees, and print sorted totals in dollars.Medium4SimulationSorting+2No attempts yet1s128 MBJudgeable
Crypt Kicker IIOne input line is the pangram 'the quick brown fox jumps over the lazy dog' encrypted by a letter substitution; find it, build the table, and decrypt every line.Medium4StringHash map+2No attempts yet1s128 MBJudgeable
Contest ScoreboardGiven judging queue entries, compute each contestant's solved count and penalty time, then print the standings in rank order.Medium4ImplementationSorting+2No attempts yet1s128 MBJudgeable
Poker HandsCompare two five-card poker hands and decide which ranks higher, handling all standard categories and tie-breaks.Medium4ImplementationSorting+1No attempts yet1s128 MBJudgeable
Relative RelativesGiven Ted's age of 100 and each descendant's father name plus the father's age at the child's birth, compute every descendant's age and list them oldest first, ties broken by name.Medium4TreeDFS+2No attempts yet1s128 MBJudgeable
DuLLGiven program sizes, DLL sizes, and a sequence of program start and exit events, find the peak memory use including loaded DLLs.Medium4SimulationBit manipulation+1No attempts yet1s128 MBJudgeable
Persistent BitsStarting from a seed S, repeatedly apply (A*X+B) mod C and report, for each of the 16 bit positions, whether it is always 1, always 0, or varies.Medium4Bit manipulationSimulation+1No attempts yet1s128 MBJudgeable
Electronic Document SecurityProcess a log of ACL +, -, = entries in order and print the final rights for each entity, merging entities with identical rights.Medium4ImplementationSimulation+2No attempts yet1s128 MBJudgeable
DNA TranslationFor each DNA strand, try all four readings (forward, reverse, complement, reverse complement), translate the first AUG to the first stop codon, and print the lexicographically greatest valid protein or a failure message.Medium4StringSimulation+2No attempts yet1s128 MBJudgeable
Letter Sequence AnalysisRead a text block to EOF and, for each sequence length 1 to 5, list the five most frequent letter sequences with alphabetized ties.Medium4StringHash map+2No attempts yet1s128 MBJudgeable
Balanced Budget InitiativeReconcile a checkbook register against a bank statement, flagging missing, repeated, mis-copied, and miscalculated entries.Medium4Hash mapSimulation+1No attempts yet1s128 MBJudgeable
User NamesGenerate unique lowercase user names from full names using fixed truncation and numeric suffix collision rules, printing each result.Medium4StringHash map+2No attempts yet3s256 MBJudgeable
Shortest PrefixesFor each word in a list, find the shortest prefix that matches only that word, counting an exact match as unique even if longer words share it.Medium4TrieString+2No attempts yet1s128 MBJudgeable
A Day at the RacesRead a season of Grand Prix results and print final standings for drivers and teams, breaking ties by countback and then lexicographically.Medium4SimulationSorting+2No attempts yet1s128 MBJudgeable
Pablo Squarson's HeadacheGiven how N unit squares are attached one by one to an existing square in one of four directions, compute the width and height of the resulting figure.Medium4SimulationArray+2No attempts yet1s128 MBJudgeable
Geologic StrataGiven a grid of sediment strata and fossils, assign each fossil the lowest adjacent stratum and check whether every fossil's period matches the target time.Medium4ImplementationMatrix+2No attempts yet1s128 MBJudgeable
Risk AssessmentScore each company from text by applying sentence modifiers to quality words and attributing words to the most recent company name.Medium4StringSimulation+1No attempts yet1s128 MBJudgeable
Who Is the Winner?Given a log of contest submissions with verdicts and times, compute each contestant's solved count and ICPC-style penalty score, then output them ranked.Medium4ImplementationSorting+2No attempts yet1s128 MBJudgeable
Stump SpeechGiven scored key phrases and a speech, sum each phrase's score times its number of occurrences in the speech.Medium4StringString matching+1No attempts yet1s128 MBJudgeable
Pythagorean TriplesGiven up to 50 distinct positive integers, list all Pythagorean triples x<y<z present in the set, sorted lexicographically, or report that none exist.Medium4Hash mapMath+2No attempts yet1s128 MBJudgeable
Breaking the Vigenère CipherFrom a ciphertext, collect all repeated 3-letter groups and their occurrence distances, then report every key length from 4 to 20 dividing at least 90% of those distances.Medium4StringHash map+2No attempts yet1s128 MBJudgeable
Most Frequent SquareGiven up to 30 integer grid points, count all axis-parallel squares formed by four of them and report the side length with the most squares, breaking ties by the largest length.Medium4Brute forceGeometry+2No attempts yet1s128 MBJudgeable
WeddingGiven a friendship graph among n classmates, count everyone within distance 2 of classmate 1.Medium4GraphBFS+2No attempts yet1s128 MBJudgeable
Product Order TotalsSum the order quantities for each distinct product name, then print each product with its total sorted by name length, then alphabetically.Medium4Hash mapSorting+2No attempts yet1s128 MBJudgeable
Soccer LeagueRead a list of soccer match results and output the league table sorted by points, then goal difference, then first appearance in the input.Medium4Hash mapSorting+2No attempts yet1s128 MBJudgeable
Book ClubGiven each of N cows' answers to NQ questions, count how many cows match all P given question-answer pairs simultaneously.Medium4Hash mapImplementation+2No attempts yet1s128 MBJudgeable
MasterMindGiven up to 100 guesses with exact and wrong-position counts, find the smallest four-digit secret consistent with all of them, or NONE.Medium4Brute forceImplementation+2No attempts yet1s128 MBJudgeable
DartsCount unordered triples of dart hits (single, double, treble regions, bulls, or misses) whose scores sum to a given turn score.Medium4Brute forceImplementation+2No attempts yet1s128 MBJudgeable
Going to Meet SinaGiven up to 10^4 blocked cells on a bounded grid, find the shortest 4-directional path from (0,0) to (X,Y) avoiding all puddles.Medium4BFSGraph+2No attempts yet1s128 MBJudgeable
L-I-N-G-OGiven a secret five-letter word and guesses, print one feedback line per guess using upper-case for exact matches, lower-case for misplaced letters, and periods otherwise.Medium4StringHash map+2No attempts yet1s128 MBJudgeable
Mutilated Morse Code CipherApply Ohaver's symmetric Morse cipher: encode each message to dot-dash with a length string, reverse the lengths, and decode back to text.Medium4StringHash map+2No attempts yet1s128 MBJudgeable
N-Credible MazesGiven a dimension n and a list of paths between adjacent lattice points, decide if start and end coordinates are connected.Medium4GraphDFS+2No attempts yet1s128 MBJudgeable
KeywordsGiven keyword profiles with a gap threshold and a list of titles, report for each profile the numbers of titles where some pair of its distinct keywords appears within the threshold.Medium4StringImplementation+2No attempts yet1s128 MBJudgeable
Pseudo-Random NumbersFor each quadruple (Z, I, M, L), follow the recurrence L = (Z*L + I) mod M and report how many distinct values appear before the sequence starts repeating.Medium4Hash mapSimulation+2No attempts yet1s128 MBJudgeable
Volleyball StatsParse volleyball play-by-play lines, track kills, errors, hits, blocks, and digs per player and team, and print formatted reports on demand.Medium4ImplementationSimulation+2No attempts yet1s128 MBJudgeable
Excuses, Excuses!Find the excuses containing the most keyword occurrences, where keywords match case-insensitively and only as whole words.Medium4StringHash map+2No attempts yet1s128 MBJudgeable
Message RoutingSimulate message routing through up to 10 MTAs whose tables use wildcards; report local delivery, routing loops, or unroutable messages.Medium4SimulationImplementation+2No attempts yet1s128 MBJudgeable
Making Random NumbersSimulate the middle-square method with four-digit numbers and count how many distinct values appear before the first repeat.Medium4SimulationHash map+2No attempts yet1s256 MBJudgeable
Bingo, Really?!Split the input into letter-only words, count distinct words per game ending at BULLSHIT, and print the running average as an irreducible fraction.Medium4StringHash map+2No attempts yet1s128 MBJudgeable
Etaoin ShrdluConcatenate each sample's lines, count overlapping adjacent character pairs, then print the five most frequent digrams with their counts and rounded relative frequencies.Medium4StringHash map+2No attempts yet1s128 MBJudgeable
The Happy WormCount maximal horizontal and vertical runs of empty cells that are at least 2 long in a field with stones.Medium4SortingImplementation+2No attempts yet1s128 MBJudgeable
Boring BusinessSimulate a drill moving on a grid from a given start and fixed pre-existing path; after each command report the position and flag if any visited lattice point was already part of the borehole.Medium4SimulationHash map+1No attempts yet2s512 MBJudgeable
Attack of the CipherTextsGiven one plaintext/ciphertext pair, invert the letter substitution to decrypt a second ciphertext, printing a period for undetermined characters.Medium4Hash mapString+1No attempts yet1s128 MBJudgeable
Common WordsFor each data set, count word frequencies, find the k-th most common words, and print them alphabetically after a title line.Medium4Hash mapSorting+2No attempts yet1s128 MBJudgeable
Recurring DecimalsFor each (a0, L), iterate the digit-rearrange-and-subtract map until a value repeats, then print the first repeated index j, the repeated value, and the cycle length.Medium4Hash mapSimulation+2No attempts yet1s128 MBJudgeable
Ancient CipherGiven two equal-length strings of capital letters, decide whether the first can be obtained from the second by a substitution cipher followed by a permutation.Medium4StringSorting+2No attempts yet2s128 MBJudgeable
Lock ManagerProcess lock requests in order, granting an S or X lock when it conflicts with no granted lock, denying it and blocking the transaction otherwise, and ignoring later requests from blocked transactions.Medium4Hash mapSimulation+2No attempts yet1s128 MBJudgeable
Scavenger HuntGiven S-1 ordered pairs of steps from a route of S steps, reconstruct the full sequence of steps in order.Medium4GraphHash map+1No attempts yet1s128 MBJudgeable
People in the CompanyGiven access-card records of enter and leave events, list the names of employees who are currently inside the office, sorted in reverse alphabetical order.Medium4Hash mapSorting+1No attempts yet1s256 MBJudgeable
Sultan's LandGiven P pillars on an N by N grid, count how many sets of four pillars form the corners of an axis-aligned rectangle.Medium4ArrayHash map+2No attempts yet1s128 MBJudgeable
Sales ReportGiven N sale records of item, salespoint, and quantity, print a table of totals with items as columns and salespoints as rows.Medium4SortingHash map+2No attempts yet4s128 MBJudgeable
ROT13Given a list of lowercase words, count ordered pairs (w1, w2) from the list where w2 equals the ROT13 encoding of w1.Medium4Hash mapString+2No attempts yet1s128 MBJudgeable
GardenCount the number of axis-aligned squares whose four corners are all points from a given set.Medium4Hash mapGeometry+1No attempts yet3s128 MBJudgeable
TrainCount the fewest round trips a train needs to drop its wagons from the back at their assigned cities in order.Medium4GreedyHash mapNo attempts yet1s512 MBJudgeable
Happy PrimesPrint every number up to n that is both prime and happy, where repeated digit-square sums reach 1, one per line in increasing order.Medium4Number theoryHash map+1No attempts yet1s256 MBJudgeable
Longest Balanced Sub-SequenceFind the length of the longest contiguous block with equal counts of positive and negative numbers.Medium4Prefix sumHash mapNo attempts yet1s128 MBJudgeable
uHuntProcess judge submissions in order and after each one report the leader's time and the submitter's rank by personal best, ignoring non-improving resubmissions.Medium4SortingHash map+1No attempts yet1s128 MBJudgeable
4SUMPick one number from each of four sets of up to 500 integers so the four numbers sum to zero.Medium4Hash mapNo attempts yet2s512 MBJudgeable
Triangles made from linesCount how many triples of the given lines form a triangle by removing triples that contain parallel lines.Medium4Hash mapCombinatorics+1No attempts yet1s128 MBJudgeable
SpectrumMaintain an undirected graph of named targets and answer per-query BFS hop histograms and pairwise hop distances.Medium4BFSGraph+1No attempts yet3s128 MBJudgeable
Colorful ChainCount the contiguous segments that hold exactly the required number of links of each listed color and no other colors.Medium4Sliding windowHash map+1No attempts yet3s512 MBJudgeable
Fib InverseGiven Fibonacci numbers, find each one's index, taking the larger index when two match.Medium4MathHash map+1No attempts yet1s512 MBJudgeable
Remainder Subarray CountCount contiguous intervals whose sum is divisible by M using prefix remainder frequencies.Medium4Prefix sumHash mapNo attempts yet1s256 MBJudgeable
Serves Me RightReplay logins, logouts, restarts, and session timeouts to count distinct users and the highest number logged in at once.Medium4SimulationHash map+1No attempts yet2s256 MBJudgeable
Popping BalloonsPop every balloon from left to right with the fewest rightward arrows that drop one unit after each hit.Medium4GreedyHash mapNo attempts yet2s256 MBJudgeable
RATS sequenceSimulate up to 60 RATS steps per data set and report the first creeper term, the first repeated term, or the last term.Medium4SimulationString+1No attempts yet1s256 MBJudgeable
Star trianglesFor each star taken as the right-angle vertex, multiply the counts of other stars sharing its column and its row, then add the products.Medium4Hash mapCombinatoricsNo attempts yet2s256 MBJudgeable
MultigramDecide whether the word splits into two or more equal anagram blocks and print the shortest such block, or -1.Medium4StringHash mapNo attempts yet1s64 MBJudgeable
Subsequences Summing to SevensFind the length of the longest contiguous group of cows whose IDs sum to a multiple of 7.Medium4Prefix sumHash mapNo attempts yet2s512 MBJudgeable
English and French (Small)Assign each unknown sentence to English or French so the number of words appearing in both languages is as small as possible.Medium4Brute forceBit manipulation+1No attempts yet5s512 MBJudgeable
Charging Chaos (Small)Find the fewest bit positions to flip so the outlet strings match the device strings after reordering.Medium4Brute forceBit manipulation+1No attempts yet5s512 MBJudgeable
Rational Number Tree (Small)Given the level-order listing of the rational number tree, find the n-th fraction and the position of a given fraction.Medium4TreeBFS+1No attempts yet5s512 MBJudgeable
Odd Man OutGiven an odd-length list where every number appears twice except one, find the number that appears once.Medium4Bit manipulationHash mapNo attempts yet5s512 MBJudgeable
Decision TreeParse a recursively defined decision tree, then for each animal walk the tree using its features and multiply node weights to get the probability.Medium4TreeRecursion+2No attempts yet5s512 MBJudgeable
Multi-base happiness (small)Find the smallest integer above 1 that reaches 1 under the digit-square-sum process in every base of each test case.Medium4SimulationHash map+1No attempts yet5s512 MBJudgeable
Ceiling FunctionInsert each prototype's values into a binary search tree in order, then count how many distinct tree shapes appear across the prototypes.Medium4TreeImplementation+1No attempts yet5s512 MBJudgeable
DNA PasswordCount the length-|P| substrings of a DNA string that contain at least the required number of each of A, C, G, and T.Medium4Sliding windowString+2No attempts yet2s512 MBJudgeable
Harps and TailsFlip any subset of columns of an H/T grid; find the maximum number of rows that can be made all-H.Medium4Hash mapGreedy+2No attempts yet2s512 MBJudgeable
Roman numeral conversionFor each of T inputs, convert a Roman numeral to its value in Arabic numerals or an Arabic numeral between 1 and 3999 to its Roman form.Medium4StringImplementation+2No attempts yet1s128 MBJudgeable
Evenly Spaced TriplesGiven N distinct positions on a line, count how many triples of points have the middle point exactly halfway between the other two.Medium4Hash mapArrayNo attempts yet1s256 MBJudgeable
SonnetsFor each poem, reduce every line to the vowel sequence after its last stressed syllable and label lines by first occurrence to build a rhyme scheme.Medium4StringHash map+2No attempts yet2s512 MBJudgeable
Galactic ConfederationGiven M planes and N planet positions, count how many planets fall in the most populated region formed by the planes.Medium4GeometryHash map+2No attempts yet2s512 MBJudgeable
Colored CubesCount how many distinct cube colorings appear in each test case, where two cubes match if some rotation makes all six face colors agree.Medium4ImplementationHash map+1No attempts yet2s512 MBJudgeable
Remove DuplicatesRead a space-separated list whose length is not given, keep each value only at its first occurrence, and print the surviving values in order.Medium4Hash mapArray+2No attempts yet5s8 MBJudgeable
Reading a ChordGiven a set of 3 to 5 tones, print every chord name (base chord plus optional tension) whose tone set equals the given set, in ASCII order.Medium4Hash mapMath+2No attempts yet8s512 MBJudgeable
Overwatch World CupOne seat in an N by N grid breaks the rule that every row and column holds each team once; find the seat and the correct shirt.Medium4ImplementationHash mapNo attempts yet2s512 MBJudgeable
Appearance AnalysisGiven a grid of brick separators and windows, count how many distinct window designs exist, where rotations by multiples of 90 degrees count as the same design.Medium4ImplementationMatrix+2No attempts yet1s512 MBJudgeable
Balls and NeedlesGiven K segments in 3D defined by endpoint triples, decide whether they form a closed cycle in space and whether their projections onto the xy-plane form a closed cycle.Medium4GraphUnion-find+2No attempts yet2s512 MBJudgeable
R9KRemove known nicknames and collapse whitespace in each message, then report whether the resulting text has appeared before.Medium4StringHash map+2No attempts yet2s512 MBJudgeable
TunnelGiven the entry order and exit order of N cars through a tunnel, count how many cars must have overtaken another car.Medium4ArrayHash map+2No attempts yet2s512 MBJudgeable
Rank and File (Small)Given all but one of the rows and columns of a valid grid, find the missing list of N heights in increasing order.Medium4Hash mapImplementationNo attempts yet5s512 MBJudgeable
OvertimeGiven timestamped enter and leave records, count overtime as unmatched leaves plus unmatched enters per name after pairing.Medium4Hash mapStack+2No attempts yet2s512 MBJudgeable
Bovine Genomics (Silver)Count triples of genome positions where no spotty cow and plain cow share the same three characters.Medium4Brute forceHash map+2No attempts yet2s512 MBJudgeable
The fastest road to BanikoaraGiven towns joined by undirected weighted roads, find the shortest travel distance between a named departure town and destination town.Medium4GraphShortest path+2No attempts yet2s512 MBJudgeable
Secret Chamber at Mount RushmoreGiven directed letter translations, decide for each pair of words whether every letter of the first can reach the matching letter of the second.Medium4GraphDFS+2No attempts yet1s512 MBJudgeable
Wookje's Dinner WheelGiven a sequence where each menu number appears exactly twice, find the maximum number of values seen once but not yet seen twice at any point.Medium4ArrayHash map+2No attempts yet2s256 MBJudgeable
Sum of all pairwise productsGiven n integers, compute the sum of x_a * x_b over all pairs with a < b.Medium4MathPrefix sum+2No attempts yet2s512 MBJudgeable
FAStarting from a huge integer x, repeatedly replace it with (first digit) times (digit count) and report whether the sequence eventually cycles forever.Medium4MathImplementation+2No attempts yet1s128 MBJudgeable
Go Northwest!Given N distinct points, find the probability that two independently drawn points lie on a 45-degree diagonal from each other.Medium4Hash mapMath+1No attempts yet2s512 MBJudgeable
Complete Naebbirac's sequenceGiven a multiset of values 1..K, find the single add, remove, or replace operation that makes every value appear equally often.Medium4ArrayHash map+1No attempts yet1s1024 MBJudgeable