Issue List
-
â ARC074D F - Lotus Leaves Difficulty: 2208
-
â ABC193F F - Zebraness Difficulty: 2475 AC
-
â ARC085E E - MUL Difficulty: 2571 AC
-
ARC031D D - good shopper Difficulty: 2825 Consideration OK
-
ARC107F F - Sum of Abs Difficulty: 3130 Consideration OK
-
đ»KUPC2017H H - Make a Potion Difficulty: unknown Integer
-
TTPC2015L L - graph coloring Difficulty: unknown
-
The Problem of Finding the Best Choice
-
Typical pattern
- Paint a 100 x 100 grid in two colors.
- There are about 100 options for two choices.
- The cost and rewards will depend on that choice.
- There is a dependency between choices.
-
Represent the selection with a two-color fill of the vertex.
-
We call these paint colors S and T.
-
Introduce two apex starts and a goal
- These are painted with S and T, respectively.
- The vertices themselves are sometimes represented as S and T. I use start and goal in the code, and S and T in the diagram.
-
If itâs a two-choice option, itâs a natural response.
-
Can be expressed in more than three choices ARC107F.
-
-
The basic form of the minimum cut is âif the color of both ends of a side is different, a cost will be incurredâ and âwe want to minimize the costâ.
- If you subtract an edge of weight x from vertex S to vertex v, it means âpay cost x if v is Tâ.
- If you subtract an edge of weight x from vertex v to vertex t, it means âpay cost x if v is Sâ.
- If itâs a question of maximizing scores, make âscore reductionâ a cost.
- Consider the case where all scores are obtained to be the offset, and the decrease from that offset to be the cost
- If the cost is incurred when both ends of a side are the same color Invert one side of a bipartite graph.
- I donât care that the edge values are negative in this phase, because Iâll deal with that later.
-
Express the constraint âif vertex u is S, then vertex v is also Sâ by making the weight of edge uv sufficiently large
- If we make it bidirectional, we get the expression u=v.
-
Once the graph is constructed, solve for the maximum flow
- However, it does not correspond well with negative cost edges.
- It becomes unintelligible around the negative capacity.
- So weâll work on removing the negative edges here.
- Note the vertex v to which the negative edge -x is connected
- Vertex v color is either S or T
- Make it cost an additional x either way.
- Just add the additional cost of x to the sides Sv and vT
- Now the negative side disappears.
- This operation increases the offset by x
- This âadd xâ does not have to be exactly x, so if you are not comfortable with exactly x, you can just give a large enough value as you see fit.
- However, it does not correspond well with negative cost edges.
-
Once this is done, use an algorithm such as Dinic to find the maximum flow f from the start to the goal.
- Just read cost as capacity.
- The answer that offset - f seeks
- Cutting the smallest cut is not âcutting an edge.â I think I can organize it a little better now that Iâve noticed
- It might be good to re-explain some of the problems mentioned in Solve the âBurn Fill Problemâ using the smallest cut⊠using vertex painting instead of edge cutting.
- But Iâd prefer a problem I can solve with atcoder anyway.
- https://blog.hamayanhamayan.com/entry/2017/05/09/120217
- https://drken1215.hatenablog.com/archive/category/æć°ă«ăă
- AtCoder ARC 074 F - Lotus Leaves (yellow, 800 points) - Kenchonâs Competitive Pro Devotion Record
- AtCoder ARC 085 E - MUL (orange, 700 points) - Kenchonâs Competitive Pro Devotion Record
- Waseda University Programming Contest WUPC 2019 F - RPG - Kenchonâs Competitive Professional Devotion Record
- +4 AOJ
- â ABC193F diff:2475
- ARC107F diff: 3130
This page is auto-translated from /nishio/æć°ă«ăăă«ćž°ç using DeepL. If you looks something interesting but the auto-translated English is not good enough to understand it, feel free to let me know at @nishio_en. Iâm very happy to spread my thought to non-Japanese readers.