Hello, Codeforces!
The 2025-2026 ICPC Latin American Regional Programming Contest was held last weekend, and the full problem set is now available on Codeforces Gym for virtual participation and upsolving. Whether you want a team practice or a solo grind, you're invited to try it and discuss solutions here.
This contest is part of the ICPC 2025-2026 cycle for Latin America and serves to select the teams for the Latin America Championship (March 2026, Chile). This year's regional had 558 official teams from 18 countries, competing simultaneously across 16 sites throughout the region. You can check the official results here: https://scorelatam.naquadah.com.br/latam-2025/.
Huge thanks to the LATAM jury who prepared and tested the tasks, and to all the volunteers who helped run the onsite events. The problems were written and prepared by Alejandro Strejilevich de Loma, andremfq, brunomont, gpoesia, Inés Kereki, lsantire, mnaeraxr, MarcosK, martins, Rafael Armando Garcia Gomez, rafaelgo, Roberio, cabessa and me.
An editorial with solution sketches is in the works; this post will be updated with the link as soon as it's ready.
Use the comments to share hints, approaches, and editorials (please mark spoilers).
Hope you enjoy the problems and have fun!









.
Problem I is cute, here's a brief solution sketch since there appears to be no official editorial.
Consider the following reduced version of the problem:
We'll define our state to be $$$(x, y)$$$, where $$$x$$$ is the current location of the red pointer, and $$$y$$$ is that of the green pointer.
The initial state is $$$(a, b)$$$. We'll explore states such that if a state $$$(x, y)$$$ is reached, there exists a valid pair of disjoint paths from $$$a$$$ to $$$x$$$ and from $$$b$$$ to $$$y$$$.
But wait, you say, how can we perform this exploration? Don't we need to maintain more information? We perhaps need to maintain two bitmasks to prevent intersections between paths? The answer is no, if we explore states carefully. We're going to explore them in such a way that if state $$$(x, y)$$$ is reached, then a couple more conditions hold:
How can we ensure this? By just enforcing one simple rule when performing transitions from a state $$$(x, y)$$$:
Why does this rule enforce the conditions mentioned above?
Pseudocode takes the following form:
There are $$$O(n^2)$$$ states and $$$O(m \cdot n)$$$ transitions, where $$$m$$$ is the total number of edges, which is good enough for the problem.