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,732 problems
| Title | Level | Topics | Solved | Time limit | Memory limit | Judge |
|---|---|---|---|---|---|---|
| Judge's MistakeGroup sorted road triples to maximize disjoint pairs of equal (w, endpoint multiset) triples for the cheapest surviving-road sum. | Hard8 | GreedySorting+1 | No attempts yet | 4s | 512 MB | Judgeable |
| Number Theory and ApplicationsGiven two Gaussian integers up to 10^9 in each coordinate, output every greatest common divisor in lexicographic order. | Hard8 | Number theoryMath+2 | No attempts yet | 0.2s | 16 MB | Judgeable |
| Rangers in the BusGiven each passenger's entry order and taken seat, determine which passengers could have been each of five rangers whose seat choice follows a fixed rule or a free choice. | Hard8 | SimulationGreedy+2 | No attempts yet | 2s | 512 MB | Judgeable |
| ParcelGiven n distinct integers and target w, decide whether four of them sum exactly to w. | Hard8 | Two pointersHash map+1 | No attempts yet | 1s | 512 MB | Judgeable |
| Intergalactic BiddingGiven up to 1000 bidders with huge distinct bids and a huge target s, find every bidder contained in a subset whose sum is exactly s. | Hard8 | GreedySorting+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Tree in TreeFor each vertex subset, count the edges in its minimal connecting subtree using Euler tour order and LCA checks. | Hard8 | TreeDFS+2 | No attempts yet | 6s | 512 MB | Judgeable |
| Cosmetic SurveyGiven n evaluators' ranked preference lists over m cosmetics, build the pairwise strict-preference counts and find every cosmetic X with S(X,Y) >= S(Y,X) for all Y, where S is the widest-path bottleneck strength. | Hard8 | GraphShortest path+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Secret CodeFind the probability of three uniformly timed agents meeting pairwise through their fixed waiting windows, then print the scenario indices sorted by that probability. | Hard8 | CombinatoricsGeometry+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Repeated SubstringsFind the longest substring with at least two overlapping occurrences in a string of up to 10^5 letters, breaking ties by the smallest in lexicographic order. | Hard8 | String matchingString+2 | No attempts yet | 2s | 512 MB | Judgeable |
| RectanglesGiven up to 100,000 axis-aligned rectangles drawn by XOR-flipping pixels on a white field, find the total count of black pixels. | Hard8 | Segment treePrefix sum+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Escape, Polygon!Given an integer convex polygon of up to 100000 vertices, count the triples of its sides whose supporting lines form a triangle containing the polygon. Output that count. | Hard8 | GeometryCombinatorics+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Gathering Red-Black FruitsCount how many distinct rankings of N children can arise from scoring each red fruit r and black fruit b for some positive integers r, b. | Hard8 | GeometrySorting+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Go Make It CompleteGiven a simple graph, find the largest k such that some ordering of the missing edges, adding a pair when its current endpoint degrees sum to at least k, still yields the complete graph. | Hard8 | GraphGreedy+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Hierarchical StructureGiven a rooted tree of employees and queries (a,b,l,r), compute the sum of ages in [l,r] over all vertices on the path from a to b. | Hard8 | TreeBinary search+2 | No attempts yet | 3s | 512 MB | Judgeable |
| Knights and DragonsGiven n distinct points (strength, magic), decide for each whether it lies in the convex hull of the others, since a point is reachable by repeated weighted averaging of the other points exactly when it is not a vertex of the hull. | Hard8 | GeometrySorting+2 | No attempts yet | 4s | 512 MB | Judgeable |
| Three Primary ColorsGiven up to 25,000 colored rectangles painted one at a time without repainting already covered pixels, report the total area of each of the seven resulting color regions. | Hard8 | Divide and conquerSegment tree+2 | No attempts yet | 3s | 256 MB | Judgeable |
| What Goes Up Must Come DownRearrange the cards by adjacent swaps into a bitonic order with the fewest moves, counting inversions by value. | Hard8 | Divide and conquerSorting+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Colorful TreeMaintain vertex colors on a tree under point updates and answer queries giving the number of edges in the minimal subtree spanning all vertices of one color. | Hard8 | TreeDFS+2 | No attempts yet | 5s | 512 MB | Judgeable |
| Sort It OutFind the smallest subset of cow IDs S such that repeatedly yelling at each ID in S in increasing order eventually sorts the permutation, then output the K-th lexicographically smallest such subset. | Hard8 | SortingCombinatorics+2 | No attempts yet | 2s | 512 MB | Judgeable |
| BulldozerChoose two parallel lines and take every weighted point between them, maximizing the sum of gold values minus rock costs. | Hard8 | GeometrySorting+2 | No attempts yet | 2s | 512 MB | Judgeable |
| IlluminationChoose a subset of trees to decorate, maximizing total beauty, so that for each of M given intervals at most one tree inside it is chosen. | Hard8 | Dynamic programmingSegment tree+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Live ProgrammingChoose a subset of songs within total length T and order them to maximize the sum of basic points minus squared feature differences between consecutive songs. | Hard8 | Dynamic programmingSorting+2 | No attempts yet | 5s | 512 MB | Judgeable |
| Librarian's WorkGiven a shuffled permutation with book weights, restore the original order using two adjacent-rotation-like moves and minimize total labor cost. | Hard8 | GreedyDynamic programming+2 | No attempts yet | 5s | 512 MB | Judgeable |
| Santa's GiftFor each family size k from 1 to M, choose a subset of gift kinds so k copies of each fit in capacity C, maximizing total price. | Hard8 | Dynamic programmingGreedy+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Cat DatingIn a rooted tree, each den holds female cats or male cats with a fall limit; count the maximum number of female-male pairs where a male can reach a female downward within the distance limit. | Hard8 | DFSGreedy+2 | No attempts yet | 4s | 1024 MB | Judgeable |
| Card GameTwo players alternately remove a chosen card and every card with a smaller number; decide the winner under optimal play. | Hard8 | Game theoryDynamic programming+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Sum of VectorsChoose two of N vectors, each optionally sign-flipped per coordinate, to minimize the norm of their sum and output the pair with the chosen flips. | Hard8 | SortingGeometry+2 | No attempts yet | 0.5s | 512 MB | Judgeable |
| Distinct Substring Queries 2Process a stream of append-character and count-distinct-substrings queries on a growing string, answering each count query online. | Hard8 | StringString matching+2 | No attempts yet | 1s | 512 MB | Judgeable |
| K-th SubstringGiven a string S, answer queries that ask for the K-th distinct substring of S in lexicographic order, or -1 if it does not exist. | Hard8 | StringTrie+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Intersecting RectanglesGiven n axis-aligned rectangles with all x and y coordinates distinct, decide whether any two boundaries cross or touch. One rectangle fully containing another does not count. | Hard8 | SortingSegment tree+2 | No attempts yet | 2s | 512 MB | Judgeable |
| ShortcutGiven a weighted undirected graph with cows at each node, add one shortcut edge from node 1 to any other node to maximize the total decrease in shortest-path travel time. | Hard8 | GraphShortest path+2 | No attempts yet | 2s | 512 MB | Judgeable |
| KisikChoose K of N distinct buildings, arrange them side by side on the ground, and minimize the area of the enclosing bounding rectangle. | Hard8 | SortingDivide and conquer+2 | No attempts yet | 2s | 512 MB | Judgeable |
| SymphonyAdd one integer X to every element of A, then change at most K elements to any values, minimizing the sum of absolute differences against B. | Hard8 | SortingBinary search+2 | No attempts yet | 1s | 512 MB | Judgeable |
| TouristGiven a weighted graph, for each city 2 through N find a shortest path from city 1, and count the minimum number of edges whose weights are re-photographed across all chosen paths. | Hard8 | GraphShortest path+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Candy BoxesGiven N boxes, each with m candies of sweetness a at cost c, find for every k from 1 to L the minimum price of boxes so that a subset of candies sums exactly to k. | Hard8 | Dynamic programmingGreedy+1 | No attempts yet | 1.5s | 512 MB | Judgeable |
| SEGWAYSimulate N riders over a 300 m track with three speed sections and accelerators granting 1 s/m boost for X mod 20 meters, where X counts riders strictly ahead, and print each finish time. | Hard8 | SimulationImplementation+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Circular DNAGiven a circular sequence of start and end markers for many gene types, choose a cut position that maximizes how many gene types have their markers properly nested in the resulting linear subsequence. | Hard8 | ArrayStack+2 | No attempts yet | 3s | 512 MB | Judgeable |
| Card Factory (Large)Each of N cards shows its front initially; given M queries K that flip every card whose visible number is at most K, report the final visible sum. | Hard8 | SortingBinary search+2 | No attempts yet | 3s | 256 MB | Judgeable |
| NC StringCount the permutations of chosen words (spaced apart) that contain an N before a later C, modulo 1e9+7. | Hard8 | CombinatoricsDynamic programming+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Superb DartGiven a planar straight-line graph, list the areas of its bounded faces in increasing order, rounded to two decimals. | Hard8 | GeometryGraph+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Enchanted ForestChoose a path from node 1 to node n minimizing the sum of the maximum a-value and maximum b-value over its edges. | Hard8 | GraphDivide and conquer+2 | No attempts yet | 3s | 512 MB | Judgeable |
| Modified TreapAssign new distinct priorities to tree nodes so that the Cartesian-tree shape minimizes weighted depth plus K times the number of changed priorities. | Hard8 | Dynamic programmingTree+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Union of BallsAll ball centers lie on the x-axis, so the union is a solid of revolution; compute its volume as p/q times pi and output p times q inverse mod 1e9+7. | Hard8 | GeometrySorting+2 | No attempts yet | 2s | 1024 MB | Judgeable |
| Overflowing Gift CardsGiven each card's days until expiry and the day he plans to use it, find the fewest 30-day extensions so every card is still valid when used, under a rule that he must always use the card closest to expiry. | Hard8 | GreedySorting+2 | No attempts yet | 1s | 512 MB | Judgeable |
| The Little Match GirlChoose for each of N integers to skip it, multiply by its negative for 1 matchstick, or multiply by its positive value for 2 matchsticks, spending at most K, to maximize the product modulo 1e9+7. | Hard8 | GreedySorting+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| MaximizerGiven two permutations A and B of 1..N, find the minimum number of adjacent swaps in A needed to reach a permutation maximizing the sum of |a_i - b_i|. | Hard8 | GreedyCombinatorics+2 | No attempts yet | 2s | 1024 MB | Judgeable |
| Denouncing the MafiaGiven a rooted tree at node 1 and a limit K, choose up to K nodes to seed interrogations so the total number of reachable ancestors is maximized. | Hard8 | TreeGreedy+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Paris by NightGiven N graded points in general position, pick two boundary monuments and split the rest by the line through them to minimize the absolute difference of the two side sums. | Hard8 | GeometrySorting+2 | No attempts yet | 15s | 512 MB | Judgeable |
| Travel GuideGiven a weighted undirected graph with three special nodes, count the vertices that are not dominated in all three distances by another vertex. | Hard8 | Shortest pathGraph+2 | No attempts yet | 6s | 512 MB | Judgeable |
| Shopping MallSimulate customers choosing the counter with the minimum total wait (lowest index on ties), then compute a weighted sum of membership numbers in the order customers leave. | Hard8 | SimulationHeap+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Frog JumpGiven N disjoint horizontal line segments, two logs are connected if a vertical jump between them crosses no other log; answer queries on whether logs are reachable. | Hard8 | GeometryUnion-find+1 | No attempts yet | 1s | 512 MB | Judgeable |
| SeparatorAppend values one at a time to a growing sequence and after each append report how many indices are separators, meaning every earlier element is smaller and every later element is larger. | Hard8 | TreeImplementation+2 | No attempts yet | 1.2s | 512 MB | Judgeable |
| ExamFor each of Q threshold triples, count students with S>=X, T>=Y, and S+T>=Z, where N and Q reach 100000. | Hard8 | SortingPrefix sum+2 | No attempts yet | 3s | 1024 MB | Judgeable |
| Cake 3Choose M of N slices and arrange them in a cycle to maximize total value minus the sum of absolute color-depth differences around the cycle. | Hard8 | Dynamic programmingGreedy+2 | No attempts yet | 4s | 256 MB | Judgeable |
| MatryoshkaFor each query (A, B), take the dolls with R >= A and H <= B and find the minimum number of chains needed to store them all nested, i.e. the size of the largest antichain under the containment partial order. | Hard8 | SortingDynamic programming+2 | No attempts yet | 2s | 512 MB | Judgeable |
| TelegraphEach island's receiver points to one other island; turning it costs C_i. Find the minimum total cost so that every island can reach every other in the resulting functional graph. | Hard8 | GraphGreedy+2 | No attempts yet | 1s | 512 MB | Judgeable |
| InheritanceK children take turns picking the heaviest cycle-free set of edges from the graph, and we must report which child gets each edge or 0 if nobody does. | Hard8 | GraphUnion-find+2 | No attempts yet | 1s | 512 MB | Judgeable |
| BusGiven scheduled one-way buses with fixed departure and arrival times, compute for each query deadline L the latest time to leave stop 1 to reach stop N by L, or -1. | Hard8 | GraphSorting+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Growing Vegetables is FunGiven N plants in a row, find the minimum adjacent swaps to arrange heights so every plant is a prefix maximum or a suffix maximum. | Hard8 | GreedySorting+2 | No attempts yet | 2s | 512 MB | Judgeable |
| ScarecrowsCount pairs of scarecrows that can be the SW and NE corners of an axis-aligned rectangle whose interior contains no other scarecrow. | Hard8 | SortingDivide and conquer+1 | No attempts yet | 4s | 512 MB | Judgeable |
| SpyGiven a subordinate subtree for every leader in two rooted trees of N employees, count for each IOI employee how many of the M spy projects succeed, where spy b succeeds when the matching JOI employee lies in research project b's subtree. | Hard8 | TreeDFS+2 | No attempts yet | 2s | 256 MB | Judgeable |
| Hat StandPlace c-1 spare hats on hooks so the total walking distance over a given sequence of n hats is minimized, then output the best arrangement. | Hard8 | GreedyDynamic programming+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Copy and PasteGiven a string of up to 200,000 lowercase letters, find the length of the longest substring that appears at least twice at disjoint positions, or -1 if none exists. | Hard8 | StringBinary search+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Where Have You Bin?Given a row of bins labeled by company, delete the listed bins, add the requested new bins, and find the minimum total item cost to keep every company's bins contiguous. | Hard8 | Dynamic programmingImplementation+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Circle GardenGiven side lengths of a cyclic polygon, find the circumradius, or report no circle, an outside center, or a radius over 120 inches. | Hard8 | GeometryMath+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Warm Pork GukbapPlace any number of stores on a line of positions 1 to 50000, each store costs M, each delivery costs C times distance to nearest store; find the minimum total cost and the smallest number of stores achieving it. | Hard8 | Dynamic programmingBinary search+2 | No attempts yet | 1s | 256 MB | Judgeable |
| 3D Points and QueriesCount points inside axis-aligned 3D boxes, where each query's box coordinates are decoded by XOR with the running sum of previous answers. | Hard8 | Segment treeSorting+2 | No attempts yet | 7s | 1024 MB | Judgeable |
| Strike ZoneGiven weighted point sets P1 (+c1 each) and P2 (-c2 each) with distinct x and y coordinates, find an axis-parallel rectangle maximizing c1*s minus c2*b. | Hard8 | Dynamic programmingSorting+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Interstellar TravelGiven n angular intervals where each star contributes t - s*dist(a,b), find the launch angle b maximizing the sum of contributions. | Hard8 | GeometryMath+2 | No attempts yet | 5s | 512 MB | Judgeable |
| Jumping PathGiven a rooted tree with labels, find the length of the longest ancestor chain with nondecreasing labels, and count how many such chains of that length exist modulo 11092019. | Hard8 | Dynamic programmingDFS+2 | No attempts yet | 10s | 512 MB | Judgeable |
| Glow, Pixel, Glow!Given horizontal and vertical pulses crossing a grid of wires, count the pixels where current passes through both intersecting wires at the same time. | Hard8 | SortingImplementation+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Building the Perfect HouseGiven N points, none at the origin, find the largest square centered at the origin that contains no point strictly inside it, then print its perimeter to four decimals. | Hard8 | GeometryBinary search+2 | No attempts yet | 1.5s | 512 MB | Judgeable |
| Dazzling StarsGiven N stars with coordinates and brightness, decide whether some rotation of the picture makes brighter stars print no later than dimmer ones, where printing goes top to bottom. | Hard8 | GeometrySorting+2 | No attempts yet | 0.2s | 512 MB | Judgeable |
| MeetingsCows on a line swap velocities when they meet, stop at barns, and the question asks how many meetings occur before half the total weight has stopped. | Hard8 | SortingMath+2 | No attempts yet | 1s | 512 MB | Judgeable |
| GrudanjeGiven a word and Q substrings, find the first snowball throw index (in a given order of positions) after which no substring contains two uncovered equal letters. | Hard8 | ArrayBinary search+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Close NumbersGiven a permutation p and q range queries [l, r], find the minimum absolute difference between any two values in the subarray p[l..r]. | Hard8 | ArraySorting+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Black DebtContestants get point increases over time; after each update, report the total count of (yellow, black) pairs where the black contestant has strictly more points. | Hard8 | Segment treeBinary search+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Cafebazaar's Chess TournamentGiven n players each with an opening and ending skill, count how many distinct tournament scores a new player with freely chosen distinct skills can achieve. | Hard8 | GeometrySorting+2 | No attempts yet | 2s | 512 MB | Judgeable |
| LogisticsFor each query, decide whether c drivers who can each drive at most their own mileage limit can cover a route of s km in one convoy, given the drivers may swap at stops. | Hard8 | GreedySorting+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Copy Shop SchedulingGiven deadlines and page counts for orders arriving one by one, after each addition report the smallest possible maximum lateness when preemptive scheduling is allowed on one machine. | Hard8 | GreedySorting+2 | No attempts yet | 2s | 512 MB | Judgeable |
| StrawberryStrawberries at positions ripen at given times; starting and ending at 0, move at speed 1 and find the minimum time to harvest all after they ripen. | Hard8 | Dynamic programmingGreedy+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Post Office 1Place P post offices among V villages on a circular road of circumference L to minimize the total distance from every village to its nearest office, and output both the cost and chosen positions. | Hard8 | Dynamic programmingBinary search+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| Farm of MonstersYou and a fixed greedy opponent alternate attacking monsters; you choose targets to maximize the number of monsters you personally kill. | Hard8 | GreedySorting+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Face Recognition AlgorithmGiven a planar straight-line embedding of a connected graph, decide whether every face, including the outer one, is bounded by exactly three edges. | Hard8 | GeometryGraph+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Bad DoctorEach doctor prescribes a set of medicines over a day interval; ignoring one doctor, compute the total cost of distinct medicines needed per day summed over all days. | Hard8 | Segment treeSorting+2 | No attempts yet | 3s | 512 MB | Judgeable |
| ICPC CampGiven n days, p classical and q creative problems with difficulty values, pair one of each per day so every pair sums to at most s, minimizing the largest within-pair difference; output -1 if impossible. | Hard8 | Binary searchGreedy+2 | No attempts yet | 4s | 512 MB | Judgeable |
| Bus StopEach of n bus routes has independent waiting time uniform on [0, di]; find the expected minimum, output as a fraction modulo 998244353. | Hard8 | ProbabilityMath+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Snowy SmileGiven up to 2000 weighted points, find an axis-aligned rectangle maximizing the sum of weights of points inside or on its border, allowing an empty rectangle for zero. | Hard8 | Dynamic programmingSorting+2 | No attempts yet | 3s | 512 MB | Judgeable |
| The Older We Are, The Worse It HurtsRoot the tree anywhere and order each node's children so that the weighted sum of DFS discovery times is minimized; output that minimum. | Hard8 | TreeDFS+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Dull ChocolatesCount prefix rectangles of a huge grid whose parity of white cells is odd versus even, given at most 1000 white cells. | Hard8 | Prefix sumSorting+2 | No attempts yet | 9s | 512 MB | Judgeable |
| Invited SpeakersGiven n red and n blue points in the plane with distinct x and y coordinates and no three collinear, draw n disjoint polygonal chains pairing each red point with a blue point. | Hard8 | GeometryGreedy+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Help Yourself (Gold)Sum the number of connected regions in the union of segments over all 2^N subsets, modulo 1e9+7. | Hard8 | CombinatoricsSorting+2 | No attempts yet | 2s | 512 MB | Judgeable |
| O Life of My YouthGiven N pairs of happiness and fatigue with some values missing (0), find the largest K < N such that all young-day pairs can exceed all old-day pairs in happiness and stay below them in fatigue. | Hard8 | SortingGreedy+2 | No attempts yet | 2s | 1024 MB | Judgeable |
| HaircutFor each threshold j from 0 to N-1, clip every value above j down to j and count the resulting inversions. | Hard8 | SortingPrefix sum+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Social DistancingPlace N cows on distinct integer grass points across M disjoint intervals on a line so that the minimum pairwise distance D is as large as possible, and output the largest achievable D. | Hard8 | Binary searchGreedy+2 | No attempts yet | 1s | 512 MB | Judgeable |
| The Moo ParticleGiven N points with distinct coordinates, one of two points may vanish when one dominates the other; find the minimum number of points that can remain. | Hard8 | SortingGreedy+2 | No attempts yet | 1s | 512 MB | Judgeable |
| New Year and ConferenceGiven n lectures, each with one time interval at venue a and another at venue b, decide whether every subset that is conflict-free at one venue is also conflict-free at the other. | Hard8 | IntervalsSorting+2 | No attempts yet | 2s | 1024 MB | Judgeable |
| New Year and Castle ConstructionGiven n points with no three collinear, count over all points p the number of 4-point subsets whose convex quadrilateral strictly contains p, and sum these counts. | Hard8 | GeometryCombinatorics+2 | No attempts yet | 3s | 512 MB | Judgeable |
| PasswordsGiven n rows of m letters, permute the columns so the rows become lexicographically nondecreasing, choosing the smallest such permutation or reporting NIE. | Hard8 | GreedySorting+2 | No attempts yet | 1.5s | 64 MB | Judgeable |
| Cost Of SubtreeGiven a tree with weighted edges, find a non-empty connected edge set maximizing its edge count times the minimum edge weight in it. | Hard8 | TreeUnion-find+2 | No attempts yet | 1s | 512 MB | Judgeable |