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 |
|---|---|---|---|---|---|---|
| Returning HomeReverse a short list of turn directions and street names, flipping each left or right turn, to produce the route from school back home. | Easy3 | ImplementationSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| TopYodellerCompute each yodeller's cumulative score after every round, find who ends with the highest total, and report their worst rank. | Easy3 | ArraySimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Babbling BrooksSimulate a sequence of splits and joins on a list of streams and print the resulting flows after each split divides flow by a percentage and each join merges neighbors. | Easy3 | ImplementationSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Card GameSimulate a 52-card game where players alternate turning cards; award points when a high card is followed by enough non-high cards, then print each score. | Easy3 | SimulationImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Train SwappingFor each test case, count the inversions of a permutation of 1..L, the minimum number of adjacent swaps needed to sort the train. | Easy3 | ArraySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Arithmetic SequenceGiven a sequence, decide whether consecutive differences are equal and, if so, print the next five terms in the exact required format. | Easy3 | ImplementationMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Milk and HoneyEach field holds either cows up to its cow limit or bees up to its bee limit; assign each field one animal type to maximize happiness from milk and honey. | Easy3 | GreedySorting+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| MõttemeisterGiven a secret four-digit number and N guesses, print for each guess the count of correct digits (A) and the count of digits in the correct position (B). | Easy3 | ImplementationArray+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| Harmony: Parallel FifthsGiven N pairs of simultaneous two-voice pitches, list every position i where the voices form a perfect fifth (interval 5 mod 12) at both i and i+1 and both voices move. | Easy3 | ImplementationArray+2 | No attempts yet | 3s | 1024 MB | Judgeable |
| HarmonyGiven K voices over N note rows, list every pair of consecutive rows and voice pair that forms a parallel fifth (both voices move and stay 7 semitones apart mod 12). | Easy3 | ImplementationBrute force+2 | No attempts yet | 7s | 1024 MB | Judgeable |
| Alien SocksGiven counts of socks in s colors, find the smallest number of socks to draw to guarantee k socks of one color, or -1 if impossible. | Easy3 | MathGreedy+1 | No attempts yet | 1s | 1024 MB | Judgeable |
| Attendance CheckGiven a permutation forming one cycle, find the student who responds last when the calling chain starts at student k. | Easy3 | ImplementationSimulation+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| FishingFind the starting day among the first N days whose window of k consecutive days contains the most rainy days, choosing the smallest index on a tie. | Easy3 | Sliding windowArray+1 | No attempts yet | 1s | 1024 MB | Judgeable |
| SledSimulate a sled whose speed changes by a_i on each segment and drops by 1 at junctions whenever it exceeds S; report the final speed. | Easy3 | SimulationImplementation+1 | No attempts yet | 1s | 1024 MB | Judgeable |
| LaundryGiven colors partitioned into washable groups and counts of clothes per color, find how many machine loads of capacity M are needed. | Easy3 | MathImplementation+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| BusTrack how many passengers are on the bus after each stop and report the largest number of them that exceeds the seat count K. | Easy3 | ImplementationSimulation+1 | No attempts yet | 1s | 1024 MB | Judgeable |
| Scrabble ScoringScore each Scrabble play by parsing its start square and direction, applying letter and word bonus multipliers from the fixed 15x15 board. | Easy3 | ImplementationSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Currency ExchangeGiven a 5x5 exchange-rate table where every conversion rounds to the nearest hundredth, simulate each trip and report the final dollar amount rounded to cents. | Easy3 | SimulationImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Easy TradingGiven daily prices, compute moving averages over the last m and n days and print a buy or sell signal whenever the trend between them reverses. | Easy3 | ArrayPrefix sum+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Prehistoric Operating SystemsCount binary strings of length n with no two adjacent D's, where D means DOORS and O means any other brand, for up to 40 test values of n. | Easy3 | Dynamic programmingCombinatorics+2 | No attempts yet | 1s | 128 MB | Judgeable |
| StampsGiven a needed stamp count and each friend's offer, find the fewest friends whose offers sum to at least the needed amount, or report impossible. | Easy3 | GreedySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Ancient PlatesApply given PERM and SHIFT rules to lines, words, or characters of a block of text, then print the result. | Easy3 | ImplementationSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Body Size RankingFor each person, count how many others are both heavier and taller, and print that count plus one. | Easy3 | ArrayBrute force | No attempts yet | 1s | 128 MB | Judgeable |
| Noughts & CrossesReplay each game from its recorded moves and report the winner (X or O) or Draw, ignoring moves after the win. | Easy3 | SimulationImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| OutfitsGiven two wardrobes numbered from opposite ends with at most one removal each, report for each day whether both girls picked the same physical outfit. | Easy3 | ArrayImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| ScrabbleGiven up to 1000 short dictionary words and a set of letter and blank tiles, count how many words the tiles can spell. | Easy3 | ArrayString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| ElectionSimulate instant-runoff voting over at most 5 candidates and 20 preference groups, eliminating the lowest scorer each round. | Easy3 | SimulationImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| In QueriesMaintain a 5-column table with seeded initial rows and process insert, remove, max, min, and range-count queries over the columns. | Easy3 | ArrayImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Email from the ProfessorWrite each message row by row into a grid of width k, then read columns in the order given by a permutation key, dropping padding cells. | Easy3 | ImplementationArray+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Very Simple ProblemFind problems that more than half of the jury rated with its minimum score and that no jury member rated with its maximum score. | Easy3 | ImplementationArray | No attempts yet | 1s | 128 MB | Judgeable |
| SupermarketFind the k-th smallest value among n amounts spent, with values bounded by 100000. | Easy3 | SortingArray+2 | No attempts yet | 1s | 128 MB | Judgeable |
| IntervalsGiven n closed intervals, merge all overlapping or touching ones and print the resulting disjoint intervals in ascending order. | Easy3 | SortingIntervals+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Intelligence TestGiven a fixed sequence and several queries, decide for each query sequence whether it is a subsequence of the fixed sequence. | Easy3 | ArrayTwo pointers+1 | No attempts yet | 3s | 512 MB | Judgeable |
| SticksGiven stick lengths, repeatedly merge pairs of equal length into doubled sticks and report how many distinct sticks remain. | Easy3 | Hash mapArray+1 | No attempts yet | 1s | 128 MB | Judgeable |
| PostcardCount the contiguous segments that keep at least one mountain of height m or more after trimming both ends. | Easy3 | CombinatoricsArray | No attempts yet | 1s | 512 MB | Judgeable |
| The TapeFind the largest distance between two positions holding different values in each test case, printing BRAK if all values are equal. | Easy3 | GreedyArray | No attempts yet | 1s | 512 MB | Judgeable |
| ListAfter moving the last k numbers of 1 to n to the front, sum the entries from position i to position j. | Easy3 | MathArray | No attempts yet | 1s | 512 MB | Judgeable |
| Passing CarsCount pairs of cars moving toward each other where an eastbound car stands west of a westbound car. | Easy3 | Prefix sumArray | No attempts yet | 1s | 128 MB | Judgeable |
| The BetTurn the fewest dice so exactly k of the six faces appear, keeping the most frequent faces and adding missing ones. | Easy3 | GreedySorting+1 | No attempts yet | 1s | 128 MB | Judgeable |
| DividersCount the positions where the first k entries hold exactly 1 to k by tracking the running maximum. | Easy3 | ArrayGreedy | No attempts yet | 1s | 128 MB | Judgeable |
| Weight LossFind the largest weight drop from an earlier day to a later day over all contiguous stretches. | Easy3 | ArrayGreedy | No attempts yet | 1s | 128 MB | Judgeable |
| PermutationCheck whether n given integers contain each number from 1 to n exactly once and print TAK or NIE. | Easy3 | ArrayHash map | No attempts yet | 1s | 128 MB | Judgeable |
| Cutting the TapeSplit the row of integers into two nonempty parts so the absolute difference of the two part sums is as small as possible. | Easy3 | Prefix sumArray | No attempts yet | 1s | 128 MB | Judgeable |
| Crossing Out NumbersCross out as few numbers as possible so the numbers left behind read 1 to k in order. | Easy3 | GreedyArray | No attempts yet | 1s | 128 MB | Judgeable |
| Consecutive GirlsFind the fewest boys to remove so that k girls stand side by side in a row of n boys and girls. | Easy3 | Sliding windowPrefix sum+1 | No attempts yet | 1s | 128 MB | Judgeable |
| CordsPartition the row of cords into the maximum number of contiguous groups with total length at least w. | Easy3 | GreedyArray | No attempts yet | 1s | 128 MB | Judgeable |
| The Score ChartGiven a sequence of 0s, 1s, and 2s, find the length of the longest subsequence that never decreases. | Easy3 | Dynamic programmingArray | No attempts yet | 1s | 128 MB | Judgeable |
| Stock PriceFor each position find the index of the first later price that is higher, or -1 when no such price exists. | Easy3 | StackArray | No attempts yet | 2s | 128 MB | Judgeable |
| Perfect MemorySplit an even-length integer sequence into a palindrome and an antipalindrome that add up to it, or print NIE when parity forbids it. | Easy3 | MathArray | No attempts yet | 2s | 128 MB | Judgeable |
| Recovering the Input NumbersReconstruct the original array that produces the given output when replayed through the circular skip-and-zero traversal. | Easy3 | SimulationArray | No attempts yet | 1s | 32 MB | Judgeable |
| Work at a Library Is ToughCount the fewest swaps of out-of-order book pairs that arrange each test case's call numbers in ascending order. | Easy3 | Brute forceArray | No attempts yet | 1s | 128 MB | Judgeable |
| The Candy-Sharing GameEach round passes half of each candy pile to the right and tops odd counts to even until every child holds the same number. | Easy3 | SimulationArray | No attempts yet | 1s | 128 MB | Judgeable |
| Number That CountApply the digit-inventory operation up to 15 times and report whether the number is self-inventorying, reaches one, loops, or stays unclassified. | Easy3 | SimulationArray | No attempts yet | 1s | 128 MB | Judgeable |
| Wiretap DeviceFind the one device whose received power exceeds six times the background noise plus every other device's power, or print NOISE. | Easy3 | MathArray | No attempts yet | 1s | 128 MB | Judgeable |
| It Is ColdFrom the farthest fan inward, add matching flows and subtract opposing ones, resetting on outward flow, to find the speed reaching the team. | Easy3 | SimulationArray | No attempts yet | 1s | 128 MB | Judgeable |
| Padovan SequenceFor each test case, compute the Nth Padovan number defined by the spiral of equilateral triangles. | Easy3 | Dynamic programmingArray | No attempts yet | 1s | 128 MB | Judgeable |
| The Sultan's ChapatiFollow the prescribed flip procedure to sort each stack largest on the bottom and print the flip positions ending with 0. | Easy3 | SimulationArray+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Charles Babbage's Difference EngineGiven the first values of a low-degree polynomial, extend its finite-difference table forward and report the value at x = 50. | Easy3 | SimulationMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Pair SumCount pairs in a sorted distinct array that sum to a target M for each test case. | Easy3 | Two pointersArray | No attempts yet | 1s | 128 MB | Judgeable |
| Range Sum QueryAnswer many inclusive range sum queries on a static integer list using precomputed prefix sums. | Easy3 | Prefix sumArray | No attempts yet | 1s | 128 MB | Judgeable |
| Color Change of Go StonesRepeat k times the rule that replaces each circular gap with the xor of its two neighbors, then count the white stones. | Easy3 | SimulationArray | No attempts yet | 1s | 128 MB | Judgeable |
| Best Machine Rental ProfitEach record maps letters to profits, and the task asks for the largest sum over any contiguous block, or zero when every block loses money. | Easy3 | Dynamic programmingArray | No attempts yet | 2s | 512 MB | Judgeable |
| Reordering the CowsGiven the current and target cow orders, count the permutation cycles longer than one and report the longest cycle length. | Easy3 | ArraySimulation | No attempts yet | 1s | 128 MB | Judgeable |
| Maximum Subarray SumFor each test case, find the maximum sum over all contiguous subarrays of the given integer array. | Easy3 | Dynamic programmingArray | No attempts yet | 1s | 256 MB | Judgeable |
| MemoryPlay Memory with 50 face-down cards (25 letter pairs) by calling faceup(C); find each matching pair so Jack collects all 25 candies. | Easy3 | SimulationImplementation+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Maximal SumFind the contiguous block of edge weights with the largest sum and print its endpoints, or print no good path when the best sum is not positive. | Easy3 | Dynamic programmingArray | No attempts yet | 1s | 64 MB | Judgeable |
| Islands in the Data StreamCount the contiguous blocks strictly above both bordering values in each 12-number sequence with zeros at both ends. | Easy3 | Brute forceArray | No attempts yet | 1s | 256 MB | Judgeable |
| Rolling EncryptionEncrypt a lowercase string by leaving the first k letters unchanged and shifting each later letter by the most frequent of the k original letters before it. | Easy3 | Sliding windowArray+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Skyscraper SilhouetteRebuild the skyline picture from N ground-based rectangles, mark the border cells, and report the perimeter without the ground side. | Easy3 | SimulationArray+1 | No attempts yet | 1s | 32 MB | Judgeable |
| Marathon 1Run checkpoints 1 to N in order while skipping exactly one middle checkpoint to minimize the total Manhattan distance. | Easy3 | GreedyArray+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Cow JogCount how many groups remain when faster cows behind slow down to match the slowest cow ahead of them. | Easy3 | GreedyArray | No attempts yet | 1s | 256 MB | Judgeable |
| 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 |
| Largest Stock Price DeclineGiven up to a million prices from a sine-cosine formula, find the largest drop from an earlier price to a later one. | Easy3 | ArrayGreedy+1 | No attempts yet | 5s | 256 MB | Judgeable |
| Sorting Numbers 3Sort up to 10,000,000 integers no greater than 10,000 in ascending order, one per line. | Easy3 | SortingArray | No attempts yet | 5s | 8 MB | Judgeable |
| Largest Sum Increasing SubsequencePick elements in order so each is larger than the last and their sum is as large as possible. | Easy3 | Dynamic programmingArray | No attempts yet | 1s | 256 MB | Judgeable |
| Broken Vending MachinePress each snack position through its cheapest button and keep only the snacks whose market price beats that press cost. | Easy3 | GreedyArray | No attempts yet | 1s | 256 MB | Judgeable |
| Folding a Paper StripeSimulate the K given half-folds of a 2^K-cell stripe and print the cell numbers from top to bottom. | Easy3 | SimulationArray | No attempts yet | 1s | 256 MB | Judgeable |
| StockCompute the largest profit from daily prices when you may buy one share per day and sell any number of held shares on any day. | Easy3 | GreedyArray | No attempts yet | 5s | 256 MB | Judgeable |
| Physical MusicGiven a permutation of chart positions, list the download-chart positions of entries that a later single outranks, in ascending order. | Easy3 | ArraySorting | No attempts yet | 5s | 256 MB | Judgeable |
| Range sum queriesAnswer many inclusive range-sum queries over a fixed list by precomputing prefix sums. | Easy3 | Prefix sumArray | No attempts yet | 1s | 256 MB | Judgeable |
| Merging Two Sorted ArraysMerge two sorted arrays into one sorted sequence with a two-pointer walk. | Easy3 | Two pointersArray | No attempts yet | 1.5s | 256 MB | Judgeable |
| Mastering MastermindGiven a secret code and a guess of colored pegs, count exact position matches and remaining color-only matches. | Easy3 | ArrayString | No attempts yet | 1s | 256 MB | Judgeable |
| ColliderMove the particle at position i to position j on each exposure and report the particle type at position k for each query. | Easy3 | ArraySimulation | No attempts yet | 2s | 256 MB | Judgeable |
| Breed CountingGiven the breed of each cow in a row, report the count of each of the three breeds inside every query interval. | Easy3 | Prefix sumArray | No attempts yet | 2s | 512 MB | Judgeable |
| Bookshelf SortingSeparate books into odd and even worths, sort the odds up and the evens down, then refill each position with the matching owner. | Easy3 | SortingArray | No attempts yet | 5s | 512 MB | Judgeable |
| Sorting the BookshelfSeparate the books by odd and even worth, sort the odd ones increasingly and the even ones decreasingly, then put each back on its owner labeled spots. | Easy3 | SortingArray | No attempts yet | 5s | 512 MB | Judgeable |
| Ocean View (Small)Destroy the fewest houses so the heights of the houses that remain strictly increase from the lake eastward. | Easy3 | Brute forceArray | 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 |
| Who is the final winner?Each of N players holds M cards; every round all players play their largest remaining card and whoever plays the highest value scores a point. Report the player(s) with the most points. | Easy3 | SortingSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Will the Second IUPC Go Well?Given the pen counts of N members, find the fewest members whose pens total at least M*K, or print STRESS if the total falls short. | Easy3 | GreedySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Peter and the TextbookSimulate a textbook where tearing out page i also removes page n-i+1, and answer which page sits at position p among the pages still present. | Easy3 | SimulationImplementation+1 | No attempts yet | 2s | 256 MB | Judgeable |
| Household Ledger (Easy)Maintain a ledger over N days with point additions and range-sum queries, printing the sum of entries from day p to day q. | Easy3 | Prefix sumArray | No attempts yet | 1s | 512 MB | Judgeable |
| Sweet part-time jobJunsu can work at most m consecutive days out of n days with given daily wages; find the maximum total pay for such a window. | Easy3 | Sliding windowPrefix sum+1 | No attempts yet | 1s | 512 MB | Judgeable |
| Hongjun likes FFTGenerate permutations a and b with the given pseudocode, then compute c[i] = max over valid j of a[j]*b[i-j]. | Easy3 | ArraySimulation+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Range Sum QueriesGiven a fixed array and m range queries, print the sum of elements between two given indices for each query. | Easy3 | Prefix sumArray | No attempts yet | 2s | 512 MB | Judgeable |
| Bitcoin investmentGiven a list of daily bitcoin prices, buy on one day and sell on that day or later to maximize the selling price minus the buying price. | Easy3 | ArrayGreedy+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Longest non-decreasing subsegmentFind the longest contiguous non-decreasing run in a list and output its length and the sum of its elements, breaking ties by earliest start. | Easy3 | ArrayImplementation+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Selection of Participants of an ExperimentGiven a list of student scores, find the smallest absolute difference between any two of them. | Easy3 | SortingArray | No attempts yet | 2s | 512 MB | Judgeable |
| Look for the Winner!Given votes counted in order, report the earliest prefix after which one candidate's lead cannot be overtaken from remaining votes, or TIE. | Easy3 | ArraySimulation+1 | No attempts yet | 2s | 512 MB | Judgeable |