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 results868 problems
| Title | Level | Topics | Solved | Time limit | Memory limit | Judge |
|---|---|---|---|---|---|---|
| Matrix AdditionRead two N by M integer matrices and print their element-wise sum. | Easy1 | MatrixImplementation | No attempts yet | 1s | 128 MB | Judgeable |
| WężykPrint the numbers 1 to n squared in n rows that alternate between left-to-right and right-to-left order. | Easy1 | SimulationMatrix | No attempts yet | 1s | 128 MB | Judgeable |
| Crossword puzzle decorationSurround the M by N letter grid with the given padding and fill the added cells with alternating # and . by row plus column parity. | Easy1 | ImplementationMatrix | No attempts yet | 1s | 128 MB | Judgeable |
| The Princess and the Magic MirrorPrint an N by N picture unchanged, mirrored left to right, or flipped top to bottom according to the given mood number. | Easy1 | MatrixImplementation | No attempts yet | 2s | 256 MB | Judgeable |
| Hot fish-shaped bunPrint the given N by M binary picture mirrored left to right. | Easy1 | MatrixImplementation | No attempts yet | 1s | 32 MB | Judgeable |
| RectangleImplement a Rectangle class with width and height, range-checked setters, and methods for area, perimeter, and square detection. | Easy1 | ImplementationMath+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Floor DecorationCount the number of wooden planks by counting maximal runs of consecutive '-' in each row and '|' in each column of a grid. | Easy2 | MatrixImplementation+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Find Places to Lie DownCount maximal horizontal and vertical runs of at least two consecutive empty cells in an N x N grid. | Easy2 | MatrixSimulation | No attempts yet | 2s | 128 MB | Judgeable |
| Matrix MultiplicationRead two matrices of bounded size and print their standard matrix product. | Easy2 | MatrixImplementation | No attempts yet | 1s | 128 MB | Judgeable |
| Monster TruckCount 2x2 blocks in a grid without any building, grouped by how many parked cars they contain (0 to 4). | Easy2 | MatrixImplementation | No attempts yet | 1s | 128 MB | Judgeable |
| MinesweeperGiven a grid of mines and empty cells, replace each empty cell with the count of mines in its eight neighbors. | Easy2 | SimulationImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| The PaintingRead an n by m grid of . and # characters and print it rotated 90 degrees clockwise, producing m rows of n characters. | Easy2 | ArrayMatrix+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Tidying the Banquet TablesFour teams sit mixed across four tables, and you assign one team to each table so the fewest guests move. | Easy2 | Brute forceMatrix | No attempts yet | 1s | 128 MB | Judgeable |
| WoodwormsCount the table squares each woodworm ate and report the name of the one that ate the most. | Easy2 | MatrixImplementation | No attempts yet | 1s | 128 MB | Judgeable |
| Crossword Puzzle Clue NumberingScan the letter grid, number each square that starts an across or down word, and list every entry number with its letter count. | Easy2 | SimulationMatrix+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Painting PartyPaint up to 100 filled or one-pixel-border rectangles in order on an N by N grid and print the final colors. | Easy2 | SimulationMatrix | No attempts yet | 5s | 128 MB | Judgeable |
| BoxesBoxes fall straight down in each column of a grid, and the program sums how many cells all boxes move. | Easy2 | SimulationMatrix | No attempts yet | 1s | 256 MB | Judgeable |
| Roman Catholic MassThe program seats the latecomer in the empty spot with the most occupied neighbors and counts every adjacent occupied pair once. | Easy2 | Brute forceMatrix+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Contest Venue SetupCount the schools that have two of their teams seated in king-adjacent cells of an N by M grid with empty seats. | Easy2 | MatrixImplementation | No attempts yet | 1s | 128 MB | Judgeable |
| Magic SquaresCheck each test case square by comparing every row, column, and both diagonal sums and report whether it is magic. | Easy2 | MatrixSimulation | No attempts yet | 1s | 256 MB | Judgeable |
| Queens on Bad TermsCheck an 8x8 board holding eight queens and print valid only when no two queens share a row, column, or diagonal. | Easy2 | ImplementationMatrix | No attempts yet | 1s | 256 MB | Judgeable |
| Crossword Clue NumberingScan the grid for empty cells that begin a word of at least three cells across or down and print them in reading order. | Easy2 | ImplementationMatrix | No attempts yet | 1s | 256 MB | Judgeable |
| Secret MessagePad each message with asterisks to a square, rotate the square 90 degrees clockwise, then read it row by row without asterisks. | Easy2 | MatrixSimulation | No attempts yet | 2s | 256 MB | Judgeable |
| Coverity CrosswordDecide whether every listed word appears horizontally, vertically, or diagonally in an 8 by 8 letter grid. | Easy2 | String matchingMatrix+1 | No attempts yet | 2s | 256 MB | Judgeable |
| Crushing ConfectionsFind the lexicographically smallest row or column triple of equal candies in each grid and print its positions. | Easy2 | MatrixImplementation | No attempts yet | 1s | 256 MB | Judgeable |
| Black and White PanelPrint the fixed 101-column black and white grid whose isolated single tiles yield exactly b black areas and w white areas. | Easy2 | ImplementationMatrix | No attempts yet | 2s | 256 MB | Judgeable |
| Lucky ChancesCount over every grid cell how many of the four directions contain only smaller numbers or reach the edge. | Easy2 | Brute forceMatrix+1 | No attempts yet | 2s | 256 MB | Judgeable |
| Tiling recordGiven a floor tiled with 1 by n tiles labeled by number, list each tile as h or v in row-major order of its first cell. | Easy2 | SimulationMatrix+1 | No attempts yet | 1s | 256 MB | Judgeable |
| gMatrix (Small)Build the matrix from the given formula and add the largest entry of every K by K consecutive submatrix. | Easy2 | Brute forceMatrix+1 | No attempts yet | 5s | 512 MB | Judgeable |
| BazaCount the database rows that match each query in every column not marked -1. | Easy2 | Brute forceMatrix | No attempts yet | 1s | 64 MB | Judgeable |
| Tic-Tac-Toe-Tomek (Small)Given a 4 by 4 tic-tac-toe board with a wildcard T, report whether X won, O won, the game is a draw, or play continues. | Easy2 | ImplementationMatrix | No attempts yet | 5s | 512 MB | Judgeable |
| Tic-Tac-Toe-Tomek (Large)Given a 4x4 tic-tac-toe board with a wildcard T, report whether X won, O won, the game is a draw, or play continues. | Easy2 | ImplementationBrute force+1 | No attempts yet | 5s | 512 MB | Judgeable |
| Tic Tac ToeRead a 3x3 board of X, O, and dots and print YES if some row, column, or diagonal has three equal non-dot symbols. | Easy2 | ImplementationMatrix+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Magic SquaresGiven a 4x4 grid, check whether all four row sums and all four column sums are equal, then print whether it is magic. | Easy2 | ImplementationMatrix | No attempts yet | 2s | 512 MB | Judgeable |
| Magic SquareGiven an N by N matrix, decide whether its entries form a magic square with equal row, column, and diagonal sums. | Easy2 | ImplementationMatrix+1 | No attempts yet | 1s | 512 MB | Judgeable |
| Matrix Multiplication CalculatorRead pairs of matrices with dimension lines, multiply them when the inner dimensions match, and print each result row wrapped in vertical bars, or print undefined. | Easy2 | ImplementationMatrix+2 | No attempts yet | 2s | 512 MB | Judgeable |
| SculptureGiven a grid of distinct neighboring heights, mark each interior cell with 1 if all four adjacent cells are higher, otherwise 0. | Easy2 | ArrayImplementation+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Number SquareGiven an N by M grid of digits, find the area of the largest axis-aligned square whose four corner cells share the same digit. | Easy3 | Brute forceMatrix+1 | No attempts yet | 2s | 128 MB | Judgeable |
| FriendsGiven an N x N friendship matrix (N ≤ 50), find the maximum count of people reachable within two friendship links from any single person. | Easy3 | GraphMatrix+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Come Back HomeCount simple paths of exact length K from the bottom-left to the top-right cell of a small grid, avoiding blocked cells and revisits. | Easy3 | BacktrackingDFS+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Maze ConstructionSimulate a sequence of forward moves and turns on a grid, then print the smallest rectangular map marking visited cells as passable and the rest as walls. | Easy3 | SimulationImplementation+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Woodcut TracesSimulate a tool moving on an N by N grid following U/D/L/R commands, ignoring out-of-bounds moves, and mark each point as unvisited, vertical-only, horizontal-only, or both. | Easy3 | SimulationMatrix+1 | No attempts yet | 2s | 128 MB | Judgeable |
| CipherGiven an encrypted string built by zigzag row reading of a column-filled table, reconstruct the original string for a given number of columns. | Easy3 | SimulationMatrix+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Median FilterApply a 3x3 median filter over an image and count filtered pixels whose median value is at least a given threshold. | Easy3 | MatrixSorting+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Painted AreasCount connected components of 1-cells in a grid (4-directional adjacency) and output the count and the size of the largest component. | Easy3 | BFSDFS+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Integer TriangleGiven a triangle of up to 500 rows, compute the maximum sum path from top to bottom moving diagonally at each step. | Easy3 | Dynamic programmingMatrix | No attempts yet | 2s | 128 MB | Judgeable |
| Snail 2Simulate a snail-like spiral fill on an M by N grid and count how many times the path turns before every cell is visited. | Easy3 | SimulationMatrix+1 | No attempts yet | 2s | 128 MB | Judgeable |
| MinesweeperGiven an N x N minesweeper grid with mine counts (possibly multi-mine cells), output each empty cell's summed adjacent mine count, capping at 'M' for 10+. | Easy3 | MatrixSimulation+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Completing a Magic SquareGiven a 3x3 magic square with up to three cells erased (marked 0), fill in the missing positive integers so all rows, columns, and diagonals share the same sum. | Easy3 | MathMatrix+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Downward GameGiven an N x 3 grid with limited column transitions between rows, compute the maximum and minimum total path sums from top to bottom. | Easy3 | Dynamic programmingMatrix | No attempts yet | 1s | 4 MB | Judgeable |
| Picture ComparisonGiven N small 5x7 grids, find the pair of pictures with the fewest differing cells and output their indices. | Easy3 | Brute forceMatrix+1 | No attempts yet | 2s | 128 MB | Judgeable |
| 2D Array Range SumBuild a 2D prefix sum over an N by M grid and answer up to 10,000 rectangle sum queries in O(1) each. | Easy3 | Prefix sumMatrix+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Maze SearchFind the minimum number of cells traversed on a grid path from top-left to bottom-right using BFS shortest path. | Easy3 | BFSGraph+1 | No attempts yet | 1s | 192 MB | Judgeable |
| Magic Square ClassificationRead multiple square matrices and classify each into one of five magic square categories based on row, column, diagonal sums, distinctness, and consecutiveness. | Easy3 | MatrixImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Candy Doctor ChangyoungScan a character grid to count fixed 3-cell horizontal ('>o<') or vertical ('v/o/^') candy patterns. | Easy3 | MatrixImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| BingoSimulate marking a 5x5 bingo board as numbers are called and find the call count when 3 lines (rows, columns, or diagonals) are first completed. | Easy3 | SimulationArray+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Making Colored PaperRecursively quadtree-split an N×N grid of 0/1 cells into uniform-color squares and count the resulting white and blue pieces. | Easy3 | RecursionDivide and conquer+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Secret EmailGiven an encrypted string, find matrix dimensions R<=C with R*C=N and largest R, then reverse a row-major-write column-major-read transposition to recover the original message. | Easy3 | MatrixString+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Marathon Tic-Tac-ToeScan an N by N board to find if any letter forms three consecutive equal marks in a row, column, or diagonal, and print that letter or 'ongoing'. | Easy3 | MatrixSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| GameGiven many filled 5x5 tic-tac-toe boards, determine for each whether A, B, or neither has three consecutive same marbles in a row, column, or diagonal. | Easy3 | MatrixSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Building for the UNPrint a fixed two-floor n by n grid where the lower floor's rows and upper floor's columns each represent a labeled country, satisfying a connectivity and adjacency construction. | Easy3 | ImplementationSimulation+1 | No attempts yet | 3s | 128 MB | Judgeable |
| Laser Turret MaintenanceGiven a conflict-free n-queens configuration as a column vector, output the eight rotations and reflections in a fixed order with three-character right-justified fields. | Easy3 | ImplementationMatrix+2 | No attempts yet | 1s | 128 MB | Judgeable |
| GymGiven an N by N matrix of card counts, compute the probability distribution over N baskets for the first 10 steps of a Markov process starting at basket 1. | Easy3 | MathMatrix+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Number of IslandsGiven a grid of land and sea cells with 8-directional adjacency, count the connected land components. | Easy3 | GraphDFS+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Red and BlackCount how many black tiles are reachable from a start tile in a small grid by moving up, down, left, and right. | Easy3 | DFSGraph+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Global WarmingGiven a small land/sea grid, mark every land cell with three or more sea neighbours as sea simultaneously, then print the tight bounding box of the remaining land. | Easy3 | ArraySimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| spiral123Given n, construct the prescribed n by n spiral123 matrix using the recursive definition from M(n-6) plus a fixed 6 by 6 corner pattern. | Easy3 | MatrixImplementation | No attempts yet | 1s | 64 MB | Judgeable |
| Asteroid FieldFind the minimum number of moves from the top-left cell to the bottom-right cell in a grid, avoiding asteroid cells. | Easy3 | BFSGraph+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Commute RouteCount monotone east/north lattice paths from (1,1) to (a,b) that avoid n blocked intersections, with a and b at most 16. | Easy3 | Dynamic programmingCombinatorics+2 | No attempts yet | 1s | 128 MB | Judgeable |
| A Spiral WalkFill an N by N grid with the visit order of a clockwise spiral that starts at the top-left and ends near the center. | Easy3 | SimulationMatrix+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Invasion of the MilkweedSpread milkweed from a start cell to all eight neighbors each week and report the week it covers the last non-boulder cell. | Easy3 | BFSGraph+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Feeding TimeGiven a W by H grid of grass and rock, find the size of the largest connected grass region using 8-directional adjacency. | Easy3 | DFSBFS+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Bad GrassCount connected components of nonzero cells in a grid, where two cells connect if they touch horizontally, vertically, or diagonally. | Easy3 | GraphDFS+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Plumbing the PondGiven a grid of depth readings, find the largest positive value that appears in at least two cells adjacent horizontally, vertically, or diagonally. | Easy3 | ArrayImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Mouse JourneyCount monotone right/down paths on an R by C grid from (1,1) to (R,C) that avoid K blocked cat cells. | Easy3 | Dynamic programmingMatrix+1 | No attempts yet | 2s | 512 MB | Judgeable |
| ClassGiven a grid of digits, sum each cell's average absolute difference from its up to four orthogonal neighbors, and print the total with four decimals. | Easy3 | ImplementationMatrix+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| Nash EquilibriumGiven two m by n payoff matrices for players A and B, list every action pair where each player's action is a best response to the other's. | Easy3 | Brute forceMatrix+1 | No attempts yet | 1s | 128 MB | Judgeable |
| The Chosen Sub MatrixFor each N x N matrix, find the M x M sub matrix with the fewest distinct values, breaking ties by larger descending value lists, then by smaller top-left row and column. | Easy3 | Brute forceImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Sudoku CheckerGiven an N^2 by N^2 grid with zeros for blanks, decide whether every row, column, and N by N square holds distinct nonzero numbers. | Easy3 | Hash mapImplementation+1 | No attempts yet | 2s | 128 MB | Judgeable |
| The HareFind the fewest knight jumps from the start cell to the burrow on a grid with blocked cells, or output NIE when unreachable. | Easy3 | BFSGraph+1 | No attempts yet | 1s | 512 MB | Judgeable |
| LagnoCount the most white pieces a single black move flips on an 8 by 8 Othello board. | Easy3 | SimulationMatrix+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Taxi RoutesCount the routes from the southwest to the northeast corner of a grid up to 30 by 30 that move only east or north and avoid blocked intersections. | Easy3 | Dynamic programmingMatrix | No attempts yet | 1s | 128 MB | Judgeable |
| Sudoku GradingCheck each filled 9x9 board and report whether every row, column, and 3x3 box holds the digits 1 to 9 exactly once. | Easy3 | ImplementationMatrix | No attempts yet | 1s | 128 MB | Judgeable |
| Robot in a MazeFind the fewest up, down, left, or right moves from S to any G in each grid maze, or report that no exit exists. | Easy3 | BFSMatrix | No attempts yet | 1s | 128 MB | Judgeable |
| CrankCount the boundary rooftops that can reach the boss by moving only to equal or lower adjacent buildings. | Easy3 | BFSGraph+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Rainforest CanopyCount the groups of 1s connected through all eight neighbours in each square binary image. | Easy3 | DFSGraph+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Surface AreaGiven column heights on a grid, compute the total exposed surface area of the solid, including top, sides, and floor. | Easy3 | SimulationMatrix | No attempts yet | 1s | 128 MB | Judgeable |
| Mini Sudoku XRead 6 by 6 grids and report whether each row, column, diagonal, and 2 by 3 block holds digits 1 to 6 exactly once. | Easy3 | ImplementationMatrix | No attempts yet | 1s | 256 MB | Judgeable |
| Knight MovesFind the fewest knight moves from K to X on a grid with blocked squares, or output -1 when unreachable. | Easy3 | BFSMatrix | No attempts yet | 1s | 128 MB | Judgeable |
| Elephant ShowCount the yellow tiles reachable from the elephant start by moving up, down, left, or right. | Easy3 | DFSMatrix | No attempts yet | 1s | 128 MB | Judgeable |
| GeckoPick a top-row tile and move straight down, down-left, or down-right each row to maximize the mosquitoes eaten. | Easy3 | Dynamic programmingMatrix | No attempts yet | 2s | 512 MB | Judgeable |
| Playing Fair with CryptographyGiven a key and a plaintext, build the 5x5 Playfair grid and encrypt the text into digraphs with cycling filler letters. | Easy3 | SimulationImplementation+2 | No attempts yet | 2s | 128 MB | Judgeable |
| RockyA horse walks straight across a grid and turns by fixed rules when a rock blocks it; report the exit square and the number of stepped squares. | Easy3 | SimulationMatrix | No attempts yet | 1s | 128 MB | Judgeable |
| Quadtree Image CompressionCount the bits produced by recursively splitting an L by L binary image into quadrants until each block is uniform. | Easy3 | Divide and conquerRecursion+1 | No attempts yet | 2s | 1024 MB | Judgeable |
| Frogger's For DinnerSimulate a frog walking down a 10 by 10 road while cars wrap around their lanes and decide if any starting column reaches the far side alive. | Easy3 | SimulationBrute force+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Asteroids!Find the shortest 6-directional path through an N by N by N grid with blocked cells, or report that no route exists. | Easy3 | BFSMatrix | No attempts yet | 1s | 128 MB | Judgeable |
| Color WeaknessCount connected R, G, B regions in an N by N grid twice, once normally and once with R and G merged. | Easy3 | BFSMatrix | No attempts yet | 1s | 128 MB | Judgeable |
| Colored PaperCompute the area of each of N overlapping axis-aligned rectangles that stays visible after later rectangles cover it. | Easy3 | SimulationMatrix+1 | No attempts yet | 1s | 64 MB | Judgeable |
| Minion WalkMark every grid cell reachable from the top-left corner, print the room as an ASCII table, and report whether the bottom-right cell is reachable. | Easy3 | BFSMatrix+1 | No attempts yet | 1s | 256 MB | Judgeable |
| The Trojan HorseMark all cells visited by patrol routes on an h by w grid, then count 4-connected unvisited regions with at least s cells. | Easy3 | DFSSimulation+1 | No attempts yet | 1s | 256 MB | Judgeable |