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 results312 problems
| Title | Level | Topics | Solved | Time limit | Memory limit | Judge |
|---|---|---|---|---|---|---|
| Stone Game 5Two players alternately take 1 or 3 stones from a pile of N, and the program prints SK or CY for optimal play. | Easy2 | Game theoryMath | No attempts yet | 1s | 128 MB | Judgeable |
| Towers of CoinsGiven move options 1, K, or L coins in a Nim-like turn game, determine for each pile size whether the first player wins under optimal play. | Easy3 | Dynamic programmingGame theory | No attempts yet | 1s | 128 MB | Judgeable |
| The Stone GamePlayers alternately remove 1 to K of N stones, and the player taking the last stone wins each test case. | Easy3 | Game theoryMath | No attempts yet | 1s | 128 MB | Judgeable |
| Stone GameTwo players alternately take 1 or 3 stones from a pile of N, and the program names the winner under perfect play. | Easy3 | Dynamic programmingGame theory | No attempts yet | 1s | 128 MB | Judgeable |
| Stone Game 2Two players alternately take 1 or 3 stones from a pile of N and the player taking the last stone loses, so print whether the first player wins. | Easy3 | Game theoryDynamic programming | No attempts yet | 1s | 128 MB | Judgeable |
| Stone Game 3Two players alternately take 1, 3, or 4 stones from a pile of N, and the program reports whether the first player wins with perfect play. | Easy3 | Dynamic programmingGame theory | No attempts yet | 1s | 128 MB | Judgeable |
| Stone Game 4Two players alternately take 1, 3, or 4 stones and the player taking the last stone loses; report whether the first player wins with optimal play. | Easy3 | Dynamic programmingGame theory | No attempts yet | 1s | 128 MB | Judgeable |
| Stone Game 6Two players alternately take 1, 3, or 4 stones from a pile of N, and the program prints which player wins with perfect play. | Easy3 | Game theoryDynamic programming | No attempts yet | 1s | 128 MB | Judgeable |
| Falling ApartGiven up to 15 positive integers, two players alternately take one piece; find the final sums under optimal play. | Easy3 | Dynamic programmingGame theory+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Alpha Tic-Tac-ToeGiven a 3x3 tic-tac-toe board with X to move or O to move, find whether the side to move can force a win, a draw, or only a loss under perfect play. | Easy3 | Game theoryRecursion+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Marble GameCompute Grundy-style win/lose states for a two-pile subtraction game with three fixed move sizes and report the winner for five given starting positions. | Medium4 | Dynamic programmingGame theory+1 | No attempts yet | 1s | 128 MB | Judgeable |
| JohnDetermine the winner of a Nim-like misère game where players remove same-colored candies from piles and taking the last candy loses. | Medium4 | Game theoryBit manipulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| PousseSimulate the push game on an N by N board and report which color first has more complete rows or columns, or a tie at QUIT. | Medium4 | SimulationImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Tic Tac ToeGiven a 3x3 Tic Tac Toe grid, decide whether some legal sequence of moves could produce exactly that position. | Medium4 | ImplementationSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Card GameBoth players alternately take the left or right end card to maximize their own sum, and you compute the first player best total score. | Medium4 | Dynamic programmingGame theory | No attempts yet | 1s | 256 MB | Judgeable |
| Box Splitting GameDecide whether the first or second player wins the two-box stone-splitting game from starting counts N and M. | Medium4 | Game theoryDynamic programming | No attempts yet | 2s | 512 MB | Judgeable |
| Nim Game 2Two players alternately remove stones from one of N piles and the player taking the last stone wins, so decide the winner under optimal play. | Medium4 | Game theoryBit manipulation | No attempts yet | 2s | 512 MB | Judgeable |
| WhistGiven the trump suit and the 52 cards played across 13 tricks, determine which team won and by how many tricks above six. | Medium4 | SimulationImplementation+1 | No attempts yet | 8s | 512 MB | Judgeable |
| Irrational DivisionTwo players alternately cut whole columns off the west and rows off the south of a p by q chessboard chocolate; compute the optimal final score difference. | Medium4 | Game theoryDynamic programming | No attempts yet | 2s | 512 MB | Judgeable |
| Jogo de BocaGiven the target N, decide whether the first player can win the 1-2 counting game and which opening move (1 or 2) wins. | Medium4 | Game theoryMath | No attempts yet | 1s | 1024 MB | Judgeable |
| Breaking BranchesTwo players alternately split pieces of a length n branch into integer parts; the last to move wins. Decide the winner and give Alice's winning first move. | Medium4 | Game theoryMath+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Don't Split The Atom!Two players alternately split a pile of atoms, and whoever is forced to split a single atom loses; decide the winner for each n. | Medium4 | Game theoryMath+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Substring Picking GamePlayers alternately subtract a value formed by a proper substring of the current number's digits, and you must find the smallest first move that forces a win, or -1 if none exists. | Medium5 | Game theoryDynamic programming+2 | No attempts yet | 2s | 256 MB | Judgeable |
| Number GameGiven a set of numbers including 1 and a limit K, find the first integer that cannot be formed using at most K chosen numbers, then decide the game winner by turn parity. | Medium5 | Dynamic programmingMath+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Multiplication GameAlice and Bob multiply a running product by 2 to 9 in turn; find who forces the product to reach n first with optimal play. | Medium5 | Game theoryDynamic programming+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Cow Digit GameFor each starting number, players alternately subtract its largest or smallest nonzero digit, and the player who reaches 0 wins; decide if the first player wins. | Medium5 | Dynamic programmingGame theory+2 | No attempts yet | 1s | 128 MB | Judgeable |
| NukitGiven counts of particles A, B, C, D, two players alternately remove one of five fixed multisets; find who wins under optimal play. | Medium5 | Game theoryDynamic programming+2 | No attempts yet | 1s | 128 MB | Judgeable |
| NimGiven a Nim position, count how many single-pile moves lead to a losing position (XOR of the remaining piles equals zero). | Medium5 | Game theoryBit manipulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Stone Game 7Two players alternately remove a power of four stones from the pile, and the program reports the winner when both play perfectly. | Medium5 | Game theoryMath | No attempts yet | 1s | 128 MB | Judgeable |
| Filling a board with N-ominoes (Small)Given polyomino size X and board size R by C, decide whether the first player can choose a shape that makes the board impossible to tile. | Medium5 | GeometryGame theory+1 | No attempts yet | 5s | 512 MB | Judgeable |
| Winner of the Bubble GameTwo players alternately swap adjacent out-of-order pairs until the permutation is sorted; the one who cannot move loses. Decide the winner. | Medium5 | CombinatoricsGame theory+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Root GameFor each N, decide who wins the subtraction game where a move subtracts any perfect square from a running total and taking the last square wins. | Medium5 | Game theoryDynamic programming+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Nim Game 3Given Nim pile sizes, count how many first moves (choosing a pile and removing stones) leave the opponent in a losing position. | Medium5 | Game theoryBit manipulation+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Multiplication GameDetermine, given a real number X and up to 6 multiplier cards at most 0.9, which player forces X below or equal to 1 first under optimal play. | Medium6 | Game theoryMath+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Fibonacci GameDetermine the smallest first move in a Fibonacci-Nim-like bead-taking game that guarantees a forced win, or -1 if none exists. | Medium6 | Game theoryNumber theory+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Math GameGiven N coins in a Fibonacci-like alternating take game, find the minimum first move Sangdeok can make to guarantee a win under optimal play. | Medium6 | Game theoryMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Row and Column Deletion GameGiven an n x n matrix where players alternately remove the last row or column if its sum is even, determine which player wins with optimal play across possibly many test cases up to n=1000. | Medium6 | Game theoryDynamic programming+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Two EndsFor each even-length row of cards, find the best score margin the first player can get when the second player always takes the larger end. | Medium6 | Dynamic programmingGame theory+1 | No attempts yet | 1s | 128 MB | Judgeable |
| One Person “The Price is Right”Given G guesses and L lifelines, find the largest N such that a strategy guarantees a win for any price from 1 to N. | Medium6 | Dynamic programmingGame theory | No attempts yet | 1s | 128 MB | Judgeable |
| Euclid's GameGiven two starting numbers, decide who wins the subtraction game Euclid's Game under optimal play, for each pair until the terminating 0 0 line. | Medium6 | Game theoryMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Tobo or not ToboGiven a shuffled 3x3 Tobo board and a turn budget Y, find the minimum number of dial turns to restore the standard arrangement, or -1 if impossible within Y. | Medium6 | BFSGame theory+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Odd, Even, and ChangyeongThree players move in fixed order, each adding 1 or dividing by a prime, and each tries to minimize the smallest number they personally produce. | Medium6 | Dynamic programmingGame theory+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Drop the TriplesPlayers alternate drawing cards from a stock and may drop valid triples; each maximizes perfect triples then common triples. Report the winner or a tie. | Medium6 | GreedyDynamic programming+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Treasure ChestTwo players alternately take a coin from either end of a row of N coins; find the maximum total the first player can guarantee with optimal play. | Medium6 | Dynamic programmingGame theory+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Calendar GameOn a fixed 1900-2001 calendar, two players alternately advance a date by one day or to the same day next month; decide if the first player wins. | Medium6 | Game theoryDynamic programming+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Infinite GameGiven sets A and B of positive steps taken alternately right and left, decide whether every integer can be reached. | Medium6 | Number theoryDynamic programming+2 | No attempts yet | 5s | 128 MB | Judgeable |
| Number GameWith Ellie's responses fixed by a1..a20, decide if the first player can force reaching 0 in a subtraction game. | Medium6 | Game theoryDynamic programming+1 | No attempts yet | 1s | 128 MB | Judgeable |
| A Number GameA game on a blackboard starting from one number: split composites, subtract 1 from primes, take 1s for a point. Both play optimally; report final scores. | Medium6 | Game theoryNumber theory+2 | No attempts yet | 1s | 128 MB | Judgeable |
| PebblesPiles are sorted; a move reduces one pile without breaking the order. Determine whether the first player wins. | Medium6 | Game theoryGreedy+1 | No attempts yet | 3s | 512 MB | Judgeable |
| Paweł i GawełTwo players alternate moving a pawn across a grid, swapping floors whenever it enters a marked cell, each trying to hold the upper floor at the end. | Medium6 | Game theoryDynamic programming+1 | No attempts yet | 3s | 128 MB | Judgeable |
| GameTwo players alternately add to S within a range set by the current parity, and whoever first reaches F loses, so decide if the first player can force a win. | Medium6 | Game theoryDynamic programming+1 | No attempts yet | 1s | 128 MB | Judgeable |
| ChompDecide whether each 3-row Chomp position is winning and output a move to a losing position. | Medium6 | Game theoryDynamic programming | No attempts yet | 1s | 128 MB | Judgeable |
| Stone Game 8Count pile sizes up to M where the second player wins a take-away game with a fixed move set. | Medium6 | Game theoryDynamic programming+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Pizza veto votingDecide whether your vetoes can keep your favorite pizza standing when Alice always vetoes the highest-calorie kind and Bob the lowest. | Medium6 | GreedyGame theory+1 | No attempts yet | 3s | 256 MB | Judgeable |
| Christmas WheatMirko raises one shortest stalk to the next height and Slavko lowers one tallest stalk until two distinct heights remain; report the winner and both extremes. | Medium6 | SortingPrefix sum+2 | No attempts yet | 1s | 32 MB | Judgeable |
| Coin Turning GameGiven a row of heads and tails, decide if the first player wins the interval-flip game and report the smallest winning first move. | Medium6 | Game theoryDynamic programming+2 | No attempts yet | 2s | 256 MB | Judgeable |
| Ultimate Tic-Tac-ToeGiven a partially played shrinking-board tic-tac-toe position, output the lexicographically smallest optimal next move under optimal play. | Medium6 | Game theoryBrute force+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Card Game StrategyAlice picks t in [a, b] to maximize the gap while Bob replies with k cards whose sum is closest to t. | Medium6 | Dynamic programmingGame theory | No attempts yet | 5s | 1024 MB | Judgeable |
| NimbleEach turn slides one coin left along numbered squares, so print which player moves the last coin onto square zero under optimal play. | Medium6 | Game theoryBit manipulation | No attempts yet | 2s | 512 MB | Judgeable |
| BrattleshipFind the fewest guesses that guarantee sinking a hidden 1 by W ship on an R by C board when an adversary relocates it to fit past answers. | Medium6 | Game theoryGreedy+1 | No attempts yet | 5s | 512 MB | Judgeable |
| Filling a Board with N-OminoesFor each case with piece size X and board R by C, decide whether Richard has an X-omino that blocks every tiling or Gabriel tiles the board anyway. | Medium6 | Game theoryGeometry+1 | No attempts yet | 5s | 512 MB | Judgeable |
| Last Hit (Small)Choose which monster to shoot or when to pass on each turn so your shots land the killing blow on the most valuable monsters before the tower kills them. | Medium6 | Dynamic programmingGame theory+1 | No attempts yet | 5s | 512 MB | Judgeable |
| Deceitful War (Small)Given both players' block weights, compute Naomi's best scores under honest War rules and under optimal lying in Deceitful War. | Medium6 | GreedySorting+1 | No attempts yet | 5s | 512 MB | Judgeable |
| Google Royale (Small)Compute the best possible chance of growing A dollars to V dollars with capped doubling bets and report the largest opening bet that reaches it. | Medium6 | Dynamic programmingProbability+1 | No attempts yet | 10s | 512 MB | Judgeable |
| King (Small)On a board of at most 16 squares with burned cells, a king moves to unvisited neighbors; decide who wins under optimal play. | Medium6 | Game theoryDFS+1 | No attempts yet | 5s | 512 MB | Judgeable |
| Stick GamePlace non-overlapping horizontal sticks of given lengths on a grid with obstacles; find the winner under optimal play. | Medium6 | Game theoryImplementation | No attempts yet | 1s | 512 MB | Judgeable |
| CardsGiven an even row of cards with integers, two players alternately take an end card; the first player maximizes his total sum while the second minimizes it. Report the best score the first player can guarantee. | Medium6 | Dynamic programmingGame theory+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Kill the WerewolfFor each player assumed to be the werewolf, decide whether the villagers can outvote him; count the players who still win. | Medium6 | GreedyImplementation+2 | No attempts yet | 2s | 512 MB | Judgeable |
| MemoryGiven R times C face-down cards forming pairs, find the best-case and worst-case number of actions a perfect-memory player needs to clear the board. | Medium6 | Game theoryMath+2 | No attempts yet | 1s | 256 MB | Judgeable |
| MarblesTreat marbles as Wythoff/Nim heap coordinates and compute Sprague-Grundy values to decide if the first player wins. | Medium6 | Game theoryMath+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Absolute GameAlice and Bob alternately delete elements from their own arrays until one element remains in each; Alice maximizes and Bob minimizes the final absolute difference. | Medium6 | Game theoryGreedy+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Game of Nim EverywhereCount N in [L, R] where the Nim position (N, 2N, 3N) is a first-player win, i.e. where N xor 2N xor 3N is nonzero. | Medium6 | Game theoryBit manipulation+2 | No attempts yet | 2s | 512 MB | Judgeable |
| GameTwo players alternately claim columns they can reach; each wants to claim more columns than the other, and the winner under optimal play is reported. | Medium6 | GreedyGame theory+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Number GameGiven a sequence of numbers, determine the winner of a two-player suffix-removal game where each player takes a suffix block ending at the current rightmost element and minimizes their own total sum, for three separate games with n up to 3000. | Medium7 | Dynamic programmingGame theory+1 | No attempts yet | 2s | 128 MB | Judgeable |
| VictoryCount first moves in a circular pick-up game with adjacency constraints that force a win for the first player against an optimal second player counting odd numbers picked. | Medium7 | Dynamic programmingGame theory+1 | No attempts yet | 1s | 128 MB | Judgeable |
| BattleshipGiven two ship maps and a list of unlabeled shots, decide which admiral won under the hit-and-shoot-again turn rules. | Medium7 | SimulationBrute force+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Parencedence!Two players alternately parenthesize one operator of an expression, maximizing and minimizing the value, and two rounds with swapped first movers decide the winner. | Medium7 | Game theoryDynamic programming+2 | No attempts yet | 1s | 128 MB | Judgeable |
| The Thirty-One GameGiven a prefix of draws in the card game Thirty-One with cards 1 to 6, decide who wins from that position under perfect play with the remaining deck. | Medium7 | Game theoryDynamic programming+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Hit or MissSimulate a multi-player solitaire card game and either report the last card each player discarded or declare the position unwinnable. | Medium7 | SimulationQueue+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Find the Winning MoveGiven a 4x4 tic-tac-toe position with x to move, find the earliest cell in row-major order where x has a forced win, or report none. | Medium7 | Game theoryBacktracking+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Team DessertDesserts sit in a row; two alternating teams take from either end, and the first-picking team wants the smallest total weight it can guarantee against optimal play. | Medium7 | Dynamic programmingGame theory+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Gold Coin GameGiven S coins and a legal move set of powers of K, find the smallest first move that guarantees a win for the starting player, or 0 if none exists. | Medium7 | Game theoryMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Shuriken GameTwo players remove 1 to N shurikens from a pile, but a player cannot repeat the opponent's previous move; find the smallest winning first move. | Medium7 | Dynamic programmingGame theory+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Nim/3Three-player Nim where each player has a preferred winner; find player 1's optimal move with smallest stack then smallest count. | Medium7 | Game theoryDynamic programming+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Joyful ColoringGiven subsets of size at most 3, decide whether every subset can be made non-monochromatic under a 2-coloring. | Medium7 | BacktrackingGame theory+2 | No attempts yet | 3s | 128 MB | Judgeable |
| Queen GameGiven N queens on an R by C board that move up, left, or up-left, decide if the first player wins with optimal play. | Medium7 | Game theoryMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Cow CheckersFor each starting square on a large board, decide the winner of a two-player game with three kinds of leftward or downward moves. | Medium7 | Game theoryMath | No attempts yet | 1s | 128 MB | Judgeable |
| Number GameGiven the numbers still allowed by previous choices, list every move that leaves the opponent in a losing position, or report that none exists. | Medium7 | Game theoryDynamic programming+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Number GameGiven the available numbers from 2 to 20 in a Number Game position, list every move that leaves the opponent in a losing position. | Medium7 | Game theoryBacktracking+2 | No attempts yet | 1s | 128 MB | Judgeable |
| S-NimGiven a move set S, decide for each position whether the S-Nim game is a win or a loss by computing Grundy numbers and XORing them over the heaps. | Medium7 | Game theoryDynamic programming+2 | No attempts yet | 1s | 128 MB | Judgeable |
| A Knightly PursuitGiven board size and starting squares for a pawn and a knight, decide whether the knight can win, force a stalemate, or loses, and report the minimum knight moves. | Medium7 | BFSSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Snowball FightGiven fixed alternating throwing order and hit probabilities, players choose targets to maximize their team's win chance; compute win and draw probabilities under optimal play. | Medium7 | Game theoryProbability+2 | No attempts yet | 1s | 128 MB | Judgeable |
| VangOn a polygonal grid yard, a guard moving twice per turn chases a prisoner who can move or wait; report the guard turn when capture happens. | Medium7 | BFSGraph+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| Game on ChessboardGiven K (p,q)-leapers on an M x N board, decide which player wins the disjunctive sum of impartial games. | Medium7 | Game theoryMath | No attempts yet | 1s | 128 MB | Judgeable |
| Fighting for TrianglesOn a triangular board with some edges already drawn, two players alternate adding edges, claiming a unit triangle when their edge completes it. Decide the winner with optimal play. | Medium7 | Game theoryGraph+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Tree GameOn a tree, players alternately move a token to an unchosen neighbor from Manco's start vertex; find all start vertices where Manco wins with optimal play. | Medium7 | TreeGame theory+2 | No attempts yet | 1s | 64 MB | Judgeable |
| StripesGiven stripe lengths c, z, n, decide for each board length p whether the first player wins the impartial placement game. | Medium7 | Game theoryDynamic programming | No attempts yet | 3s | 512 MB | Judgeable |
| MusketeersGiven a tournament matrix on n people in a circle, determine everyone who can be the last survivor when adjacent duels are scheduled in any order. | Medium7 | Dynamic programmingGame theory+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Circular GameOn a circular board, white and black pieces slide over empty runs; decide with optimal play which side wins or whether play can go on forever. | Medium7 | Game theoryArray+2 | No attempts yet | 1s | 128 MB | Judgeable |
| ChocolateAn impartial chocolate-splitting game where eating the marked square loses. Count the squares whose marking makes the first player lose. | Medium7 | Game theoryMath+1 | No attempts yet | 1s | 128 MB | Judgeable |