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,993 problems
TitleLevelTopicsSolvedTime limitMemory limitJudge
Print Stars - 5Print a centered pyramid of stars with N lines, where line i has 2i-1 stars padded with spaces.Easy1ImplementationSimulationNo attempts yet1s128 MBJudgeable
Star Printing - 13Given N, print a pyramid of stars that grows one star per line up to N then shrinks back down, using 2N-1 lines total.Easy1ImplementationSimulationNo attempts yet1s128 MBJudgeable
Oven ClockGiven a start time and a number of minutes to cook, compute and print the finishing time on a 24-hour clock.Easy1MathSimulationNo attempts yet1s128 MBJudgeable
Speed LimitGiven segments of constant speed with cumulative elapsed times, compute the total distance for each data set until n equals -1.Easy1ImplementationMath+1No attempts yet1s128 MBJudgeable
Spinner Lock SimulationGiven the starting digits of a spinner lock and a sequence of button labels, add each label's digits to the wheels modulo 10 and print the final readout.Easy1SimulationImplementation+2No attempts yet1s128 MBJudgeable
Sarah's ToysFor each night, subtract the toys left around the house from the total, then report how many pairs and whether one group of 3 is formed.Easy1MathImplementation+1No attempts yet1s128 MBJudgeable
Pair SumThis is a straightforward simulation task where numbers in each test case are used to enumerate pairs. For each input n, all pairs of distinct natural numbers with sum n are printed in lexicographic order. Because n is at most 12, iterating all possible a and b values directly works. Implemented with simple loops, this problem is a typical warm-up exercise.Easy1SimulationBrute force+1No attempts yet1s128 MBJudgeable
Match ResultsRead N rounds of scores for A and B, and report how many rounds each player won.Easy1ImplementationSimulationNo attempts yet1s256 MBJudgeable
TrianglesFor each size n read from input until 0, print a right triangle of stars with n rows, row i having i stars.Easy1ImplementationSimulationNo attempts yet1s128 MBJudgeable
WężykPrint the numbers 1 to n squared in n rows that alternate between left-to-right and right-to-left order.Easy1SimulationMatrixNo attempts yet1s128 MBJudgeable
StrollGiven a walk of N, S, E and W steps on a grid, compute the Manhattan distance from the endpoint back to the start.Easy1SimulationMathNo attempts yet2s128 MBJudgeable
Erasing a File for GoodDecide if the second bit string is the first with every bit flipped N times, so it must equal the first for even N and its complement for odd N.Easy1SimulationStringNo attempts yet1s128 MBJudgeable
PSU CampusesStarting and ending at Hatyai, sum the pairwise table distances along each given campus visit order.Easy1SimulationNo attempts yet1s128 MBJudgeable
Dice DuelBoth players start with 100 points, and in each round the player with the lower die loses points equal to the opponent's roll.Easy1SimulationNo attempts yet1s256 MBJudgeable
Heracles and the HydraStarting from h heads, each c adds one head and each b removes one, and you report the count left after all actions.Easy1SimulationNo attempts yet1s256 MBJudgeable
Reverse RotReverse each message, then shift every character forward by N places in the 28-symbol alphabet.Easy1StringSimulationNo attempts yet1s256 MBJudgeable
ServerCount how many jobs from the front finish in request order before their total duration exceeds T.Easy1Prefix sumSimulationNo attempts yet1s256 MBJudgeable
Vertical ReadingRead five given words column by column from top to bottom, skipping missing letters in shorter words, and print the letters in that order.Easy1SimulationArray+1No attempts yet1s256 MBJudgeable
Card GameCompare the ten cards of A and B round by round and print A or B for the side with more round wins, or D on a tie.Easy1ArraySimulationNo attempts yet1s256 MBJudgeable
Reversing Card SegmentsReverse ten given segments of a 20-card row that starts in order and print the final arrangement.Easy1ArraySimulationNo attempts yet1s256 MBJudgeable
Insert BallsFill N baskets by writing ball number k into baskets i through j for each operation, then print all baskets.Easy1ArraySimulationNo attempts yet1s256 MBJudgeable
Swap BallsSwap the balls in the given basket pairs M times and print the final ball in each of the N baskets.Easy1SimulationArrayNo attempts yet1s256 MBJudgeable
Logical Functions: AND and ORCheck each submitted weight and bias by testing all four binary inputs and report whether the neuron matches the requested AND or OR gate.Easy1SimulationImplementationNo attempts yet2s256 MBJudgeable
PersistenceCount how many times multiplying the decimal digits together reduces the given number to a single digit.Easy1SimulationImplementationNo attempts yet1s256 MBJudgeable
Is Dinic quartic?Print a fixed 4-vertex, 5-edge flow network with the exact edges and capacities given in the statement.Easy1GraphImplementation+1No attempts yet2s512 MBJudgeable
Java2016Given a target constant c, print 20 fixed macro definitions and then build one expression by appending a macro for each set bit of c.Easy1ImplementationSimulation+2No attempts yet2s512 MBJudgeable
The Y Bus Goes VroomSimulate the passenger count as a bus travels N stops with given boarding and alighting numbers, then print the driver's fixed name.Easy1SimulationImplementation+1No attempts yet2s256 MBJudgeable
FizzBuzzPrint the numbers 1 through N, writing Fizz for multiples of X, Buzz for multiples of Y, and FizzBuzz for multiples of both.Easy1ImplementationMath+2No attempts yet1s512 MBJudgeable
Linear Algebra and GroupOutput the sum of the digits appearing in the cover illustration of a specific linear algebra textbook.Easy1ImplementationMath+2No attempts yet1s256 MBJudgeable
RectangleImplement a Rectangle class with width and height, range-checked setters, and methods for area, perimeter, and square detection.Easy1ImplementationMath+2No attempts yet1s512 MBJudgeable
BingoPrint the fixed 5x5 bingo board showing which cells are colored, with # for colored and . for empty.Easy1ImplementationSimulationNo attempts yet0.999s511 MBJudgeable
What an Easy ProblemImplement a function that returns the move losing to Kyojun each round, given the move he announces before playing.Easy1ImplementationSimulationNo attempts yet1s512 MBJudgeable
A+B (MC)Build a Minecraft redstone circuit that reads two integers from a command interpreter and outputs their sum.Easy1SimulationImplementation+1No attempts yet1s512 MBJudgeable
White SquaresGiven an 8x8 board marked with pieces and empty cells, count how many pieces sit on the white squares of the standard alternating coloring.Easy2ArrayImplementation+1No attempts yet2s128 MBJudgeable
Mobile Phone BillGiven up to 20 call durations, compute total cost under two per-block billing plans and print the cheaper one with its cost.Easy2SimulationImplementation+1No attempts yet2s128 MBJudgeable
Easy Sequence SumGiven a sequence where each integer k repeats k times, compute the sum of terms between positions A and B.Easy2MathSimulation+1No attempts yet2s128 MBJudgeable
Actual Disk SpaceGiven N file sizes and a cluster size, compute total disk space used by rounding each file up to the nearest cluster multiple and summing.Easy2MathImplementation+1No attempts yet2s128 MBJudgeable
PetSimulate feeding and exercising a pet's weight across scenarios and report whether it ends happy, sad, or dead based on simple weight thresholds.Easy2SimulationImplementationNo attempts yet1s128 MBJudgeable
Floor DecorationCount the number of wooden planks by counting maximal runs of consecutive '-' in each row and '|' in each column of a grid.Easy2MatrixImplementation+1No attempts yet2s128 MBJudgeable
Song ScoresGiven cumulative durations of N song scores, answer Q queries asking which score is being sung at a given time using prefix sums and search.Easy2Prefix sumBinary search+1No attempts yet2s128 MBJudgeable
Organizing BooksSimulate packing books into boxes in order, sealing a box once the next book no longer fits, and sum the leftover capacity of every box.Easy2SimulationImplementation+1No attempts yet2s128 MBJudgeable
Internet Cafe Seat RequestsGiven a sequence of seat requests for 100 computers, count how many requests are rejected because the requested seat is already taken.Easy2SimulationArray+1No attempts yet2s128 MBJudgeable
BallTrack which of three cups covers a ball as cups swap positions M times, then output the cup number holding it.Easy2SimulationImplementationNo attempts yet2s128 MBJudgeable
Sequence TransformationRepeatedly replace a sequence with its adjacent differences K times and print the resulting shorter sequence.Easy2ArraySimulation+1No attempts yet2s128 MBJudgeable
Find Places to Lie DownCount maximal horizontal and vertical runs of at least two consecutive empty cells in an N x N grid.Easy2MatrixSimulationNo attempts yet2s128 MBJudgeable
Chicken CouponsGiven n chicken coupons and a stamp-to-coupon exchange rate k, compute the maximum chickens obtainable by repeatedly redeeming stamps for new coupons.Easy2MathSimulation+1No attempts yet2s128 MBJudgeable
Growth PointsSimulate a tree that multiplies its leaves by a yearly factor then subtracts pruned branches, and report the final leaf count.Easy2SimulationMathNo attempts yet1s128 MBJudgeable
Packing Books into BoxesGiven book weights in order and a per-box weight limit, compute the minimum number of boxes needed by greedily filling each box in sequence.Easy2GreedyArray+1No attempts yet2s128 MBJudgeable
Right-Aligned StarsPrint N lines of right-aligned stars, where line i has i stars padded with leading spaces to align the right edge.Easy2ImplementationSimulationNo attempts yet1s128 MBJudgeable
Star Printing - 6Print a centered triangle of stars whose width decreases by 2 each line from 2N-1 down to 1.Easy2ImplementationSimulationNo attempts yet1s128 MBJudgeable
Star Printing - 8Print a diamond-like star pattern of width 2N where side star counts rise from 1 to N then fall back to 1, with spaces filling the middle.Easy2ImplementationSimulationNo attempts yet1s128 MBJudgeable
Intelligent TrainSimulate passengers getting off and on at four stations and output the maximum train occupancy at any point.Easy2SimulationImplementationNo attempts yet1s128 MBJudgeable
Intelligent Train 2Given boarding and alighting counts at 10 stations, simulate the running passenger total and print its maximum value.Easy2SimulationArrayNo attempts yet1s128 MBJudgeable
Dice GameFor each player's three dice rolls, compute a prize using given rules and print the maximum prize among all players.Easy2SimulationImplementationNo attempts yet1s128 MBJudgeable
Score CalculationCompute a total score from a 0/1 sequence where consecutive correct answers score an increasing running count.Easy2ArraySimulation+1No attempts yet1s128 MBJudgeable
Card GameSimulate 10 rounds of card comparisons between two players, scoring points, and determine the overall winner using the most recent non-tied round as a tiebreaker.Easy2SimulationArrayNo attempts yet1s128 MBJudgeable
Binary AdditionAdd two binary strings up to length 80 for multiple test cases and print the sum without leading zeros.Easy2StringSimulation+1No attempts yet1s128 MBJudgeable
Maximum Value of a Fraction TableGiven a 2x2 grid of positive integers, find how many 90-degree clockwise rotations (0-3) maximize A/C+B/D, choosing the smallest such count on ties.Easy2Brute forceImplementation+1No attempts yet1s128 MBJudgeable
Climbing SnailCompute the number of days for a snail climbing A meters by day and sliding B meters by night to reach a pole of height V.Easy2MathSimulationNo attempts yet0.25s128 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
Answer Pattern GuessingGiven an answer string, count matches against three fixed repeating guess patterns and report the highest score and who achieved it.Easy2SimulationString+1No attempts yet1s128 MBJudgeable
ATM TransactionsProcess ATM withdrawal or deposit lines, updating balance but rejecting withdrawals that push it below -200, until a sentinel line ends input.Easy2SimulationImplementationNo attempts yet1s128 MBJudgeable
Changyeong Village Cup ShuffleTrack the position of a ball among three cups after a sequence of swap operations described by characters A, B, C.Easy2SimulationStringNo attempts yet1s128 MBJudgeable
ScannerExpand an R by C character grid by repeating each character ZR times vertically and ZC times horizontally, then print the result.Easy2SimulationImplementation+1No attempts yet1s128 MBJudgeable
Scaled ChessboardPrint a checkerboard of R by C cells where each cell is scaled to an A by B block of X or dot characters.Easy2SimulationImplementationNo attempts yet1s128 MBJudgeable
BUHAGiven up to 100 square bomb-range constraints on an A by B grid, count how many cells satisfy all the inside/outside conditions.Easy2ArraySimulation+1No attempts yet1s128 MBJudgeable
Vigenère Cipher EncryptionEncrypt repeated plaintext lines with a repeating key using a shifted Vigenère cipher until a line with 0 appears.Easy2StringSimulation+1No attempts yet1s128 MBJudgeable
ElectrificationGiven switch-to-lamp toggle mappings and a sequence of switch flips, compute and print the final on/off state of each lamp using parity counting.Easy2SimulationBit manipulationNo attempts yet2s256 MBJudgeable
Cutting a BlockGiven a box and n, print the coordinates of n equal slabs formed by evenly spaced cuts along the x-axis, each rounded to 8 decimals.Easy2MathSimulation+1No attempts yet2s64 MBJudgeable
MinesweeperGiven a grid of mines and empty cells, replace each empty cell with the count of mines in its eight neighbors.Easy2SimulationImplementation+2No attempts yet1s128 MBJudgeable
LogoTrack a turtle's position and heading through forward, backward, left, and right commands, then report the rounded distance from the start.Easy2SimulationGeometry+2No attempts yet1s128 MBJudgeable
Prerequisites?Given Freddie's chosen courses and category minimums, check whether each category has at least the required number of his courses.Easy2ImplementationHash map+2No attempts yet1s128 MBJudgeable
Combination LockGiven the dial position and three combination numbers, sum the degrees turned clockwise and counter-clockwise to open the lock.Easy2SimulationMath+1No attempts yet1s128 MBJudgeable
Rock Paper Scissors?Count each player's round wins in rock paper scissors across n rounds and print the player with more wins, or TIE.Easy2SimulationImplementationNo attempts yet1s128 MBJudgeable
Bubble Gum, Bubble Gum, in the Dish, How Many Pieces Do You Wish?Given a list of names arranged in a circle, a starting person, and a count n, find who is at position n in the count.Easy2ArraySimulation+1No attempts yet1s128 MBJudgeable
Number Card GameFor each starting number S, repeatedly replace it with the product of its digits until a single digit appears, printing every value in order.Easy2SimulationImplementation+2No attempts yet1s128 MBJudgeable
Rock, Paper, ScissorsGiven two equal-length strings of R, P, S moves, count the rounds each player wins.Easy2StringImplementation+1No attempts yet1s128 MBJudgeable
QuicksumCompute a weighted checksum for each input line: sum each character's 1-based position times its letter value, where spaces count as 0, until a line with only #.Easy2StringImplementation+2No attempts yet1s128 MBJudgeable
St. IvesFor each floating-point n until a terminating 0, print 1 + n + n^2 + n^3 + n^4 rounded to two decimals.Easy2MathImplementation+2No attempts yet1s128 MBJudgeable
Fifty Coats of GrayGiven room dimensions, opening sizes, and the area one can covers, compute the total paintable area for n apartments and round up to whole cans.Easy2MathImplementation+2No attempts yet1s128 MBJudgeable
Roaming RomansConvert each English-mile distance into Roman miles and paces using a fixed ratio, rounding the pace count to the nearest integer.Easy2MathImplementation+2No attempts yet1s128 MBJudgeable
The Twin ParadoxGiven Earth time and spaceship time, compute the ship's average speed as a fraction of light speed and print it to three decimals.Easy2MathImplementation+2No attempts yet1s128 MBJudgeable
Parlay WageringSimulate a sequence of parlay wagers: apply each money-line multiplier with truncation, skip ties, and format the final payout with commas.Easy2SimulationImplementation+1No attempts yet1s128 MBJudgeable
A Contesting DecisionGiven each team's submissions and solve times for four problems, compute solved count and penalty, then print the winner.Easy2ImplementationSimulationNo attempts yet1s128 MBJudgeable
General Chemistry LabGiven a sequence of temperatures ending with 999, print each temperature's difference from the previous one, rounded to two decimals.Easy2ImplementationMath+1No attempts yet1s128 MBJudgeable
Number Guessing GameFor each n0, report whether 3*n0 is odd or even and print n4, the quotient of (n2*3)/9.Easy2ImplementationMath+1No attempts yet1s128 MBJudgeable
SavingsFor each test case, print how many years of multiplying the balance by (1 + B/100) are needed until it first exceeds M.Easy2SimulationMath+2No attempts yet1s128 MBJudgeable
Jean and Joe's ClothesRead clothing sizes and count how many items go to Joe, Jean, Jane, James, or no one, per visit until N equals 0.Easy2ImplementationSimulation+2No attempts yet1s128 MBJudgeable
DVDsApply a series of clamped sale and restock transactions to each DVD title's stock and report the final count.Easy2ImplementationSimulation+2No attempts yet1s128 MBJudgeable
Oil ExplorationFor each column of a grid, scan downward and sum drilling costs (H costs 3, S costs 1) until the first oil cell, or print N if none exists.Easy2ArraySimulation+1No attempts yet1s128 MBJudgeable
Isn't It Funny How a Bear Likes Honey?Given Pooh's weight and the radii of several spherical helium balloons, decide whether their combined lift strictly exceeds his weight.Easy2MathImplementation+2No attempts yet1s128 MBJudgeable
Aerospace & Mechanical EngineeringGiven each stage's mass, burn time, and thrust, simulate the rocket's vertical motion and report its height when the last stage falls off.Easy2SimulationImplementation+1No attempts yet1s128 MBJudgeable
String TransformationsApply each letter-to-two-letters rule to the first occurrence of its letter in every word, updating the word after each rule.Easy2StringImplementation+1No attempts yet1s128 MBJudgeable
Counting Swann's CoinsPrint numbers 1 through N, replacing multiples of 3 with Dead, of 5 with Man, and of 15 with DeadMan, breaking the line after each word.Easy2ImplementationMath+1No attempts yet1s128 MBJudgeable
Fill the Rowboats!Print the numbers 1 through N, inserting the word Go! after every sixth number and after the last one.Easy2ImplementationSimulation+1No attempts yet1s128 MBJudgeable
Secret LocationEach of six lines encodes one number by its character count; print the first three as Latitude and the last three as Longitude in the given format.Easy2StringImplementation+2No attempts yet1s128 MBJudgeable
J-BoxPrint an N by N grid whose border cells are '#' and interior cells are 'J', with a blank line between test cases.Easy2ImplementationSimulationNo attempts yet1s128 MBJudgeable
Mars MathEvaluate a chain of at most three Mars operations (@, %, #) on a starting number and print the result to two decimals.Easy2SimulationImplementation+1No attempts yet1s128 MBJudgeable
Letter TrianglesFor each data set, print a triangle of N lines where line i repeats the ith letter in sequence, starting from a given letter and wrapping Z to A.Easy2ImplementationString+1No attempts yet1s128 MBJudgeable
Football TeamRead names one per line and swap every i with e and every I with E in each name.Easy2StringImplementation+1No attempts yet1s128 MBJudgeable