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,994 problems
TitleLevelTopicsSolvedTime limitMemory limitJudge
Pattern Word BankingAdd the PIN digits picked by lowercase pattern letters and print non sequitur if the letter values do not match the PIN length.Easy2SimulationStringNo attempts yet2s256 MBJudgeable
Secret MessagePad each message with asterisks to a square, rotate the square 90 degrees clockwise, then read it row by row without asterisks.Easy2MatrixSimulationNo attempts yet2s256 MBJudgeable
Negative People in Da HouseGiven each test case's sequence of entries and exits, compute the smallest initial occupancy that keeps the count nonnegative throughout.Easy2Prefix sumSimulationNo attempts yet1s256 MBJudgeable
Toilet Seat PoliciesCount seat moves under leave-up, leave-down, and leave-as-preferred policies given the initial seat position and each person in order.Easy2SimulationNo attempts yet1s256 MBJudgeable
GraphsPrint the equation line and an 11-column asterisk grid showing the y axis, the x axis, and the line y = Ax + B for each test case.Easy2ImplementationSimulationNo attempts yet1s256 MBJudgeable
SolitaireSimulate token moves on cells 0 to N with a repeating six-roll generator and sum landed values until reaching N.Easy2SimulationNo attempts yet1s256 MBJudgeable
Orc PopulationGiven two consecutive yearly populations and c, print the population c years later where each year equals the sum of the two before it.Easy2ImplementationSimulationNo attempts yet1s256 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
Mountain BikingFor each segment top, starting from rest, accumulate slope acceleration to compute the arrival speed at the foot.Easy2MathSimulationNo attempts yet1s256 MBJudgeable
Hidden PasswordDecide if scanning the message and skipping letters outside the remaining password set reproduces the password in order.Easy2SimulationStringNo attempts yet1s256 MBJudgeable
D as in DaedalusGiven each round budget and the cards played, compute the extra points the first player could have won by playing the best card each round.Easy2SimulationNo attempts yet3s256 MBJudgeable
Magic TrickCount how many starting values from 1 to 100 turn negative or fractional when the given operations are applied in order.Easy2SimulationBrute forceNo attempts yet2s256 MBJudgeable
Easy ProblemsetSimulate judges proposing problems in turn and keep each proposal whose hardness reaches the running total until k problems are chosen.Easy2SimulationNo attempts yet1s256 MBJudgeable
Tiling recordGiven a floor tiled with 1 by n tiles labeled by number, list each tile as h or v in row-major order of its first cell.Easy2SimulationMatrix+1No attempts yet1s256 MBJudgeable
Donation PackagingTrack the stock of three relief sets day by day, ship every packable trio once at least 30 are ready, and print the shipped count or NO.Easy2SimulationMathNo attempts yet1s256 MBJudgeable
YODACompare two numbers digit by digit from the right and drop the smaller digit at each position, printing YODA for a number left with no digits.Easy2StringSimulationNo attempts yet1s64 MBJudgeable
Nothing but BallsGiven N pitches of balls, hit batters, and wild pitches, simulate the runners on base and count the runs scored.Easy2SimulationNo attempts yet1s64 MBJudgeable
Number tag exchangeSimulate M bubble passes over the line, swapping neighbors when the front tag has the larger remainder modulo the pass number.Easy2SimulationImplementationNo attempts yet2s512 MBJudgeable
Speed ViolationTwo speed profiles split the same 100 km road at different points, and you report the largest amount by which the driven speed exceeds the limit.Easy2Two pointersSimulationNo attempts yet2s512 MBJudgeable
Circular BarnChoose the entry room on a circular barn so cows walking clockwise to their assigned rooms cover the smallest total distance.Easy2Brute forceSimulationNo attempts yet2s512 MBJudgeable
Dance Around the Clock (Small)Simulate up to 10 rounds of alternating pairwise swaps around a circle of at most 10 dancers and report the two neighbors of dancer K.Easy2SimulationNo attempts yet5s512 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
Read Phone Number (Small)Split each digit string into the given group lengths and read each run of equal digits with count words such as double and triple.Easy2SimulationString+1No attempts yet5s512 MBJudgeable
Hedgemony (Small)Simulate a single left-to-right pass that trims each bush to the average of its current neighbors and output the final height of bush N-1.Easy2SimulationMathNo attempts yet5s512 MBJudgeable
Card Shuffle (Small)Simulate C segment-to-top cuts on a deck of M ordered cards and report the card at position W.Easy2SimulationArrayNo attempts yet5s512 MBJudgeable
T9 Spelling (Small)Map each letter of a short message to its keypad digit and repeat count, inserting a space between consecutive letters that share the same key.Easy2StringImplementation+2No attempts yet5s512 MBJudgeable
Changyong's ClockTrack a clock's time on a 24-hour dial, turning it forward or backward by c seconds and answering queries for the current time.Easy2SimulationMath+1No attempts yet1s512 MBJudgeable
Router 4Print the fixed two-layer router built from N inputs, r merge nodes, r split nodes, and N outputs, with M = 2N + r^2 connections.Easy2ImplementationSimulationNo attempts yet2s512 MBJudgeable
Chop CupTrack which of three cups hides the ball after a sequence of swaps given as letters A, B, and C.Easy2SimulationImplementationNo attempts yet2s512 MBJudgeable
Collatz SequenceStarting from n, repeatedly apply the Collatz rule (halve evens, 3n+1 for odds) and print every value from n down to 1 on one line.Easy2SimulationImplementation+1No attempts yet2s512 MBJudgeable
ChessboardPrint an N by M grid of asterisks and dots where the top left cell is an asterisk and adjacent cells always differ.Easy2ArrayImplementation+2No attempts yet2s512 MBJudgeable
Sub-primeGiven each bank's reserve and a list of debentures between banks, check whether every bank ends with a nonnegative balance after all debentures settle at once.Easy2ArrayImplementation+1No attempts yet2s512 MBJudgeable
HolesCount the holes in each of N lines of uppercase text, where B counts as two, A D O P Q R count as one, and the rest count as zero.Easy2StringImplementation+2No attempts yet2s512 MBJudgeable
VirusGiven a key and one line of ciphertext, undo a Caesar variant whose shift grows by one per letter and resets after 25.Easy2StringSimulation+1No attempts yet2s512 MBJudgeable
Alpha PuzzleAssign numbers 1 to 26 to letters by scanning the grid and numbering each letter at its first appearance.Easy2SimulationString+1No attempts yet2s512 MBJudgeable
Farm robot scarecrowCount how many times a robot moving clockwise or counter-clockwise around N stations visits a given station, starting at station 1.Easy2SimulationImplementationNo attempts yet2s512 MBJudgeable
Luhn AlgorithmGiven a sixteen-digit card number as a string, check whether it passes the Luhn checksum and print DA or NE.Easy2StringImplementation+2No attempts yet1s512 MBJudgeable
Counting Sheep (Large)For each N, find the first multiple of N that contains all ten digits, or report that no such multiple exists (only N = 0).Easy2MathSimulation+1No attempts yet5s512 MBJudgeable
MicrowaveGiven a start temperature below target, compute total heating time using per-degree rates for frozen and unfrozen states plus a fixed thawing time.Easy2MathImplementation+1No attempts yet2s512 MBJudgeable
Grid PatternFor each case, print a text grid with pipe, minus, and plus lines and asterisk-filled cells of size w by h.Easy2ImplementationSimulation+1No attempts yet10s512 MBJudgeable
Speed LimitFor each log entry, multiply the speed by the time since the previous entry, sum these products, and print the total distance in miles.Easy2ImplementationMath+1No attempts yet5s512 MBJudgeable
Outer Triangle SumFor each triangle, add the first and last value of every row plus all values of the last row, counting shared corners once, and print the total.Easy2ImplementationArray+2No attempts yet10s512 MBJudgeable
X X gluedFor each registration number, print every run of two or more identical digits in the four-digit group, in left-to-right order.Easy2StringImplementation+1No attempts yet2s512 MBJudgeable
We Lost Again TodayGiven the runs each team scored in all nine innings, decide whether the Ullim Geminis ever held a lead during a game they ended up losing.Easy2ImplementationSimulation+1No attempts yet1s64 MBJudgeable
EmpathyMultiply two binary numbers up to 30 bits long and print the product in binary without leading zeros.Easy2MathString+2No attempts yet2s256 MBJudgeable
Jeonbuk National UniversityPrint an ASCII symbol of width N when N is odd, following fixed spacing rules; print "I LOVE CBNU" when N is even.Easy2ImplementationSimulationNo attempts yet1s128 MBJudgeable
I am happy~Given the height N, width M, and a seat number K in row-major order, print the row and column of that seat.Easy2MathImplementation+2No attempts yet2s256 MBJudgeable
Paint EstimateFor each floor plan, compute the paintable wall and ceiling area minus window and door areas, multiply by the number of apartments, and round the total up by the coverage of one can.Easy2MathImplementation+2No attempts yet2s512 MBJudgeable
Advertising RevenueFor each data set, sum the payments for every display ad shown and every clickthrough ad clicked, then print the total.Easy2ImplementationSimulationNo attempts yet2s512 MBJudgeable
The 3n+1 SequenceStarting from the given first term, apply the 3n+1 rule until the value first hits 1 and report that position.Easy2SimulationMath+1No attempts yet1s512 MBJudgeable
Von Neumann and the FlyGiven train speed S, fly speed T, and initial gap D, compute how far the fly travels before the two trains collide.Easy2MathImplementation+2No attempts yet1s512 MBJudgeable
Arggggggh!Follow a start point and a series of compass moves to compute the final coordinates, rounded to 8 decimals.Easy2ImplementationMath+1No attempts yet2s512 MBJudgeable
Nine KnightsGiven a 5x5 board, check whether it has exactly nine knights with no two attacking each other.Easy2ImplementationSimulationNo attempts yet2s512 MBJudgeable
Batter UpRead n at-bat outcomes, sum the bases from official at-bats (0 to 4), divide by how many of them are not walks, and print the result to six decimals.Easy2ImplementationMath+2No attempts yet2s512 MBJudgeable
Latin SquaresRead an n by n grid of base-n digit characters and report whether it is a Latin square, and if so whether it is in reduced form.Easy2ImplementationArray+2No attempts yet1s512 MBJudgeable
Atomic MassParse a short chemical formula, look up each element's atomic mass, multiply by any following count, and print the total with two decimals.Easy2StringHash map+2No attempts yet1s512 MBJudgeable
Incomplete BookGiven the first book takes k days and each later book takes twice the previous, count how many books finish by day d.Easy2MathSimulation+1No attempts yet1s512 MBJudgeable
Analysis of Advanced AnalyticsGiven daily page counts and a fixed notebook size, count how many notebooks are needed when each day's notes must fit in one notebook without splitting.Easy2SimulationGreedy+1No attempts yet1s512 MBJudgeable
Grass CuttingAfter each week every cell grows 1 cm, then cells in the chosen rows and columns are reset to 1 cm; report the final heights of the 10x10 grid.Easy2SimulationImplementation+1No attempts yet1s512 MBJudgeable
Jousting TournamentPrint the fixed elimination schedule that pits competitors 1..n one by one, alternating winners between placeholders a and b.Easy2ImplementationSimulationNo attempts yet2s512 MBJudgeable
Kiwis vs KangaroosGiven a phrase, score each side by how often its letters appear in KANGAROO or KIWIBIRD, then report the higher score or a tie.Easy2ImplementationString+2No attempts yet2s512 MBJudgeable
Recently Used DocumentsSimulate a most-recently-used list of capacity k: each opened document moves to the front, new ones are inserted there and the back is dropped when full, then print the final list.Easy2SimulationImplementation+2No attempts yet1s512 MBJudgeable
Opening CeremonyFor each data set, count how many athletes from each country marched, then report the largest shortfall against that country's registered total.Easy2ArrayImplementation+1No attempts yet2s512 MBJudgeable
Santa's GiftsCompute the total straight-line distance from Santa's house through four given points in 3D and check it does not exceed the time limit X.Easy2MathGeometry+2No attempts yet5s512 MBJudgeable
Big number A+BRead two integers with up to 10000 digits and print their sum without leading zeros.Easy2StringMath+2No attempts yet1s256 MBJudgeable
Master of the Shell GameGiven a string, perform T swaps of characters at the given 0-indexed positions in order and print the final string.Easy2StringSimulation+1No attempts yet1s128 MBJudgeable
It Worked, So Why Is It Wrong?Compare the expected answer with Manyoung's output for each sample and system test case, then print Accepted, Wrong Answer, or Why Wrong!!! according to which group fails.Easy2ImplementationSimulation+2No attempts yet1s512 MBJudgeable
Mannequins on the Tracks!!Simulate a trolley moving through three zones under a sequence of wait and lever-pull actions, and count how many mannequins get run over in zone C.Easy2SimulationImplementationNo attempts yet2s512 MBJudgeable
LukaGiven Luka's fixed position and a walk of unit steps, list the indices of steps after which the walker stands on Luka's cell or one of the eight neighbors.Easy2ImplementationSimulationNo attempts yet1s512 MBJudgeable
Unraveling Monty HallCount how many of N trials hide the car behind door 2 or 3, since switching from door 1 wins exactly then.Easy2MathSimulation+1No attempts yet2s512 MBJudgeable
Run-Length Encoding, Run!Encode a string as run-length pairs, or decode run-length pairs back to the original string.Easy2StringSimulationNo attempts yet2s512 MBJudgeable
Mixing MilkSimulate 100 cyclic pours among three buckets, each pour moving as much milk as fits until the source empties or the target fills, and print the final amounts.Easy2SimulationImplementationNo attempts yet2s512 MBJudgeable
ElderTrack which wizard owns the Elder Wand after each duel and count how many distinct wizards ever held it.Easy2SimulationImplementation+1No attempts yet1s512 MBJudgeable
Magnet ChainGiven up to 5 magnets as a 1/2 sequence, decide whether the chain is fully connected after at most one magnet flip.Easy2ImplementationBrute force+2No attempts yet1s256 MBJudgeable
Physics HomeworkFor each test case, find the time at which car A, starting slower than car B and accelerating, reaches or passes car B's constant speed.Easy2MathImplementation+2No attempts yet1s256 MBJudgeable
Vending MachineGiven a sequence of vending machine button presses with fixed prices, subtract the total cost from 5000 won and print the change.Easy2ImplementationMath+1No attempts yet1s256 MBJudgeable
99 Bottles of BeerGiven N, print the full lyrics of the N Bottles of Beer song, with correct singular and plural wording.Easy2ImplementationString+2No attempts yet1s512 MBJudgeable
Bonus ScoreGiven a string of O and X for N problems, compute the total score where problem i gives i points plus a running bonus that grows on each O and resets on each X.Easy2ImplementationSimulation+1No attempts yet1s512 MBJudgeable
Missing NumbersGiven an increasing list of distinct numbers a child recited, print every integer from 1 up to the last recited number that is missing, or print "good job" if none are.Easy2ArrayImplementation+2No attempts yet1s1024 MBJudgeable
Simple Collatz SequenceSimulate the modified Collatz rule (halve even k, increment odd k) from n until reaching 1 and count the steps taken.Easy2SimulationImplementation+1No attempts yet1s512 MBJudgeable
Hanging Out on the TerraceTrack how many people are on a terrace with a limit L and count how many enter groups are turned away because they would exceed it.Easy2SimulationImplementationNo attempts yet1s512 MBJudgeable
Jazz EnthusiastAdd up the lengths of n songs, subtract the crossfade time once for each pair of adjacent songs, and print the total as hh:mm:ss.Easy2MathImplementation+1No attempts yet2s512 MBJudgeable
I'll Pay, No I'll PayPeople take turns adding to their outstretched amount; find who first reaches the threshold K and on which of their turns.Easy2SimulationImplementation+1No attempts yet2s512 MBJudgeable
TimeCount how many clock times from 00:00:00 through N:59:59 contain the digit K at least once.Easy2Brute forceImplementation+2No attempts yet1s256 MBJudgeable
Space PokerGiven fixed counts of red, green, and blue chips and two coefficients, pick which single chip color to add to maximize a quadratic payout formula.Easy2Brute forceMath+2No attempts yet2s512 MBJudgeable
Sum of a SequenceGiven N and a minimum length L, find the shortest run of consecutive non-negative integers summing to N, or print -1 if none exists within length 100.Easy3MathBrute force+1No attempts yet2s128 MBJudgeable
Tournament Meeting RoundSimulate a single-elimination tournament where positions are halved each round to find when two specific players first face each other.Easy3SimulationMath+1No attempts yet1s512 MBJudgeable
KingMove a king on an 8x8 board by given commands; if it lands on the stone, the stone slides one square the same way unless it would leave the board.Easy3SimulationImplementationNo attempts yet2s128 MBJudgeable
Addition CycleSimulate a digit-transformation cycle on a two-digit number until it returns to the original value and count the steps.Easy3SimulationMathNo attempts yet2s128 MBJudgeable
Josephus PermutationSimulate the Josephus elimination order for N people counting off every K-th person in a circle and print the removal sequence.Easy3QueueSimulation+1No attempts yet2s256 MBJudgeable
Dice SumGiven three dice with sizes S1, S2, S3, find the sum value that occurs most often among all possible triples, choosing the smallest if tied.Easy3Brute forceMath+1No attempts yet2s128 MBJudgeable
Switches On and OffSimulate switch toggles where male students flip every multiple of their number and female students flip the largest symmetric interval centered on their number.Easy3SimulationArray+2No attempts yet2s128 MBJudgeable
Binary AdditionAdd two binary strings up to 80 digits long and print the sum in binary without leading zeros.Easy3StringMath+1No attempts yet2s128 MBJudgeable
Alphabet DiamondGiven a repeating diamond-pattern tile defined by N, print the characters inside a specified rectangular region of the infinite tiled plane.Easy3SimulationMath+1No attempts yet2s128 MBJudgeable
Shortcut Key AssignmentAssign each menu option an unused shortcut letter by checking word-initial letters first, then any letter in the string, following the options in order.Easy3SimulationString+1No attempts yet2s128 MBJudgeable
Decimal DigitSimulate long division of A by B to output the N-th digit after the decimal point.Easy3SimulationMath+1No attempts yet2s128 MBJudgeable
Knight TourCheck whether a given sequence of 36 squares on a 6x6 board forms a valid closed knight's tour with legal moves between consecutive squares and back to the start.Easy3SimulationArray+1No attempts yet2s128 MBJudgeable
Missed CallSimulate an album of N songs with 5-second gaps and a phone ringing every D seconds to find the first ring Kangto can actually hear.Easy3SimulationImplementation+1No attempts yet2s128 MBJudgeable
Maze ConstructionSimulate a sequence of forward moves and turns on a grid, then print the smallest rectangular map marking visited cells as passable and the rest as walls.Easy3SimulationImplementation+1No attempts yet2s128 MBJudgeable
MessagesGiven sheets of names passed around a circle with P/N marks, find who wrote each hurtful (N) message and about whom.Easy3SimulationArray+2No attempts yet1s128 MBJudgeable