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,798 problems
| Title | Level | Topics | Solved | Time limit | Memory limit | Judge |
|---|---|---|---|---|---|---|
| Walking RouteGiven N vectors forming a walking route, output the total displacement and the minimum distance from the start after removing exactly one segment. | Easy3 | ArrayMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| LukaSimulate a walker's path on a grid and output every time step when the walker is within Chebyshev distance 1 of a fixed point. | Easy3 | SimulationArray | No attempts yet | 1s | 128 MB | Judgeable |
| Sum of Two NumbersCount pairs of distinct integers in an array that sum exactly to a given value x. | Easy3 | Hash mapTwo pointers+1 | No attempts yet | 1s | 128 MB | Judgeable |
| DECODEBuild a substitution cipher table from a key word placed at a given offset, then decode a given ciphertext using it. | Easy3 | StringSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Whitespace King: Aligning ColumnsReformat text lines so that words in each column line up to a width equal to the longest word in that column, with single spaces separating columns. | Easy3 | StringImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Water Main BreakGiven several water main breaks with start, end, and flow rate, sum the gallons leaked during each second of a given query interval. | Easy3 | ArraySimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Building a Swimming PoolCompute the minimum cost to convert a grid into grass/hole cells, forcing the border to be grass and charging per boundary edge between grass and hole. | Easy3 | ArrayGreedy+1 | No attempts yet | 2.5s | 128 MB | Judgeable |
| Control PointsGiven sorted coordinates of control points, find the minimum number of length-1 half-open intervals needed to cover all points using a greedy sweep. | Easy3 | GreedySorting+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Gray AreaCompute weighted ink used by a histogram where each bar contributes its normalized height times a linearly decreasing darkness, plus a fixed constant. | Easy3 | ArraySimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Roll CakeGiven N interval requests over pieces 1..L, find the member with the largest requested length, then the member who actually receives the most pieces when earlier requests get priority. | Easy3 | SimulationArray+1 | No attempts yet | 1s | 128 MB | Judgeable |
| WindowsGiven windows in opening order, answer clicks by returning the most recently opened window covering each click point, or background if none does. | Easy3 | ArrayBrute force+2 | No attempts yet | 1s | 128 MB | Judgeable |
| LCRSimulate the dice game LCR turn by turn with the given rolls, then print the final chip counts for each player and the center. | Easy3 | SimulationImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| ProfitGiven a sequence of daily profits, find the maximum total over any non-empty stretch of consecutive days, across several test cases. | Easy3 | ArrayDynamic programming+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Subset SumGiven up to 20 bag sizes and a target n, pick each bag at most once to reach at least n with the smallest possible total. | Easy3 | Brute forceBit manipulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Exact ChangeGiven a price and a multiset of up to 100 coin values, pick a subset summing to at least the price; minimize the sum first, then the number of coins. | Easy3 | Dynamic programmingArray+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Snakes and LaddersSimulate a Snakes and Ladders game with a players and a list of die rolls, applying snakes and ladders after each move, and print each token's final square. | Easy3 | SimulationImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Conformity PrizeCanonicalize each frosh's five courses, count how many frosh share each set, then output the total over all sets with the maximum count. | Easy3 | Hash mapSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| To and FroDecode a message written row by row in alternating left-to-right and right-to-left order back into column-major plaintext. | Easy3 | StringSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Traditional BINGOFor each card, find how many announced numbers are needed before some row, column, or diagonal of five spaces is fully marked, with the center free. | Easy3 | SimulationArray+2 | No attempts yet | 1s | 128 MB | Judgeable |
| ForestsCount how many distinct nonempty sets of trees appear among the (person, tree) pairs; people who heard nothing are excluded. | Easy3 | Hash mapSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Stack 'em UpApply a sequence of fixed 52-card permutation shuffles to a new deck, printing the deck after each shuffle. | Easy3 | SimulationImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Jolly JumpersFor each sequence, check whether the absolute differences of adjacent elements are exactly the set 1 to n-1. | Easy3 | ArrayHash map+2 | No attempts yet | 1s | 128 MB | Judgeable |
| MinesweeperGiven an n×n mine layout and which cells are currently opened, print the board: mine counts for opened safe cells, asterisks for all mines if any mine was opened, and dots elsewhere. | Easy3 | SimulationImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| ElectionCount the votes each candidate receives in one riding, ignore unknown names, and report the winner's party or independent, or tie if there is no strict winner. | Easy3 | Hash mapImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Queue RearrangementGiven a queue of m items and n simultaneous move operations, apply all moves at once and print the resulting queue order. | Easy3 | ArraySimulation | No attempts yet | 1s | 128 MB | Judgeable |
| Mad ScientistRecover a non-decreasing sequence of measurements from its cumulative counts P(j), the number of measurements at most j, for each j from 1 to k. | Easy3 | ArrayPrefix sum+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Symmetric OrderGiven a list of names sorted by length, rearrange them so shorter names sit at the top and bottom and longer ones in the middle, pairing names from the start. | Easy3 | ArrayImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Flow LayoutPlace rectangles left to right into rows under a max width, wrap when one does not fit, and report the final window width and total height. | Easy3 | SimulationImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Loansome Car BuyerSimulate monthly depreciation and payments on a car loan, and report the first month when the amount owed drops below the car's value. | Easy3 | SimulationImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Booklet PrintingFor each page count, print which page numbers (or Blank) go on each side of every sheet in fold-over booklet order. | Easy3 | ArrayImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Self NumbersPrint all self numbers up to 10000, that is, numbers with no generator under d(n) = n + digit sum of n. | Easy3 | ImplementationMath+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Counting PagesGiven a document's page count and a comma-separated list of page ranges, count the distinct pages that are actually printed, ignoring empty ranges and pages past the end. | Easy3 | ImplementationString+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Tetromino Maximum SumGiven an N x N grid of integers, place one of the five tetrominoes (with rotations, not flips) so the four covered cells have the largest sum. | Easy3 | Brute forceImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Equal Total ScoresFind one card from each person to swap so their total scores match, choosing the pair with the smallest sum, or print -1. | Easy3 | Brute forceImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Hanafuda ShuffleCards 1 to n start from the bottom, and each cut moves a contiguous block of c cards starting at position p to the top; report the top card after all cuts. | Easy3 | SimulationImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| The God of ParkingGiven shop coordinates on a line, pick an integer parking spot and visit all shops, returning to the car, to minimize total walking distance. | Easy3 | MathGreedy+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Hostel NightsFor each week, apply five nights of elimination rules to 20 rooms and list the students who survive the most nights, ordered by room number. | Easy3 | ImplementationSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Air Old ZeelandFor each customer, sum the prices of requested products whose shipping delay fits the wait limit, flag customers who miss any product, and count them. | Easy3 | ImplementationArray+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Postman JoeSimulate Joe's walk on 20 houses, flag any out-of-range or repeated house as illegal, else list the houses with no delivery. | Easy3 | SimulationImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| TargetGiven all solution words of a letter puzzle, recover the 9 grid letters and place the letter common to every word in the middle. | Easy3 | ArrayHash map+1 | No attempts yet | 1s | 128 MB | Judgeable |
| AlarmistGiven n samples and a window size w, compute the floor of each window average and report the difference between the largest and smallest average. | Easy3 | Sliding windowArray+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Weird CurrencyGiven a chain of denomination conversion rates, convert each vendor's price to the smallest unit and report the difference between the highest and lowest price. | Easy3 | MathImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Subway FaresGiven a per-stop fare table and an ordered list of station names, find the number of stops between two stations and print the corresponding fare. | Easy3 | ArrayString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| LobbyingSum each lawmaker's donations made within 1000 days before the vote, then weight each no vote by 1/(1+D/10000) and add up both sides. | Easy3 | ImplementationMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Gadget PurchasesCount how many visits demand each machine, cap each count at its usage limit, and report the machines whose revenue beats purchase plus usage cost. | Easy3 | ArrayImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| A Fistful of DollarsGiven transaction totals for s people, find the person whose spending exceeds twice that of every other person, or report none. | Easy3 | ImplementationArray+1 | No attempts yet | 1s | 128 MB | Judgeable |
| FingerprintsFor each of K query 5x5 bitmaps, find the database bitmap with the smallest Hamming distance and print all tied indices in increasing order. | Easy3 | ArrayBit manipulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| FundraisingGiven a sequence of donation transactions, aggregate the amount each donor gave to each candidate and in total, then report every donor whose per-candidate total exceeds $2100 or whose overall total exceeds $40000. The core task is grouping and summing values by keys, then applying two threshold checks. | Easy3 | Hash mapArray+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Global WarmingGiven a small land/sea grid, mark every land cell with three or more sea neighbours as sea simultaneously, then print the tight bounding box of the remaining land. | Easy3 | ArraySimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| SambaGiven the school IDs of n dancers, find the single school whose total dancer count is not a multiple of k. | Easy3 | Hash mapArray | No attempts yet | 1s | 64 MB | Judgeable |
| Coin RowGiven rows of coin values, pick non-adjacent coins to maximize the total collected in each row. | Easy3 | Dynamic programmingArray | No attempts yet | 1s | 128 MB | Judgeable |
| MusicCount length-m windows whose max minus min is at most c, across several small arrays. | Easy3 | Sliding windowArray | No attempts yet | 1s | 128 MB | Judgeable |
| DecoderEach word contributes one letter: the first letter of the first word, then the k-th letter of each word where k is the previous word's length; spaces appear when the previous word is too long. | Easy3 | StringImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Escape RouteFor each grid, find the ship and the planet nearest to it, breaking ties by row-major order, and print both coordinates with the distance to two decimals. | Easy3 | ArrayImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Secret LetterGiven a ciphertext, undo a 90-degree clockwise rotation of a square grid to recover the original letter. | Easy3 | ImplementationArray+2 | No attempts yet | 1s | 128 MB | Judgeable |
| POIEach problem's value is the count of contestants who missed it; report Philip's total score and his rank using the four tiebreak terms. | Easy3 | ImplementationArray+2 | No attempts yet | 1s | 256 MB | Judgeable |
| NumbersGiven N positive integers, find the value with the highest frequency, breaking ties by choosing the smallest value. | Easy3 | ArrayHash map+1 | No attempts yet | 1s | 128 MB | Judgeable |
| UniqueFor each of three rounds, a player scores the number written only if no one else wrote it, and totals are printed in input order. | Easy3 | ArrayHash map+1 | No attempts yet | 1s | 128 MB | Judgeable |
| TilesFor each of K tiles in an N x N ring-colored square, find which concentric ring holds it and output the ring's color. | Easy3 | MathImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| The TravelerGiven gaps between n towns and a walk of m east/west jumps, find the total distance covered, reported mod 100000. | Easy3 | Prefix sumArray+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Card Captor SanggeunSimulate a two-player card game where each player always plays the smallest legal card, and report the final scores. | Easy3 | SimulationImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Maximum SumGiven n integers and a window size k, find the largest sum of any k consecutive terms. | Easy3 | ArraySliding window+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Card RearrangementStarting from the stack 1, 2, ..., 2n, apply a sequence of cuts and riffle shuffles and print the final order of the cards. | Easy3 | SimulationImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Commute RouteCount monotone east/north lattice paths from (1,1) to (a,b) that avoid n blocked intersections, with a and b at most 16. | Easy3 | Dynamic programmingCombinatorics+2 | No attempts yet | 1s | 128 MB | Judgeable |
| School Trip Destination RankingCount how many of n students want each of m destinations, then print destination numbers by descending count with ties broken by ascending number. | Easy3 | ArraySorting+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Rolling a DieSimulate rolling a die through a list of moves and sum the top face value after each move. | Easy3 | SimulationImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Line of Best FitGiven n points in the plane, compute the slope and intercept of the least squares regression line and print each rounded to three decimals. | Easy3 | MathImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Bingo!Given a set of balls, decide whether every value from 0 to N appears as the absolute difference of some ordered pair of balls in the set. | Easy3 | Brute forceMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| ElectricityGiven dated meter readings sorted by date, count pairs on consecutive calendar days and report how many such days exist plus the total consumption between them. | Easy3 | ImplementationMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| He is offside!Given distances of attackers and defenders to the goal line, decide whether any attacker is offside, meaning nearer to the goal than the second-last defender. | Easy3 | ImplementationSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Grandpa is Famous!Given weekly ranking lists, count how many times each player appears, then print the players with the second-highest count in ascending order. | Easy3 | Hash mapSorting+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Fake TicketsGiven N genuine ticket numbers and a list of M collected ticket numbers, count how many distinct values appear more than once in the list. | Easy3 | ArrayHash map+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Find the CowCount ordered pairs of indices (x, y) with x < y where an "((" starts at x and a "))" starts at y in a parenthesis string. | Easy3 | StringPrefix sum+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Hay BalesGiven N piles of hay with possibly unequal heights, find the minimum number of bales to move so all piles have equal height. | Easy3 | ArrayMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| ProfitsGiven a sequence of N daily profits, find the maximum sum over any contiguous stretch of days. | Easy3 | ArrayDynamic programming+2 | No attempts yet | 1s | 128 MB | Judgeable |
| The Robot PlowGiven up to 200 axis-aligned rectangles on a grid at most 240 by 240, count the number of unit squares covered by at least one rectangle. | Easy3 | ImplementationSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Lonesome PartnersGiven N points, find the 1-based indices of the two points with the largest Euclidean distance, guaranteed unique. | Easy3 | Brute forceGeometry+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Plumbing the PondGiven a grid of depth readings, find the largest positive value that appears in at least two cells adjacent horizontally, vertically, or diagonally. | Easy3 | ArrayImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| The Perfect CowGiven an odd N by N grid, take the median of each row, then return the median of those N row medians. | Easy3 | SortingArray+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Good GrassFind the 3x3 subgrid with the largest sum in a grid of milk values and report that sum with the upper-left corner, breaking ties by smallest row then column. | Easy3 | ArrayPrefix sum+2 | No attempts yet | 1s | 128 MB | Judgeable |
| BookshelfGiven cow heights and a shelf height B, find the smallest number of cows whose heights sum to at least B. | Easy3 | GreedySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Costume PartyCount pairs of cows whose lengths sum to at most S. | Easy3 | SortingTwo pointers+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Best GrassCount clumps of # cells in a grid, where each clump is one cell or two orthogonally adjacent cells and different clumps never touch. | Easy3 | ArraySimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Going to the MoviesGiven a truck capacity C and up to 16 cow weights, pick a subset whose total weight is as large as possible without exceeding C. | Easy3 | Brute forceBacktracking+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Serious Cow TagSimulate the elimination game where each active cow tags her nearest remaining cow, and report the last cow standing. | Easy3 | SimulationGeometry+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Making ChangeGiven a target amount and up to 10 coin denominations, find the fewest coins that sum exactly to the target. | Easy3 | Dynamic programmingGreedy+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Balloon GameGiven N slots and Q arithmetic progressions, mark the slots each pass would fill (skipping already filled ones), then count the empty slots. | Easy3 | SimulationImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Blowing FusesSimulate toggling devices on and off, tracking the running total power and whether it ever exceeds the fuse capacity. | Easy3 | SimulationImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Box of BricksGiven stack heights whose total is divisible by n, find how many bricks must move so every stack reaches the equal target height. | Easy3 | ArrayGreedy+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Set MeGiven tableaus of Set cards, print each tableau and then every triple of cards that forms a valid set, in index order. | Easy3 | Brute forceImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Clock PatienceSimulate Clock Patience on several decks: deal cards into 13 piles, flip cards following rank-to-pile moves, and report how many cards were exposed and the last card. | Easy3 | SimulationArray+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Prime CutsFor each N and C, build the primes from 1 to N and print the middle C*2 or C*2-1 of them, or the whole list if that many do not exist. | Easy3 | MathNumber theory+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Evaluating Simple C ExpressionsEvaluate a sequence of simple C expressions with +, -, and prefix or postfix ++/--, printing the expression value and the final values of used variables. | Easy3 | ImplementationSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Ambiguous PermutationsFor each permutation, decide whether it equals its own inverse, meaning position of value i equals the value at position i. | Easy3 | ArrayImplementation | No attempts yet | 1s | 128 MB | Judgeable |
| Polygon Programming with EaseGiven the midpoints of the edges of a polygon with an odd number of vertices, recover the original vertex coordinates using an alternating sum and forward substitution. | Easy3 | MathGeometry+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Error CorrectionFor each square 0/1 matrix, report OK if every row and column sum is even, the single bit that fixes the parity if exactly one row and one column are odd, or Corrupt otherwise. | Easy3 | ImplementationArray+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Bridge HandsDeal a 52-card deck to four bridge players from a given dealer, sort each 13-card hand by suit and rank, and print the hands in a fixed card-table format. | Easy3 | ImplementationSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Absolutely AcidicCount the frequency of readings in the range 1 to 1000, then apply tie-breaking rules to find which two readings to subtract. | Easy3 | ArrayImplementation+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Up and DownTwo walkers repeat a forward/backward step cycle; after s steps, report whose distance from the start is greater, or Tied. | Easy3 | SimulationMath+2 | No attempts yet | 2s | 512 MB | Judgeable |
| GPS Text EntryGiven a fixed 5x6 letter grid, compute the total cursor moves to type a string starting from 'A' and then reach 'enter'. | Easy3 | ImplementationSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |