#flows
CF 1252L - Road Construction
CF 1252L - Road Construction Rating: 2300 Tags: flows, graphs Solve time: 1m 38s Verified: no Solution Problem Understanding We are given a set of cities where each city proposes exactly one possible road. City $i$ wants to connect to a specific other city $A_i$, so each proposal is an undirected edge $(i, A_i)$. If we ignored all constraints about workers, these proposed edges already form a connected graph, so...
CF 1250K - Projectors
CF 1250K - Projectors Rating: 3100 Tags: flows, graphs Solve time: 1m 52s Verified: no Solution Problem Understanding We are given two sets of time intervals: one set represents lectures, the other represents seminars. Each lecture must be assigned a high-definition projector, while each seminar can use any projector, either HD or ordinary. Every projector can handle at most one event at a time, but can be reused later once...
CF 1070I - Privatization of Roads in Berland Rating: 2400 Tags: flows, graph matchings, graphs Model: gpt-5-3-mini Solve time: 1m 21s Verified: no (0/1 samples) Share: https://chatgpt.com/share/6a33bf33-5374-83ec-9b48-0bc381466acc Solution Problem Understanding We are given a simple undirected graph with up to 600 vertices and 600 edges per test case. Each edge must be assigned a label, called a company index. The assignment has two constraints. First, every company is allowed to...
CF 1023G - Pisces
CF 1023G - Pisces Rating: 3400 Tags: data structures, flows, trees Solve time: 2m 54s Verified: yes Solution Problem Understanding We are given a weighted tree where each edge represents a river with a travel time. Fish can move continuously along these edges: traversing an edge of length $l$ takes exactly $l$ days, and fish may also wait arbitrarily at vertices. Fish never split or merge; each fish is an...
CF 1214D - Treasure Island
CF 1214D - Treasure Island Rating: 1900 Tags: dfs and similar, dp, flows, hashing Solve time: 3m 29s Verified: yes Solution Problem Understanding We are given an $n \times m$ grid that represents a map. Each cell is either blocked or free. We start at the top-left cell $(1,1)$ and want to reach the bottom-right cell $(n,m)$. Movement is highly restricted: from any cell we can only go either one...
CF 1184B3 - The Doctor Meets Vader (Hard)
CF 1184B3 - The Doctor Meets Vader (Hard) Rating: 2700 Tags: flows, shortest paths Solve time: 5m 10s Verified: no Solution Problem Understanding We are working on a weighted selection problem over two interacting layers. First, there is a small fixed graph of planets, where distances are measured as the shortest number of wormholes between nodes. Then there is a large set of spaceships and bases placed on these planets....
CF 1090E - Horseback Riding
CF 1090E - Horseback Riding Rating: 2300 Tags: flows, graphs Solve time: 1m 35s Verified: no Solution The problem statement sections are empty, so there isn’t enough information to reconstruct what Codeforces 1090E - Horseback Riding actually asks or which flow/graph construction it uses. Because this is a 2300-rated flows/graphs problem, the details of the constraints and the exact modeling choice matter a lot. Even small differences like whether edges...
CF 1184B2 - The Doctor Meets Vader (Medium)
CF 1184B2 - The Doctor Meets Vader (Medium) Rating: 2200 Tags: flows, graph matchings, graphs, shortest paths, sortings Solve time: 2m 6s Verified: yes Solution Problem Understanding The galaxy is a small graph of planets connected by wormholes, where distance between planets is measured as the minimum number of edges in this graph. On top of this infrastructure, there are two kinds of actors: empire ships and rebel bases. Each...
CF 1510B - Button Lock
CF 1510B - Button Lock Rating: 2600 Tags: flows, graph matchings, graphs Solve time: 3m 7s Verified: yes Solution Problem Understanding The problem gives us a push-button combination lock with d buttons labeled from 0 to d-1 . Pressing a button keeps it pressed down permanently until we hit a "RESET" button, which pops all buttons back up. The lock opens instantly when a specific set of buttons is pressed...
CF 1530D - Secret Santa
CF 1530D - Secret Santa Rating: 1600 Tags: constructive algorithms, flows, graphs, greedy, math Solve time: 2m 38s Verified: no Solution Problem Understanding We are asked to construct a permutation-like assignment for a group of people. Each person must give a gift to exactly one other person, and no one is allowed to give a gift to themselves. This already means we are building a permutation of size n with...
CF 1662J - Training Camp
CF 1662J - Training Camp Rating: - Tags: flows, graphs Solve time: 2m 3s Verified: no Solution Problem Understanding We are given an $n \times n$ grid of kids. Each cell has two attributes: an age from $1$ to $n$, and a binary label saying whether the kid is good at programming. The age condition is strong: every row and every column contains all distinct ages, so each row and...
CF 1666K - Kingdom Partition
CF 1666K - Kingdom Partition Rating: 3200 Tags: flows Solve time: 2m 8s Verified: no Solution Problem Understanding We are asked to partition a kingdom's towns into three districts, A, B, and C, corresponding to Adrian, Beatrice, and Cecilia. Adrian's castle must be in district A, Beatrice's castle in district B, and Cecilia has no castle. The goal is to assign each town to a district so that Adrian and...
CF 1765A - Access Levels
CF 1765A - Access Levels Rating: 2400 Tags: bitmasks, dsu, flows, graph matchings Solve time: 2m 29s Verified: no Solution Problem Understanding Each document is described by which developers should be able to open it. So every column of the input matrix is a subset of developers: those rows where the value is one form the “approved set” for that document. We are allowed to compress this binary matrix into...
CF 1773D - Dominoes
CF 1773D - Dominoes Rating: 2600 Tags: combinatorics, flows, graph matchings, greedy Solve time: 1m 49s Verified: yes Solution Bug Diagnosis Now we finally see a real logical failure rather than a wrapper issue. The produced output: 2 3 2 2 2 2 is structurally consistent but numerically wrong, which tells us the implementation is computing something uniform per position instead of position-dependent reachability. The core mistake is in how...
CF 1866G - Grouped Carriages
CF 1866G - Grouped Carriages Rating: 2100 Tags: binary search, data structures, dp, flows, greedy Solve time: 3m 10s Verified: yes Solution Problem Understanding Each carriage initially contains some number of passengers. A passenger starting in carriage i may move left or right, but cannot cross more than D_i doors. That means every passenger from carriage i must end up somewhere inside the interval $$[i-D_i,; i+D_i]$$ after clipping the endpoints...
CF 2038H - Galactic Council
CF 2038H - Galactic Council Rating: 3000 Tags: flows Solve time: 3m 7s Verified: yes Solution Problem Understanding Each turn in this game is a small strategic decision that affects two coupled systems at once. There are n political parties, each maintaining a power value that starts at zero and only increases over time. At every turn, Monocarp picks exactly one party to support, but he is forbidden from supporting...
CF 2061H2 - Kevin and Stones (Hard Version)
CF 2061H2 - Kevin and Stones (Hard Version) Rating: 3500 Tags: flows, graphs Solve time: 1m 40s Verified: no Solution Problem Understanding We are given an undirected graph where each vertex may or may not contain a stone. Initially, some vertices are marked with stones, and we are also given a target configuration with the same number of stones. The task is to decide whether we can transform the initial...
CF 2061H1 - Kevin and Stones (Easy Version)
CF 2061H1 - Kevin and Stones (Easy Version) Rating: 3500 Tags: flows, graph matchings, graphs Solve time: 1m 32s Verified: no Solution Problem Understanding Kevin has a graph where each vertex may initially contain a stone or be empty. He also has a target configuration indicating where the stones need to end up. On each move, Kevin can simultaneously move each stone from its current vertex to an adjacent vertex,...
CF 2068K - Amusement Park Rides
CF 2068K - Amusement Park Rides Rating: 3000 Tags: flows, graphs Solve time: 1m 28s Verified: no Solution Problem Understanding We are asked to schedule three friends to ride every attraction in an amusement park exactly once, where each ride has a periodic schedule. Each attraction operates at multiples of its own interval a_i . Every minute, the friends can choose one attraction that is currently available to ride, or...