Problems
Pick a problem and write your solution in the built-in editor. The judge runs it against real test cases while you watch, and the wider archive is open to read whenever you like.
Total results1,012 problems
| Title | Level | Topics | Solved | Time limit | Memory limit | Judge |
|---|---|---|---|---|---|---|
| ValleysGiven an N x N grid of distinct heights, sum the sizes of all non-holey edgewise-contiguous regions whose cells are strictly lower than every orthogonally adjacent border cell. | Hard9 | Union-findGraph+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Beautiful ManyeongroCount directed paths in a rooted tree whose edge-label string equals a given pattern P. | Hard9 | TrieDFS+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Wind of ChangeTwo weighted trees on the same vertex labels define a distance as the sum of both tree distances; for every vertex find the nearest other vertex under that combined metric. | Hard9 | TreeDivide and conquer+2 | No attempts yet | 10s | 1024 MB | Judgeable |
| CityAssign small integer codes to nodes of a tree where depth from node 0 is at most 18, so that a decoder with only the two codes can tell which of two cities lies on the path from 0 to the other. | Hard9 | TreeBit manipulation+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Bracket Euler TourFind an Euler tour of an undirected graph whose vertex bracket labels, read in traversal order, form a correct bracket sequence, or report that none exists. | Hard9 | GraphDFS+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Rooted SubtreesFor each query with two roots r and p, count the distinct non-empty sets that are the intersection of a subtree of the tree rooted at r and a subtree of the tree rooted at p. | Hard9 | TreeDFS+2 | No attempts yet | 11s | 512 MB | Judgeable |
| 814 - 2Print an 8 by 14 grid of digits so that every number from 1 up to some X can be traced as an adjacent-cell path, maximizing X. | Hard9 | GraphDFS+2 | No attempts yet | 0.814s | 814 MB | Judgeable |
| Karaoke MeetupIn a weighted tree, some vertices are marked as houses. For each vertex compute the ratio of the nearest marked vertex distance to the farthest, and output the maximum ratio as a reduced fraction. | Hard9 | TreeDFS+2 | No attempts yet | 8s | 512 MB | Judgeable |
| Phone CallA tree of houses has m phone lines, each letting any two vertices in the union of two tree paths call at cost w. Find the maximum number of reachable houses from house 1 and the minimum cost. | Hard9 | GraphMinimum spanning tree+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Master Zhu and RikkaGiven a rooted tree with values on vertices, answer queries that ask for the GCD of sums of values occurring exactly a times and exactly b times in a subtree or on a path. | Hard9 | TreeDFS+2 | No attempts yet | 3s | 512 MB | Judgeable |
| Pet TreeCount assignments of edge lengths (each within its own interval) to a tree's edges so the resulting tree diameter falls between S and E, modulo 1e9+7. | Hard9 | Dynamic programmingTree+2 | No attempts yet | 8s | 1024 MB | Judgeable |
| IslandGiven the edge list of a tree whose N leaves are towns and whose internal nodes all have degree at least 3, count the distinct circular orderings of the leaves realizable as the outer face, and print the count as a product of prime powers. | Hard9 | TreeDFS+2 | No attempts yet | 1s | 512 MB | Judgeable |