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,997 problems
| Title | Level | Topics | Solved | Time limit | Memory limit | Judge |
|---|---|---|---|---|---|---|
| Word ProcessorFormat N words into lines of at most K characters using the greedy first-fit rule, then print the result. | Easy3 | SimulationImplementation+2 | No attempts yet | 2s | 512 MB | Judgeable |
| CHROMGiven two parent permutations and two crossover points n and m, build the offspring by keeping parent 1's segment [n, m) in place and filling the rest from parent 2 in order. | Easy3 | ArrayImplementation+2 | No attempts yet | 2s | 512 MB | Judgeable |
| CoffeeFor each person, add the price of their ordered coffee size to a shared delivery fee of floor(100/P), then snap the total to a multiple of 5 only when it is 1 off. | Easy3 | Hash mapImplementation+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Time ZoneGiven a time in Beijing (UTC+8) and a target time zone string, print the corresponding 24-hour clock time. | Easy3 | ImplementationMath+2 | No attempts yet | 1s | 256 MB | Judgeable |
| PolynomialGiven the coefficients and degrees of a polynomial in descending order, evaluate it at x using Horner's method and print the result modulo 1e9+7. | Easy3 | MathImplementation+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| EpidemiologySimulate a disease where each infected person infects R new people the next day, and find the first day the cumulative case count exceeds P. | Easy3 | SimulationMath+1 | No attempts yet | 2s | 512 MB | Judgeable |
| DatesEach input line is a date in day.month.year or month/day/year format; print both formats, validating that the date actually exists. | Easy3 | ImplementationString+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Counting WordsSplit a sentence on spaces and hyphens, then split any token that looks like a French contraction (c', j', n', m', t', s', l', d', qu' followed by a vowel) into two words, and count the total. | Easy3 | StringImplementation+2 | No attempts yet | 2s | 1024 MB | Judgeable |
| Bard ProdigyGiven a poem and per-key press limits, decide whether the poem plus its derived title (first letter of each word, uppercased) can be typed, counting runs of equal keys as one press, and print the title or -1. | Easy3 | StringImplementation+1 | No attempts yet | 1s | 512 MB | Judgeable |
| StickSimulate repeatedly halving and discarding pieces of a 64 cm stick until the remaining pieces sum to X, then count how many pieces are glued together. | Medium4 | Bit manipulationSimulation+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Base ConversionConvert a decimal integer to its digit representation in a given base, which may be negative, without using a minus sign. | Medium4 | MathImplementation+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Digit-Power SequenceFor each N from A to B, repeatedly sum the K-th powers of its digits, detect the eventual cycle, and sum the minimum value reached over all sequences. | Medium4 | SimulationMath+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Line UpReconstruct a line of N people (heights 1..N) given for each height how many taller people stand to its left, using reverse insertion. | Medium4 | ArrayGreedy+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Josephus Permutation 2Given N people in a circle and a step size K, output the full removal order produced by repeatedly eliminating every K-th remaining person. | Medium4 | QueueSimulation+1 | No attempts yet | 0.15s | 128 MB | Judgeable |
| Find the FractionGiven an index X, determine which fraction r/c appears at that position when all fractions r/c are enumerated in a zigzag diagonal order. | Medium4 | MathSimulation | No attempts yet | 0.5s | 256 MB | Judgeable |
| KickdownGiven two gear strings of 1s and 2s, slide one horizontally to minimize the combined width without any overlapping position having a tooth (2) on both. | Medium4 | StringBrute force+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Pie ChartOrder class percentages around a pie chart to maximize the count of sector boundaries exactly 50% apart, forming diameter lines through the center. | Medium4 | Brute forceCombinatorics+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Temporary Class PresidentGiven each student's class per grade for 5 grades, find the student who shared a class with the most distinct other students, choosing the smallest index on ties. | Medium4 | ArrayBrute force+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Coffee Shop 1Simulate coffee being poured between two jars each cycle and count how many cups Dongho can still taste, printing gg if the count is 0 or over 50. | Medium4 | SimulationMath+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Platform Support PillarsGiven platforms with heights and horizontal spans, compute the total length of vertical support pillars placed slightly inside each platform's ends resting on the floor or a lower platform. | Medium4 | SimulationSorting+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Flammable Railway 997Given fireproof material amounts between train cars and a starting fire location, compute the time step when a target car explodes, or report it never does. | Medium4 | Prefix sumSimulation+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Tournament WinnerGiven all pairwise win probabilities among 8 players in a fixed single-elimination bracket, compute each player's probability of winning the whole tournament. | Medium4 | ProbabilityDynamic programming+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Text EditorSimulate a line editor with cursor movement, character deletion, and insertion commands, printing the final string. | Medium4 | StackSimulation+2 | No attempts yet | 0.3s | 512 MB | Judgeable |
| Candy RotationGiven N cells in a circle, simulate digit-sum-based clockwise moves from every starting cell and find the maximum count of distinct cells visited before a repeat. | Medium4 | SimulationBrute force+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Length of a Repunit MultipleFind the minimum number of digits in a repunit (a number made only of 1s) that is divisible by a given N, or report -1 if none exists. | Medium4 | MathNumber theory+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Magic Square RotationsGiven four fixed permutations that can be applied to an 8-number arrangement, find the minimum number of operations to reach a target arrangement from the initial one via BFS. | Medium4 | BFSSimulation+1 | No attempts yet | 2s | 128 MB | Judgeable |
| CandyGiven the sums of adjacent candy counts for N students seated in an odd-sized circle, recover each student's exact candy count. | Medium4 | MathArray+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Card MagicFind an initial card order so that repeatedly cycling and dealing cards produces the sequence 1 to N on the table. | Medium4 | SimulationQueue+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Stack SequenceDetermine if a target permutation of 1 to n can be produced by a stack pushing values in increasing order, and output the push/pop sequence if possible. | Medium4 | StackSimulation+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Ripple EffectValidate a filled Ripple Effect puzzle grid by checking polyomino region digit ranges and minimum-distance spacing rules for repeated numbers in rows and columns. | Medium4 | Union-findSimulation+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Snail TableFill an N x N grid with numbers 1 to N^2 spiraling outward from the center and report the row and column of a given target number. | Medium4 | SimulationMatrix+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Tetrahedron EquivalenceDecide whether two tetrahedra with colored faces are equal under 3D rotation, given each as a base face plus three side faces in clockwise order. | Medium4 | SimulationImplementation+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Digital ClockGiven three start-end time ranges on a 24-hour clock that may wrap past midnight, count how many seconds have a clock integer (hhmmss with colons removed) divisible by 3. | Medium4 | SimulationMath+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Matchstick GridGiven an ASCII 3x3 matchstick grid, count how many matchsticks were removed and how many complete squares of any size remain. | Medium4 | SimulationImplementation+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Infinite Binary TreeGiven target pair (A,B) reachable in an infinite binary tree defined by additive child rules, count the left and right moves needed via a Euclidean-like reverse process. | Medium4 | MathNumber theory+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Transaction Limit CheckingParse bank customer, account, and transaction records to validate ownership and per-day, per-type transaction and exposure limits, printing a result per instruction. | Medium4 | Hash mapSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Cipher DecryptionGiven a key and ciphertext produced by a columnar transposition cipher, reconstruct the original plaintext. | Medium4 | StringSimulation+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Robot SimulationSimulate robots moving on a grid according to turn and move commands and report the first wall or robot collision, or OK if none occurs. | Medium4 | SimulationImplementation | No attempts yet | 2s | 128 MB | Judgeable |
| Popping BalloonsSimulate popping balloons arranged in a circle, moving left or right by the value on each popped balloon among remaining balloons. | Medium4 | SimulationLinked list+1 | No attempts yet | 2s | 4 MB | Judgeable |
| Shuffle SequenceGiven a permutation of size N, compute the least common multiple of its cycle lengths, which is the number of shuffles needed to restore the original order. | Medium4 | MathArray+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Colored Paper PerimeterGiven up to 100 axis-aligned 10x10 black squares on a 100x100 grid, compute the total perimeter of their union. | Medium4 | MatrixSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Finding RegionsGiven a grid with several rectangles marked as blocked, find the number of connected empty regions and output their areas sorted ascending. | Medium4 | BFSArray+1 | No attempts yet | 1s | 128 MB | Judgeable |
| OmokGiven a 19x19 Omok board, detect whether black or white has an exact five-in-a-row (not six or more) and output the winning color and the starting coordinate of that line. | Medium4 | MatrixSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Drawing PolygonsGiven a reference closed-path digit sequence tracing a polygon, find which candidate sequences represent the same polygon allowing rotation of starting point and direction reversal but not geometric rotation or reflection. | Medium4 | String matchingString+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Clock Card RankGiven four clockwise digits on a card, compute the minimal rotation (clock number) and find its rank among all distinct clock numbers from digits 1-9. | Medium4 | Brute forceSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| FaxImplement run-length encoding with specific bit-packed run and literal prefix formats, splitting long runs and literal blocks according to size limits. | Medium4 | SimulationString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Polycube Surface AreaValidate that unit cubes placed in a given order always connect by a face to a prior cube starting at the origin, then output the polycube's surface area or the index of the first invalid cube. | Medium4 | SimulationHash map+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Kyuhyun's Secret Text MessageConvert each character to a 5-bit code, fill an R by C matrix in clockwise spiral order with the concatenated bits (padding with zeros), then print the matrix read row by row. | Medium4 | MatrixSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Chip Stack ShuffleSimulate repeated riffle shuffles of two chip stacks and find the minimum number of shuffles to reach a target stack, or report -1. | Medium4 | SimulationString | No attempts yet | 1s | 128 MB | Judgeable |
| Brainf*ck InterpreterImplement a Brainfsck interpreter that parses a program per test case, checks bracket matching, and executes it printing output or a compile error. | Medium4 | StackSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Stacking DrumsGiven bottom-row circle centers of drums stacked pyramid-style each resting on two below, compute the final top drum's center coordinates. | Medium4 | GeometrySimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Pancake FlippingSort a stack of N distinct pancakes into increasing order from top using prefix reversals, within a bound of 2N-3 flips. | Medium4 | GreedySimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Candy Sharing GameSimulate a circle of students repeatedly halving and passing candies right, rounding odd counts up, until all counts equalize, then report the round count and final value. | Medium4 | SimulationArray | No attempts yet | 1s | 128 MB | Judgeable |
| ALPS-Style VotingSimulate a D'Hondt-style seat allocation: filter staff by a 5% vote threshold, generate divided scores, pick the top 14, and count chips per staff sorted by name. | Medium4 | SimulationSorting+1 | No attempts yet | 1s | 128 MB | Judgeable |
| When Homework Feels ImpossibleSimulate a die rolling boustrophedon-style across an R by C grid and sum the top face values recorded at each visited cell. | Medium4 | SimulationMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Apple Catching GameMove a fixed-size basket left or right along N cells to catch a sequence of falling apples with minimum total movement distance. | Medium4 | Dynamic programmingGreedy+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Box SortingSort an array into increasing order using the minimum number of cyclic-rotation commands, following a specified cycle-decomposition construction. | Medium4 | ArraySimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Basketball Lead TimeGiven timestamped scoring events over a 48 minute game, compute the total time each team held the lead. | Medium4 | SimulationSorting+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Kayaks and the Strong WindGiven broken and spare-carrying teams in a line, assign each spare kayak to an adjacent broken team to minimize the number of teams left unable to start. | Medium4 | GreedyBrute force+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Solve Sudoku by Cross-HatchingSimulate repeated Sudoku cross-hatching (single-candidate-per-box scan) on a given grid, filling cells until no more moves apply, and detect rule violations or contradictions. | Medium4 | SimulationMatrix+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Infinite Binary Tree TraversalGiven a string of L/R/P/* moves in an infinite binary tree, sum the node values over all traversals from expanding each '*' into L, R, or P. | Medium4 | MathString+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Three KangaroosGiven three sorted integer positions, compute the maximum number of jumps where an outer point can move to any free integer strictly between the other two. | Medium4 | MathGreedy+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Peg Move CountGiven a 7-line cross-shaped peg board, count how many single peg-jump moves are currently legal. | Medium4 | SimulationMatrix+1 | No attempts yet | 1s | 128 MB | Judgeable |
| CampfireSimulate campfire nights where Sunyoung's presence introduces a new song and other nights merge attendees' known songs, then output everyone who ends up knowing all songs. | Medium4 | SimulationHash map+1 | No attempts yet | 1s | 128 MB | Judgeable |
| AntsSimulate two colliding groups of ants swapping adjacent opposite-direction ants each second and output the arrangement after T seconds. | Medium4 | SimulationArray | No attempts yet | 1s | 128 MB | Judgeable |
| Greedy PigsSimulate a circular 6-pig feeding process where each pig's next demand is the sum of 4 previous values, and find the first day the total demand exceeds the fixed daily feed supply N. | Medium4 | SimulationMath | No attempts yet | 1s | 128 MB | Judgeable |
| Candy GameGiven a colored N×N grid, determine the longest same-color run achievable in any row or column after performing exactly one swap of two adjacent different-colored cells. | Medium4 | SimulationBrute force+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Rabbit MovementSimulate a rabbit walking on an N×N zigzag-diagonal numbered grid following given moves and sum all visited cell values. | Medium4 | MatrixSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Woncheol's RebellionSimulate a grid walker's rotations and moves, then find the minimum distance to a target by optionally changing one command to another direction. | Medium4 | SimulationGeometry+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Remaining Letters in a Word SearchGiven a letter grid and a word list, find every 8-direction occurrence of each word, cross out those letters, and print the remaining letters in row-major order. | Medium4 | MatrixString matching+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Election WinnersGiven M ranked ballots over N candidates, compute pairwise head-to-head wins to find the candidate(s) with the highest number of defeated opponents. | Medium4 | SimulationMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| SheepUse flood fill to split a grid into fenced regions, then for each region compare sheep and wolf counts to decide survivors, ignoring regions touching the border. | Medium4 | BFSGraph+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Quiz HintsGenerate three progressive hint strings for a text answer by masking letters with dots and revealing them in stages based on rounded fractional counts. | Medium4 | StringSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Urinal Flush ScheduleSimulate a sensor log to detect when a urinal usage streak of K seconds is followed by an absence streak of L seconds, printing each flush time or NIKAD. | Medium4 | SimulationString+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Kkung the ShepherdUsing grid flood-fill to find fenced regions, determine for each region whether sheep or wolves survive by comparing counts, then output totals. | Medium4 | BFSArray+1 | No attempts yet | 1s | 128 MB | Judgeable |
| SnakeSimulate a classic snake moving on an N x N grid with given apple positions and scheduled turn events, and output the second when it hits a wall or itself. | Medium4 | SimulationQueue+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Race RankingSimulate M checkpoint messages in order, keep only valid sequential checkpoint passes per driver, and print final ranking by progress and recency. | Medium4 | SimulationImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Programming Language ZParse and simulate a tiny toy language with variable assignments, nested REPEAT loops, and PRINT statements, applying mod-10000 arithmetic. | Medium4 | SimulationImplementation+1 | No attempts yet | 2s | 128 MB | Judgeable |
| DownloadGiven download times and playback durations of sequential song pieces, compute the earliest start time so playback never stalls waiting for a piece. | Medium4 | GreedyPrefix sum+1 | No attempts yet | 1s | 128 MB | Judgeable |
| MOSimulate an alternating stone-placing game on a 1D board where placing a stone can capture an enclosed run of opponent stones, then count remaining stones of each color. | Medium4 | SimulationArray+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Who Wins Gold, Silver, and Bronze?Given each athlete's live rank as they finish two sequential races, reconstruct final standings from the second race and output the top three athlete numbers. | Medium4 | SimulationArray+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Card Pickup GameSimulate removing cards 1..N in order from a circular scan of a row, counting how many times the search wraps past the right end. | Medium4 | QueueSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| SpiesSimulate a walk on a grid and report which given spy coordinates ever fall within Chebyshev distance 1 of the walker's path. | Medium4 | SimulationArray | No attempts yet | 1s | 128 MB | Judgeable |
| SearchTrack all reachable cells on a grid as a car moves in given directions by at least one free cell each step, then mark final possible positions. | Medium4 | SimulationArray+1 | No attempts yet | 1s | 128 MB | Judgeable |
| CountriesFor each city, compute which other city exerts the strongest gravity-like influence on it, then label it king, democracy, or trace the chain of surrender to find its ultimate capital. | Medium4 | SimulationMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Calculator GameGiven K up to 999, find the smallest multiple of K whose decimal digits are all identical, printing the digit and its count or 'Impossible'. | Medium4 | MathBrute force+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Weird NumbersConvert numbers between decimal and a given negative base representation, in both directions, for multiple queries until an end marker. | Medium4 | MathImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Homo or Hetero?Maintain a list under insert and delete-first-occurrence operations and classify it after each step as homogeneous, heterogeneous, both, or neither. | Medium4 | Hash mapImplementation+1 | No attempts yet | 3s | 256 MB | Judgeable |
| iSharpParse a C-like multi-variable type declaration with pointer, reference, and array symbols, then print each variable on its own line with its symbols moved to the front in reversed order. | Medium4 | StringImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Access Control ListsParse an ordered ACL of allow/deny IP network rules and, for each query IP, output whether the first matching rule grants or denies access. | Medium4 | Bit manipulationString+2 | No attempts yet | 3s | 256 MB | Judgeable |
| The Bird TreeGiven a reduced fraction, reconstruct its path of L/R moves in the Stern-Brocot style Bird tree using a Euclidean-like process. | Medium4 | MathGreedy+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Movie CollectionGiven a stack of DVDs and a sequence of watched movie numbers, output for each watch how many DVDs sat above it before moving it to the top. | Medium4 | ArraySimulation+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Parking BuildingSimulate an elevator and rotating conveyor belts to compute total retrieval time for cars fetched in customer order. | Medium4 | SimulationImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Leonardo's NotebookDetermine whether a given permutation of the alphabet can be expressed as some permutation applied twice (its functional square). | Medium4 | MathCombinatorics+1 | No attempts yet | 1s | 128 MB | Judgeable |
| LaserboxSimulate a laser beam bouncing off right-turning mirrors on a grid until it exits the board or loops forever. | Medium4 | SimulationImplementation | No attempts yet | 1s | 128 MB | Judgeable |
| TableGiven an N by M table, compute each column's product and output the column index (largest index on tie) with the maximum product, handling big products across up to 1000 rows. | Medium4 | MathSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| KCPCFrom a submission log, compute each team's best-per-problem total score, break ties by submission count then last submission time, and output a given team's rank. | Medium4 | SimulationHash map+1 | No attempts yet | 1s | 128 MB | Judgeable |
| ManagerSimulate a priority-based queue manager that adds costs, removes min or max cost per current policy, and prints results only for specified removal request indices. | Medium4 | HeapSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Peer ReviewGiven each author's institution and their K assigned papers to review, count how many papers violate review-count, self-review, collaborator, or duplicate-review rules. | Medium4 | Hash mapSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Condorcet ParadoxGiven b ranked ballots over c candidates, find the candidate who beats every other candidate head to head on more than half the ballots. | Medium4 | ArraySimulation+2 | No attempts yet | 5s | 128 MB | Judgeable |