2025 ICPC Asia Seoul Regional Preliminary Solution Sketches
Disclaimer: This is an unofficial analysis of some possible ways to solve the problems of the 2025 ICPC Asia Seoul Regional Preliminary. They are not intended to give complete solutions, but rather to outline some approaches that can be used to solve the problems. If you find an error, please send me an email about it.
F. Inverse Look-and-Say
My solution: 239 bytes.
Read the input as a string . If is odd, , , or , then print .
Otherwise, for each , print times.
A. Best Partition
My solution: 346 bytes.
Let denote the answer for the first elements. Compute DP in .
Note that it can be solved in .
H. Mountain
My solution: 354 bytes.
Sort the points by , then take a longest strictly increasing sequence of .
I. Quadratic Equation
My solution: 114 bytes.
Let and be the roots of the equation .
Since and , we have , and .
C. Docking Day
My solution: 865 bytes.
Send all the points to in moves; then more moves always suffice to place them at their target positions.
Hence, we need extra coordinates beyond the critical ones. Insert up to auxiliaries into the gaps determined by , the critical coordinates, and ; then run BFS over states.
J. Rescue Squad
My solution: 1,053 bytes.
Reindex the vertices in nondecreasing degree, and orient each edge from the smaller to the larger index. With this orientation, each vertex has outgoing edges.
Handle all three configurations in total time.
B. Bridge
My solution: 1,440 bytes.
Sweep the path left-to-right, maintaining a stack of downward segments that can host the bridge's left endpoint.
For each chosen pair of host segments, minimize the maximum of three linear functions; only their pairwise intersection points are relevant, but I suggest using ternary search due to floating-point error.
E. Image Analysis
My solution: 2,016 bytes.
Since all and are distinct, when the frame moves by Manhattan distance , the in-frame set changes by single-point updates.
Apply standard Mo's ordering over frames, and answer the queries with square-root decomposed bucket sums.
D. Fox Buki
My solution: 1,602 bytes.
Construct a bipartite graph: add an edge for each card of type owned by fan . The graph is -regular, so it decomposes into perfect matchings.
In matching , if is chosen, define fan 's -th card to be of type . Then swapping fan 's -th card with fan 's -th card achieves the goal, with each card used at most once.
G. Magical Sort
My solution: 1,664 bytes.
Build a directed graph : if 's group- receiver is , add an edge with label . For every vertex, all outgoing edges share the same label.
Put if every infinite walk from yields the same edge-label string . The answer is .
Form by keeping exactly one outgoing edge per vertex. Then each has a unique infinite walk; let its string be . These strings can be compared in after precomputation.
Now, in , the information from suffices to determine which vertices belong to which equivalence classes.
It is really challenging to generate valid inputs. If you know a way to validate inputs in , please let me know.