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
| Title | Level | Topics | Solved | Time limit | Memory limit | Judge |
|---|---|---|---|---|---|---|
| Two BallsTwo balls move on a grid for T seconds with different random rules; compute the probability they collide, to 4 decimals. | Medium7 | ProbabilityDynamic programming+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Explosion at CafebazaarA directed multigraph alternates send and receive rounds from an initial 1-bit packet; count the starting switches whose bit makes some buffer grow without bound. | Medium7 | GraphDFS+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Watson and Intervals (Large)Generate N intervals from a recurrence, then find the minimum covered integer count after removing exactly one interval. | Medium7 | IntervalsSorting+2 | No attempts yet | 5s | 512 MB | Judgeable |
| Blindfolded speedrunnerFind the shortest fixed action sequence that walks a blindfolded hero from the bottom-left to the top-right cell of an N x N grid regardless of whether the initial facing is up or right. | Medium7 | BFSGraph+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Double EliminationGiven J's winners-bracket and losers-bracket win counts in a double-elimination tournament with 2^k players, find his final rank. | Medium7 | MathImplementation+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Detective JunhaFind the shortest walk on a 4x5 grid that starts at 0, visits museums in numeric order, and covers every non-dot cell, moving one step at a time. | Medium7 | BFSGraph+2 | No attempts yet | 0.5s | 512 MB | Judgeable |
| Replicate Replicate RfplicbteGiven a final grid from a punctured cellular automaton (odd-parity rule with at most one cell flipped per step), find the unique smallest nonempty starting pattern. | Medium7 | SimulationImplementation+2 | No attempts yet | 3s | 512 MB | Judgeable |
| Your NameGiven unread counts for messages in order, find every person who could have left message Q unread under some consistent reading schedule. | Medium7 | GreedyImplementation+2 | No attempts yet | 2s | 256 MB | Judgeable |
| Shuttle busProcess students getting off a shuttle; after each exit every student shifts toward the nearer end one adjacent empty seat at a time, and queries ask who sits in a given seat. | Medium7 | Union-findSimulation+1 | No attempts yet | 1.5s | 512 MB | Judgeable |
| ParrotsGiven N parrot sentences and one written sequence, decide whether distinct words can interleave so that each parrot's words stay in order and no word repeats. | Medium7 | SimulationGreedy+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Dev, Please Add This!Decide whether a ball that rolls until hitting a wall or edge can collect every star on a grid. | Medium7 | GraphBFS+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Faster SortingFor each MINRUN, simulate Timsort's run splitting and report the number of subarrays and the number of bad elements pulled in. | Medium7 | SimulationTwo pointers+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Flow ShopGiven N jobs processed through M stages in the same order with per-job times, and a smallest-label-first queue rule at each stage, find each job's finish time. | Medium7 | SimulationQueue+1 | No attempts yet | 6s | 512 MB | Judgeable |
| Bathroom StallsSimulate K people choosing the emptiest interval by a tie-break rule, and report the gap sizes of the K-th chosen stall. | Medium7 | HeapGreedy+2 | No attempts yet | 5s | 512 MB | Judgeable |
| Play the DragonGiven dragon and knight stats, find the fewest turns of attack, buff, cure, or debuff actions to defeat the knight, or report it is impossible. | Medium7 | Brute forceGreedy+2 | No attempts yet | 5s | 512 MB | Judgeable |
| Roller Coaster Scheduling (Small)Given tickets for specific seats and customers, find the minimum rides needed after freely moving tickets to smaller-numbered seats, and the minimum promotions achieving it. | Medium7 | GreedySorting+2 | No attempts yet | 5s | 512 MB | Judgeable |
| Box DeliveryA 1x1x3 box rolls 90 degrees across a grid, and we want the fewest rolls until it touches the destination cell; the box has two stable resting shapes. | Medium7 | BFSGraph+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Marathon Ice HockeyAssign each player a number of minutes by a fixed greedy order, then convert the resulting cyclic blocks into an explicit substitution list. | Medium7 | GreedySorting+2 | No attempts yet | 1s | 64 MB | Judgeable |
| Folding a RibbonGiven the layer index and part index of a marked spot on a ribbon folded n times, output the unique sequence of left and right folds. | Medium7 | RecursionDivide and conquer+2 | No attempts yet | 2s | 512 MB | Judgeable |
| GentleBotsSimulate a fixed three-dimensional two-robot controller: for each robot, print the straight or detour route around the other robot's position, exactly following the stated rules. | Medium7 | SimulationImplementation+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Champagne TowerGiven up to 20 glasses with rim circles in 3D, pour champagne into the highest one at 100 ml/s and find when the whole tower fills, or report Invalid. | Medium7 | GeometrySimulation+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Yes, Yes, It's NonogramsRepeatedly apply line-by-line nonogram deduction until no square's color is forced, then print the resulting grid. | Medium7 | SimulationImplementation+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Is-A? Has-A? Who Knows-A?Given is-a and has-a facts between at most 500 classes, apply the four transitivity rules and answer whether each queried relation holds. | Medium7 | GraphDFS+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Fygon 2.0Given nested Fygon loops with inclusive ranges over variables and n, compute the asymptotic complexity C*n^k of the single lag execution count, with C as an irreducible fraction. | Medium7 | MathCombinatorics+2 | No attempts yet | 3s | 512 MB | Judgeable |
| Landing slotsFor each incoming aircraft, find the lowest free landing slot it can physically reach and report the join point and arrival time. | Medium7 | GeometrySimulation+1 | No attempts yet | 2s | 512 MB | Judgeable |
| ASCII Art TreesFor each prefix-encoded binary tree, draw its ASCII layout using the given slash, bar, and spacing rules and print the resulting character grid. | Medium7 | TreeRecursion+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Polyline SimplificationRepeatedly remove the interior point whose triangle area is smallest, breaking ties by original index, and report each removal index. | Medium7 | HeapLinked list+2 | No attempts yet | 5s | 512 MB | Judgeable |
| World Cup DrawSimulate the World Cup draw by placing each team into the leftmost group that keeps the rest of the pot placeable, then sort groups by total rank. | Medium7 | GreedyBacktracking+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Mixing CoinsGroups of equal coins are merged three at a time when three consecutive same-material coins appear, and the survivor count is requested. | Medium7 | SimulationStack+1 | No attempts yet | 5s | 512 MB | Judgeable |
| ClickbaitGiven an ASCII map of containers joined by pipes, determine the order in which the containers fill with water starting from container 1. | Medium7 | SimulationGraph+1 | No attempts yet | 1s | 128 MB | Judgeable |
| English RestaurantGiven n tables and random hourly group sizes from 1 to g, find the expected number of seated people after t hours, where each group takes the smallest table that fits. | Medium7 | Dynamic programmingProbability+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Marble Escape 4On a small board with one red marble, one blue marble, and a single hole, tilt until the red marble falls through the hole while the blue never does; report the fewest tilts or -1. | Medium7 | BFSSimulation+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Puyo Puyo StackingGiven a final Puyo Puyo board, print one accepted sequence of pair drops that builds it in the exact column order the statement fixes, using temporary pops to clear leftovers. | Medium7 | SimulationImplementation+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| IncineratorMaintain a queue of waste and M incinerator cells under burn, query, append, and recycle commands, then report the final cells. | Medium7 | ImplementationQueue+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Array and OperationsApply a sequence of global 'add index to each position' updates and range reversals to a zero array, then report the values at m queried positions. | Medium7 | ArrayImplementation+2 | No attempts yet | 2s | 512 MB | Judgeable |
| RoboThievesOn a grid with walls, cameras, and one-way conveyors, find the minimum number of robot steps to reach each empty cell without ever being seen by a camera. | Medium7 | BFSGraph+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Floating-Point NumbersStarting from s = a, add the same 64-bit truncated floating-point value a to s exactly n times (n up to 10^18) and output the resulting 64 bits. | Medium7 | SimulationMath+2 | No attempts yet | 2s | 512 MB | Judgeable |
| GPSFor each orbiting satellite, decide whether its straight-line radio signal reaches a given point on a spherical Earth, and if so output the travel time. | Medium7 | GeometryMath+2 | No attempts yet | 2s | 512 MB | Judgeable |
| The Cowherd and the Weaver GirlOn an N by N grid, move 1 cell per minute from (0,0) to (N-1,N-1); bridges with given periods are crossable only at some minutes, never twice in a row, and you may add one bridge of period M. | Medium7 | BFSGraph+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Three RobotsGiven a connected weighted graph and three robot start vertices, find the earliest time all three can meet at one vertex, where each robot may wait or move along edges. | Medium7 | GraphShortest path+2 | No attempts yet | 2s | 512 MB | Judgeable |
| EmpireSimulate a tree of kingdoms and wars: process each battle in order, transfer vassal subtrees on losses and successful rebellions, then report the root kingdoms sorted by ASCII order. | Medium7 | TreeSimulation+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Repeating GoldbachsApply the largest-difference Goldbach step to an even x under 1,000,000 until it drops below 3, and count the steps. | Medium7 | Number theorySimulation+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Dragon and DungeonSimulate the fixed-attack dungeon and track required minimum HP, then binary search the smallest starting maximum HP that keeps survival possible. | Medium7 | Binary searchSimulation+2 | No attempts yet | 1s | 256 MB | Judgeable |
| SwitchesGiven initial on-lamps and N switches that each toggle a set of lamps, find how many flips are made cycling 1..N until all lamps are off, or -1 if never. | Medium7 | SimulationMath+2 | No attempts yet | 2s | 512 MB | Judgeable |
| BAZE RUNNERA 4-wide maze has one gap per middle row; find the fewest moves to go from top-left to bottom-right when the player may also shift a row's wall left or right. | Medium7 | BFSGraph+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Super Cheap Party RoomsManage a row of N rooms across new/in/out queries, placing each new room in the leftmost gap of size Y and cleaning it when its guests leave. | Medium7 | IntervalsSimulation+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Emergency EvacuationGiven a bus seat layout and passenger positions, compute the minimum number of synchronous steps until all passengers exit through the rear aisle. | Medium7 | GreedySorting+2 | No attempts yet | 3s | 512 MB | Judgeable |
| Get to Work, Lute!Chemicals with given viscosities travel in order through M pipes; find the completion time of each chemical given minimum-clearance waits between them. | Medium7 | SimulationGreedy+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Elastic CollisionsTwo bodies on a line, mass 1 at rest and mass N^2 approaching, bounce elastically between each other and a wall; count the total collisions before both move right forever. | Medium7 | SimulationMath+2 | No attempts yet | 3s | 256 MB | Judgeable |
| Expansion GameSimulate multiple players expanding castles across a grid by up to S_i steps per turn until no one can move; report final castle counts. | Medium7 | BFSGraph+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Castle DefensePlace 3 archers on the wall row so that the total number of enemies killed by their attacks before reaching the wall is maximized. | Medium7 | Brute forceSimulation+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Laboratory 2Place M viruses among up to 10 candidate cells in an N×N grid with walls; minimize the time until every empty cell is infected, or report -1. | Medium7 | BFSBrute force+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Laboratory 3Given a grid with walls and up to 10 viruses, choose M of them to activate simultaneously and minimize the time until the virus fills every empty cell, or print -1. | Medium7 | BFSBacktracking+2 | No attempts yet | 0.25s | 512 MB | Judgeable |
| Fine Dust, Goodbye!Simulate T seconds of dust diffusion on a grid plus the circular wind from a two-cell air purifier, then sum the remaining dust. | Medium7 | SimulationImplementation+2 | No attempts yet | 1s | 512 MB | Judgeable |
| HashgraphBuild a hashgraph from M directed communications, then decide whether one given event can reach another through the precedence (see) relation. | Medium7 | GraphDFS+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Sehun's Gift ShopSimulate two workers racing to wrap gifts from a shared front queue, respecting order arrival times and a tie-break rule, then report which gift numbers each wrapped. | Medium7 | SimulationImplementation+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Unify the ColorsFor each button, compute the minimum presses needed to unify all colors when allowed to press only that button. Output the leftmost button with the smallest count. | Medium7 | ImplementationArray+2 | No attempts yet | 1s | 512 MB | Judgeable |
| DVDA DVD logo rectangle bounces off the TV walls; find the earliest time its corner reaches a TV corner, or report that it never does. | Medium7 | MathNumber theory+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Ant in a Hexagonal WebOn an infinite hexagonal web, count the ant walks that make exactly N turns before first revisiting a vertex, where the first step is fixed north. | Medium7 | DFSBacktracking+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| Disrupting DefenseFind a sequence of n/2 attacks removing adjacent differently valued soldiers from a circular ring until all are gone, or report impossible. | Medium7 | GreedyStack+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Rectilinear PolygonGiven a simple rectilinear polygon's vertices in clockwise order, find the maximum number of vertical edges a horizontal line can cross (h) and the maximum number of horizontal edges a vertical line can cross (v), then output max(h, v). | Medium7 | GeometrySorting+2 | No attempts yet | 1s | 512 MB | Judgeable |
| TrapCount the self-avoiding walks of n unit grid steps that start at (0,0) going right and are trapped: no further step can be added without self-intersection. | Medium7 | BacktrackingDFS+2 | No attempts yet | 2s | 512 MB | Judgeable |
| New Game 2Simulate turns moving K stacked pieces on an N x N colored board, following white, red, and blue square rules, and report the turn when four pieces stack or -1. | Medium7 | SimulationImplementation+2 | No attempts yet | 0.5s | 512 MB | Judgeable |
| CarsTwo axis-aligned rectangular cars move at constant speed in a grid city for t seconds; decide whether they ever overlap in a positive-area region, treating edge-only touches as safe. | Medium7 | GeometryImplementation+2 | No attempts yet | 1s | 512 MB | Judgeable |
| AssassinsGiven chronological assassination attempts with success probabilities, find the probability each of n assassins is alive at the end, where a dead assassin's attempts are cancelled. | Medium7 | ProbabilityDynamic programming+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Ladder GameGiven a ladder (Amidakuji) whose bars have depths, find every bar that can be removed without changing the permutation it induces. | Medium7 | SimulationGreedy+2 | No attempts yet | 1s | 512 MB | Judgeable |
| A+B ProblemAdd two huge integers given as run-length encoded digit blocks and print the sum in the same compressed format. | Medium7 | ImplementationSimulation+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Card DroppingGiven the technique used for each dropped card in order, reconstruct the initial top-to-bottom ordering of cards 1..N that produces a sorted pile. | Medium7 | SimulationLinked list+2 | No attempts yet | 2s | 1024 MB | Judgeable |
| MastermindGuess a hidden 4-digit sequence over six colors using at most K red/white feedback queries per game, for T games. | Medium7 | Brute forceSimulation+2 | No attempts yet | 3s | 512 MB | Judgeable |
| Gunwoo Trapped in a MazeFind the earliest day and time of day to reach the goal in an n x n maze where every m moves flip between day and night; at night he can pass through consecutive walls in a straight line. | Medium7 | BFSGraph+2 | No attempts yet | 1s | 256 MB | Judgeable |
| The Assembly CodeGiven a corrupted assembly program with five arithmetic or bitwise ops hidden behind letters A to E, plus k input-output logs, count the letter-to-operation assignments consistent with every log and print the unique one. | Medium7 | SimulationBrute force+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Pawn's RevengePlace the fewest pawns on an N by N board so that every enemy piece is attacked diagonally from below, given a king that also attacks adjacent squares and blocks placement. | Medium7 | GreedySimulation+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Journey to JupiterGiven a rotated equilateral triangle's normal vector and vertex A position, compute the lengths of three actuators connecting its vertices to a base point. | Medium7 | GeometryMath+2 | No attempts yet | 6s | 512 MB | Judgeable |
| Swapity Swapity SwapApply a fixed sequence of M range reversals to an array of N elements K times, and print the final arrangement; K can be up to 1e9. | Medium7 | ImplementationMath+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Cowntact TracingGiven a final set of infected cows and a time-stamped list of hoof-shake pairs, count possible patient-zero cows and the range of transmission limits K consistent with the data. | Medium7 | SimulationBrute force+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Japanese FoodSimulate a restaurant where the cook batches identical dishes across pending orders under per-dish limits, and report each order's completion time. | Medium7 | SimulationImplementation+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Coal MineAssign each unit square one of k coal types so that the cells of type i are point-symmetric about elevator i, or report that no such assignment exists. | Medium7 | ImplementationSimulation+2 | No attempts yet | 0.5s | 64 MB | Judgeable |
| Tic-tac-toeFor each 3x3 tic-tac-toe board, decide whether it is invalid, reachable only by non-optimal play, or reachable by two perfect players. | Medium7 | Game theorySimulation+2 | No attempts yet | 5s | 512 MB | Judgeable |
| Adult SharkSimulate a grid of sharks that each move by fixed directional priorities, leave fading scent trails, and eat the weaker shark when they collide, until only shark 1 is left. | Medium7 | SimulationImplementation+2 | No attempts yet | 1s | 512 MB | Judgeable |
| BallsMaintain a set of unit-diameter balls on a line with a wall; support insertions at free spots and repeatedly roll the leftmost ball, propagating collisions until it stops, then print all final positions. | Medium7 | SimulationHash map+2 | No attempts yet | 1s | 256 MB | Judgeable |
| RumorGiven a graph and initial spreaders, each uninfected person adopts the rumor once more than half of their neighbors believe it; report the adoption minute for everyone. | Medium7 | GraphBFS+2 | No attempts yet | 10s | 1024 MB | Judgeable |
| Random GeneratorSimulate repeatedly picking the p-th remaining copy from a multiset where value i appears w_i times, and output the order in which values are exhausted. | Medium7 | Segment treeBinary search+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| Fuel StationFind the minimum starting fuel F so Pengu reaches distance D, where each station i adds Ai litres if the starting F is at most Bi. | Medium7 | Binary searchGreedy+2 | No attempts yet | 3s | 512 MB | Judgeable |
| Table TransformationApply up to a million row, column, and cell swaps to a large grid, then output a weighted modular checksum; the operation list is generated by a linear recurrence. | Medium7 | SimulationArray+2 | No attempts yet | 4s | 512 MB | Judgeable |
| ShadowGiven a grid room with one point light source and wall cells blocking light, compute the total area of empty cells lying in shadow. | Hard8 | GeometrySimulation+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Paper FoldingGiven an N by M grid of integers, repeatedly fold it along row or column lines so overlapping cells sum, and find the maximum value obtainable in any cell. | Hard8 | Dynamic programmingIntervals+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Zero Run PatternGiven two binary strings repeated in a growing pattern, find the first position within the first 10^16 characters where C consecutive zeros occur. | Hard8 | StringBinary search+2 | No attempts yet | 2s | 128 MB | Judgeable |
| FlippingGiven A zeros and B ones, find the minimum number of turns needed to flip exactly K chosen values each turn until all become 1, or -1 if impossible. | Hard8 | BFSMath+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Paper RacingFind the minimum number of turns for a car with adjustable integer velocity to reach the finish, where each turn changes each velocity component by at most 1 and the straight path must avoid obstacles until it hits the finish. | Hard8 | BFSGraph+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Colored BallsSimulate repeatedly deleting the longest run of same-colored balls (leftmost on ties), merging neighbors after each removal, and report when the k-th original ball is deleted. | Hard8 | HeapLinked list+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Floor PlanGiven an outer rectangle and inner rectangles drawn inside it, count the number of enclosed office regions and find the area of the largest one. | Hard8 | Union-findGeometry+2 | No attempts yet | 2s | 128 MB | Judgeable |
| War - Water Instead of FireFind the minimum water volume poured at a map corner so that, no matter how flow ties resolve, the enemy cell's water height reaches at least k. | Hard8 | Binary searchHeap+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Jinuk's FarmGiven up to 50 axis-aligned square paint operations over an N up to 1000 grid, find the largest square subregion containing no fruit type 0 and at most two distinct fruit types. | Hard8 | Binary searchPrefix sum+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Quiz ShowFor N ordered quiz questions, choose right or wrong answers to maximize score: correct answers earn coins and points, hitting M coins gives a bonus, wrong answers reset coins and cost points. | Hard8 | Dynamic programmingArray+2 | No attempts yet | 5s | 128 MB | Judgeable |
| Word RollingGiven N cyclic letter wheels rotating one step per second, find the earliest time t when all wheels simultaneously display a given target string, using CRT-style reasoning, or report -1. | Hard8 | Number theoryMath+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Balance ScalePlace weights 1..n into two mirror-shaped binary trees filled level by level under BST-like ordering rules so both sides balance in total weight, or report impossible. | Hard8 | TreeSimulation+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Students' Study StylesGiven statements from students of four truthfulness types depending on day or night, determine which facts about identities and time must hold in every consistent scenario. | Hard8 | Brute forceImplementation+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Burger KingSimulate multiple restaurant queues with dynamic employee replacements and arrivals, tracking the optimal switching strategy to find when the team can order. | Hard8 | SimulationGreedy+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Cheap but SimilarGiven a mineral row, decide whether equipment covering 1-3 consecutive cells can be placed to mine at least 75% of the total, and construct a valid placement if so. | Hard8 | GreedyDynamic programming+1 | No attempts yet | 7s | 16 MB | Judgeable |
| Surveillance RobotDetermine every x-axis interval where a robot could stand so that the angular sweep order of chimneys matches a given observed shape sequence. | Hard8 | GeometrySorting+1 | No attempts yet | 2s | 128 MB | Judgeable |